Click here to Skip to main content
16,004,924 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMultiline cells in grid control. Pin
richiebabes1-Jun-04 12:13
richiebabes1-Jun-04 12:13 
GeneralRe: Multiline cells in grid control. Pin
Nirav Doshi1-Jun-04 23:39
Nirav Doshi1-Jun-04 23:39 
GeneralClosing SDI application Pin
dart131-Jun-04 12:10
dart131-Jun-04 12:10 
GeneralRe: Closing SDI application Pin
Michael Dunn1-Jun-04 13:10
sitebuilderMichael Dunn1-Jun-04 13:10 
GeneralRe: Closing SDI application Pin
dart132-Jun-04 0:32
dart132-Jun-04 0:32 
GeneralMnemonic Keys not working in menus Pin
Anonymous1-Jun-04 11:38
Anonymous1-Jun-04 11:38 
Generalquestion about API Pin
Anonymous1-Jun-04 11:36
Anonymous1-Jun-04 11:36 
GeneralCToolTipCtrl::Create fails... Pin
herbert_chow1-Jun-04 11:35
herbert_chow1-Jun-04 11:35 
Hi,

I have a visual C++ program with a couple menus. Upon entering each menu, I have something along the lines of this:

ttc_toolTips = new CToolTipCtrl();
ttc_toolTips->Create( this);

ttc_toolTips is a CToolTipCtrl pointer. And this is called within an overriden dialog class thus the reason for the "this" parameter to Create().

I tested this program on several machines running Windows 2000. The program seems to work on most systems except just one machine. On the machine that crashes, the program will work fine at first, but when I enter, exit about 10 menus which create tool tips like the code above, The CToolTipCtrl->Create function will fail and return 0.

When Create fails I get a message in the Visual C++ debug window along the lines of "Warning: Create window failed, GetLastError returned 0x00000000". Its true I don't deallocate the CToolTipCtrl objects created from the last 10 menus, but this machine has at 512MB of memory which is double the amount of memory some of these other machines have, and on these machines with less memory the program doesn't crash after like 50+ menus.

This seems strange to me and I can only ask under what conditions the Create function of CToolTipCtrl class can fail. Does it fail when I run out of memory? Could it be a result of hardware failure or bad video drivers? Note: I stepped through in the debugger and the "this" parameter passed to Create alawys has a valid dialog pointer, however the check ASSERT(::isWindow(hwnd)) within CToolTipCtrl class fails.

I also perform memory leak detection and _ASSERTE( _CrtCheckMemory( ) ); checks in many places of my code to make sure I'm not corrupting the heap anywhere. This is driving me nuts.

Any hints?

Thanks for reading this long message!







GeneralRe: CToolTipCtrl::Create fails... Pin
Diddy2-Jun-04 22:46
Diddy2-Jun-04 22:46 
GeneralRe: CToolTipCtrl::Create fails... Pin
herbert_chow3-Jun-04 6:09
herbert_chow3-Jun-04 6:09 
GeneralToolbar Editor Pin
Bob Stanneveld1-Jun-04 11:06
Bob Stanneveld1-Jun-04 11:06 
GeneralRe: Toolbar Editor Pin
TrungHuynh1-Jun-04 15:22
TrungHuynh1-Jun-04 15:22 
GeneralRe: Toolbar Editor Pin
Bob Stanneveld1-Jun-04 23:25
Bob Stanneveld1-Jun-04 23:25 
GeneralRe: Enumerate registered window messages? Pin
Ryan Binns1-Jun-04 18:14
Ryan Binns1-Jun-04 18:14 
GeneralWeb Query Pin
GWG1-Jun-04 10:43
GWG1-Jun-04 10:43 
GeneralI can't use member variables in new files Pin
Member 11407481-Jun-04 10:43
Member 11407481-Jun-04 10:43 
QuestionDnsQuery equivalent for Win 9x/ME? Pin
LukeV1-Jun-04 10:38
LukeV1-Jun-04 10:38 
AnswerRe: DnsQuery equivalent for Win 9x/ME? Pin
User 5838521-Jun-04 13:08
User 5838521-Jun-04 13:08 
GeneralRe: DnsQuery equivalent for Win 9x/ME? Pin
LukeV1-Jun-04 13:20
LukeV1-Jun-04 13:20 
Generalcarriage return in CFile::Write Pin
BlackDice1-Jun-04 9:30
BlackDice1-Jun-04 9:30 
GeneralRe: carriage return in CFile::Write Pin
f641-Jun-04 10:21
f641-Jun-04 10:21 
GeneralRe: carriage return in CFile::Write Pin
BlackDice1-Jun-04 10:30
BlackDice1-Jun-04 10:30 
GeneralRe: carriage return in CFile::Write Pin
Brad Bruce1-Jun-04 11:13
Brad Bruce1-Jun-04 11:13 
GeneralRe: carriage return in CFile::Write Pin
f641-Jun-04 11:17
f641-Jun-04 11:17 
GeneralRe: carriage return in CFile::Write Pin
BlackDice1-Jun-04 11:31
BlackDice1-Jun-04 11:31 

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.