Click here to Skip to main content
16,011,428 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can I lock up my application? Pin
Cathy19-Nov-01 12:29
Cathy19-Nov-01 12:29 
GeneralRe: How can I lock up my application? Pin
Nish Nishant19-Nov-01 13:03
sitebuilderNish Nishant19-Nov-01 13:03 
GeneralRe: How can I lock up my application? Pin
Anna-Jayne Metcalfe19-Nov-01 22:56
Anna-Jayne Metcalfe19-Nov-01 22:56 
GeneralRe: How can I lock up my application? Pin
Anna-Jayne Metcalfe19-Nov-01 22:52
Anna-Jayne Metcalfe19-Nov-01 22:52 
Generalc++ and database Pin
19-Nov-01 10:38
suss19-Nov-01 10:38 
GeneralMain Dialog & TabPage Pin
XAlien19-Nov-01 10:36
XAlien19-Nov-01 10:36 
GeneralRe: Main Dialog & TabPage Pin
luckylourson19-Nov-01 21:32
luckylourson19-Nov-01 21:32 
GeneralProblems selecting correct override Pin
Bill Wilson19-Nov-01 10:22
Bill Wilson19-Nov-01 10:22 
I'm having a strange problem that I'm hoping someone can shed some light on.

In my COM server (.exe) i invoke the CString method Format. The problem is execution goes to the wrong override! Then it blows up.

Here is the initial command:


[ccode]
strDiag.Format(("iTotalUnused * 100) / g_ThreadsArray.GetSize() = %d",iTotalUnused * 100) / g_ThreadsArray.GetSize());
[/ccode]

When this executes I trace it into:


[ccode]
void AFX_CDECL CString::Format(UINT nFormatID, ...){ CString strFormat; VERIFY(strFormat.LoadString(nFormatID) != 0); va_list argList; va_start(argList, nFormatID); FormatV(strFormat, argList); va_end(argList);}

[/ccode]

instead of

[ccode]

// formatting (using FormatMessage style formatting)void AFX_CDECL CString::FormatMessage(LPCTSTR lpszFormat, ...){
[/ccode]

The actual blowup occurs in the LoadString function (which I don't want called in the first place0. It calls AfxGetResourceHandle which asserts afxCurrentResourceHandle is NULL.

I don't believe this is a bug in the CString class (i've used it too many times in this program.) I don't see anything wrong in my code, unless its environmental:

This control is windowless, it launches some number of worker threads and assigns tasks to them as requested. This code runs in one of the worker threads. The threads are created by instantiating a CWinThread derived object and invoiking its CreateThread method.


Thanks for the help,
Bill
GeneralProblem solved, feeling stupid Pin
Bill Wilson19-Nov-01 11:19
Bill Wilson19-Nov-01 11:19 
GeneralRe: Problems selecting correct override Pin
Joaquín M López Muñoz19-Nov-01 11:20
Joaquín M López Muñoz19-Nov-01 11:20 
GeneralMemory DC at a differant BPP Pin
clintsinger19-Nov-01 9:40
clintsinger19-Nov-01 9:40 
GeneralRe: Memory DC at a differant BPP Pin
Christian Graus19-Nov-01 10:12
protectorChristian Graus19-Nov-01 10:12 
GeneralRe: Memory DC at a differant BPP Pin
clintsinger19-Nov-01 18:51
clintsinger19-Nov-01 18:51 
GeneralRe: Memory DC at a differant BPP Pin
Christian Graus19-Nov-01 18:57
protectorChristian Graus19-Nov-01 18:57 
QuestionHow??? Pin
pcverden19-Nov-01 9:02
pcverden19-Nov-01 9:02 
AnswerRe: How??? Another Home Work??? Pin
Carlos Antollini19-Nov-01 9:10
Carlos Antollini19-Nov-01 9:10 
GeneralRe: How??? Another Home Work??? Pin
pcverden19-Nov-01 9:52
pcverden19-Nov-01 9:52 
AnswerRe: How??? Pin
Carlos Antollini19-Nov-01 9:26
Carlos Antollini19-Nov-01 9:26 
GeneralRe: How??? Pin
pcverden19-Nov-01 9:55
pcverden19-Nov-01 9:55 
GeneralRe: How??? Pin
pcverden19-Nov-01 10:00
pcverden19-Nov-01 10:00 
GeneralRe: How??? Pin
Jon Sagara19-Nov-01 10:07
Jon Sagara19-Nov-01 10:07 
GeneralRe: How??? Pin
Carlos Antollini19-Nov-01 10:08
Carlos Antollini19-Nov-01 10:08 
GeneralRe: How??? Pin
Carlos Antollini19-Nov-01 10:08
Carlos Antollini19-Nov-01 10:08 
GeneralRe: How??? Pin
pcverden19-Nov-01 10:17
pcverden19-Nov-01 10:17 
GeneralRe: How??? Pin
Carlos Antollini19-Nov-01 10:36
Carlos Antollini19-Nov-01 10:36 

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.