Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using MFCPropertyGridCtrl and if it used in multiple DLL calls it will work fine for only first time or first called DLL or Exe. If we call next DLL in which we used property grid it gives debug assertion on mouse move on grid control.

As i tracked where code is getting break i came to that object of MCFPropertyToolTipCtrl is declared in CMFCPropertyGridCtrl class which is null while tracktooltip function is called onmousemove event.

What I have tried:

I tried creating a class which is derived from CMFCToolTiplCtrl and called it's create function and it takes parent window as argument in which i passed a object of grid.

i also tried calling AFX_MANAGE_STATE(AfxGetStaticModuleState()); before dialog is DOModal in which the grid is displayed.
Posted
Updated 4-Apr-18 6:51am

1 solution

Hey,
I encountered the exactly same problem while working with CMFCPropertyGridCtrl in my DLL project.
After many trial, i found a way to use CMFCPropertyGridCtrl in DLL without this error.
All you have to do is Create a derived class of CMFCPropertyGridToolTipCtrl(),Make its protected static variable "m_strClassName" NULL in Constructor.
for example;
//////////////////////////////////////////////////////////////////////////////////
Class CMyToolTipCtrl::CMFCPropertyGridToolTipCtrl();

CMyToolTipCtrl::CMyToolTipCtrl()
{
m_strClassName = "";
}
///////////////////////////////////////////////////////////////////////////////////
Now create ToolTipctrl from your CMFCPropertyGridToolTipCtrl() derived class on Init of the CMFCPropertyGridCtrl derived Class.
for example,
///////////////////////////////////////////////////////////////////////////////////
Class MyPropertyGridCtrl::CMFCPropertyGridCtrl();

void MyPropertyGridCtrl::Init()
{
CMyToolTipCtrl p_tooltip;
p_tooltip.Create(this);
}
//////////////////////////////////////////////////////////////////////////////////////
=======================================================================================
regards,
There is always a way.
Oza Priyanka.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900