Click here to Skip to main content
15,922,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDll Function Extractor Pin
Mark Sanders29-May-03 5:26
Mark Sanders29-May-03 5:26 
GeneralRe: Dll Function Extractor Pin
Rick York29-May-03 5:59
mveRick York29-May-03 5:59 
GeneralRe: Dll Function Extractor Pin
basementman29-May-03 6:22
basementman29-May-03 6:22 
GeneralActivex Pin
Anonymous29-May-03 5:18
Anonymous29-May-03 5:18 
GeneralRe: Activex Pin
David Crow29-May-03 7:24
David Crow29-May-03 7:24 
GeneralPreventing an external app from closing Pin
EdwaM29-May-03 5:05
EdwaM29-May-03 5:05 
QuestionHow to load RTF file with pictures in CRichEdit? Pin
Yasen Georgiew29-May-03 4:37
Yasen Georgiew29-May-03 4:37 
QuestionTooltips on my own CButtons?? Pin
kallareka29-May-03 3:13
kallareka29-May-03 3:13 
I have a dialog in which i create buttons dynamically, i have derived my own class called CBokningsButton from CButton... here's the problem, i get an assertion error when i try to do: m_tooltip.AddTool(GetDlgItem(9001 ,"hey"));
the assertion error is: ASSERT(::IsWindow(m_hWnd));

the wierd part (or the part I find wierd) is that i can do this if i double create the buttons. it hard for me to explain exactly how i mean but ill try:

When i run the prog it creates some buttons then if the user change some stuff it deletes the buttons and create new ones. each button represents a different time in a day, depending on which day the users select the buttons can have a different layout depending in the information i get from a mysql database.
So before i create buttons i delete the old ones like this:

CBokningsButton* ptrButton;
for(int t=0;t<200;t++)
{
if( (ptrButton = (CBokningsButton*)GetDlgItem(9001+t)) != NULL)
{
// button exists
ptrButton->DestroyWindow();
}
}

now i know this i like the worst solution ever to delete buttons but never mind that now, the thing is that if i replace the DestroyWindow() line with my AddTool line i get the tooltips to work the second time i create the buttons (rember that now the old ones hasnt been deleted so the new are just printed on top of the old ones).
If i try to do the AddTool any place else in the program i get the assertion error...

i thought it to be most logical to do AddTool at the same time i create the button but that gives me the same error

does anyone know what im talking about Smile | :) and if so can you help me?

thanx

/Eric
GeneralUsing FlexGrid control.... Pin
Mr Bose Dayala29-May-03 2:37
Mr Bose Dayala29-May-03 2:37 
GeneralRe: Using FlexGrid control.... Pin
Toni7829-May-03 18:57
Toni7829-May-03 18:57 
GeneralRe: Using FlexGrid control.... Pin
Mr Bose Dayala29-May-03 20:41
Mr Bose Dayala29-May-03 20:41 
GeneralRe: Using FlexGrid control.... Pin
Toni7830-May-03 16:47
Toni7830-May-03 16:47 
GeneralNeed process handle on opening shell app Pin
DavidADEW29-May-03 2:33
DavidADEW29-May-03 2:33 
GeneralRe: Need process handle on opening shell app Pin
valikac29-May-03 10:24
valikac29-May-03 10:24 
GeneralHelp Visual C++ vs Sql Server 2000 Pin
SD329-May-03 2:33
SD329-May-03 2:33 
GeneralRe: Help Visual C++ vs Sql Server 2000 Pin
David Crow29-May-03 4:03
David Crow29-May-03 4:03 
GeneralRe: Help Visual C++ vs Sql Server 2000 Pin
basementman29-May-03 4:10
basementman29-May-03 4:10 
GeneralTransparent Icons Pin
AnkushChopra29-May-03 2:31
AnkushChopra29-May-03 2:31 
GeneralRe: Transparent Icons Pin
MemLeak29-May-03 5:33
MemLeak29-May-03 5:33 
GeneralRe: Transparent Icons Pin
AnkushChopra30-May-03 1:49
AnkushChopra30-May-03 1:49 
GeneralRe: Transparent Icons Pin
MemLeak30-May-03 3:05
MemLeak30-May-03 3:05 
GeneralTree Control with Checkboxes .... Pin
rohit.dhamija29-May-03 2:05
rohit.dhamija29-May-03 2:05 
GeneralRe: Tree Control with Checkboxes .... Pin
AnkushChopra29-May-03 2:27
AnkushChopra29-May-03 2:27 
GeneralSafeArray Pin
vikramlinux28-May-03 23:31
vikramlinux28-May-03 23:31 
Generalhelp resolve access violation in ole32.lib Pin
safee ullah28-May-03 23:21
safee ullah28-May-03 23:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.