Click here to Skip to main content
15,903,203 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CE C++ - static text font and size how to Pin
LaCoder7-Jun-07 6:50
LaCoder7-Jun-07 6:50 
AnswerRe: CE C++ - static text font and size how to Pin
Anurag Gandhi7-Jun-07 6:35
professionalAnurag Gandhi7-Jun-07 6:35 
GeneralRe: CE C++ - static text font and size how to Pin
LaCoder7-Jun-07 6:53
LaCoder7-Jun-07 6:53 
QuestionVariable Resource Ids Pin
maberry7-Jun-07 6:05
maberry7-Jun-07 6:05 
QuestionRe: Variable Resource Ids Pin
Mark Salsbery7-Jun-07 6:50
Mark Salsbery7-Jun-07 6:50 
AnswerRe: Variable Resource Ids Pin
maberry7-Jun-07 7:59
maberry7-Jun-07 7:59 
GeneralRe: Variable Resource Ids Pin
Mark Salsbery7-Jun-07 8:13
Mark Salsbery7-Jun-07 8:13 
QuestionLoadLibrary(Ex) and SetErrorMode problem Pin
Nitrogenycs7-Jun-07 5:59
Nitrogenycs7-Jun-07 5:59 
Hello,

Suppose I have a dll called MyDLL.dll which is statically linked to External.dll . Now I load MyDLL.dll from my application like this:

handle = LoadLibrary("MyDLL.dll");

Now, if MyDLL.dll and External.dll are present everything works just fine and LoadLibrary succeeds (i.e. handle != 0).
When I delete External.dll, then I get this behaviour:

a) In debug mode an error message box pops up saying that External.dll was not found.
b) In release mode I don't get this error message box. handle is simply 0. So I call GetLastError() along with FormatMessage() and get an error code of 126 (specified module not found).

Ideally, I'd like to suppress the message box in a) and get its message string so I can write a more detailed description of the problem into the log. I thought GetLastError() and FormatMessage() would take care of this, but apparently they only return some hardcoded standard messages.
So my primary question is whether there is a way to get this message string somehow?

If there is no way to get the message string, I'd like b) to always display the error message box. According to the MSDN docs ( http://msdn2.microsoft.com/en-us/library/ms680621.aspx ) I need to call something like SetErrorMode(0) ( maybe something like SetErrorMode( SetErrorMode(0) | ~SEM_FAILCRITICALERRORS) ).
This call does not seem to have any effect. The current error mode is 4 ( == SEM_NOALIGNMENTFAULTEXCEPT), but the error message box still does not pop up, it keeps failing silently (handle == 0).

Can somebody help me?
AnswerRe: LoadLibrary(Ex) and SetErrorMode problem Pin
bob169727-Jun-07 7:58
bob169727-Jun-07 7:58 
GeneralRe: LoadLibrary(Ex) and SetErrorMode problem Pin
Nitrogenycs7-Jun-07 8:36
Nitrogenycs7-Jun-07 8:36 
QuestionRe: LoadLibrary(Ex) and SetErrorMode problem Pin
bob169727-Jun-07 9:24
bob169727-Jun-07 9:24 
GeneralRe: LoadLibrary(Ex) and SetErrorMode problem Pin
Nitrogenycs7-Jun-07 9:45
Nitrogenycs7-Jun-07 9:45 
Questionstd::map but with multiple values for one key? Pin
Cyrilix7-Jun-07 3:57
Cyrilix7-Jun-07 3:57 
AnswerRe: std::map but with multiple values for one key? Pin
CPallini7-Jun-07 4:12
mveCPallini7-Jun-07 4:12 
GeneralRe: std::map but with multiple values for one key? Pin
Cyrilix7-Jun-07 4:23
Cyrilix7-Jun-07 4:23 
AnswerRe: std::map but with multiple values for one key? Pin
Michael Sadlon7-Jun-07 8:11
Michael Sadlon7-Jun-07 8:11 
GeneralRe: std::map but with multiple values for one key? Pin
Cyrilix7-Jun-07 8:19
Cyrilix7-Jun-07 8:19 
AnswerRe: std::map but with multiple values for one key? Pin
Michael Sadlon8-Jun-07 10:19
Michael Sadlon8-Jun-07 10:19 
Question#include files included more than once Pin
prithaa7-Jun-07 2:57
prithaa7-Jun-07 2:57 
AnswerRe: #include files included more than once Pin
CPallini7-Jun-07 3:04
mveCPallini7-Jun-07 3:04 
AnswerRe: #include files included more than once Pin
Cedric Moonen7-Jun-07 3:04
Cedric Moonen7-Jun-07 3:04 
AnswerRe: #include files included more than once Pin
Shouvik Das7-Jun-07 3:06
Shouvik Das7-Jun-07 3:06 
GeneralRe: #include files included more than once Pin
prithaa7-Jun-07 23:06
prithaa7-Jun-07 23:06 
GeneralRe: #include files included more than once Pin
Shouvik Das7-Jun-07 23:15
Shouvik Das7-Jun-07 23:15 
GeneralRe: #include files included more than once Pin
#realJSOP8-Jun-07 2:35
professional#realJSOP8-Jun-07 2:35 

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.