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

C / C++ / MFC

 
GeneralRe: dynamic common controls Pin
Puah11-Jul-04 20:35
Puah11-Jul-04 20:35 
GeneralRe: dynamic common controls Pin
Antti Keskinen11-Jul-04 20:56
Antti Keskinen11-Jul-04 20:56 
GeneralNot really sure how to ask this! Pin
otrcomm11-Jul-04 18:41
otrcomm11-Jul-04 18:41 
GeneralRe: Not really sure how to ask this! Pin
V.11-Jul-04 20:41
professionalV.11-Jul-04 20:41 
GeneralRe: Not really sure how to ask this! Pin
otrcomm11-Jul-04 21:31
otrcomm11-Jul-04 21:31 
GeneralRe: Not really sure how to ask this! Pin
V.11-Jul-04 21:48
professionalV.11-Jul-04 21:48 
QuestionHow does this happen? Pin
the_augy11-Jul-04 18:36
the_augy11-Jul-04 18:36 
AnswerRe: How does this happen? Pin
Antti Keskinen11-Jul-04 19:27
Antti Keskinen11-Jul-04 19:27 
Microsoft would call this "behaviour by design".

The debug versions are much more error-tolerant than the release versions. The runtime error is caused by the invalid HINSTANCE variable (if LoadLibrary returns NULL). The debug version doesn't cause a runtime error, because, during the debug build phase, there is a compiler predefinition called _DEBUG. This predef causes the compiler to generate much heavier and more error-tolerant code, made especially for debug purposes. On the release versions, a _NDEBUG is specified.

The idea is that you create code, then do a debug build, then run/step through the code to see if it is working smoothly. Then you do a release build. It is supposed to work this way. Trying to alter this behaviour is the same thing as trying to reinvent the wheel.

The debug mode of Visual Studio, when ran with a debug build, is capable of cathing and handling numerous types of error that would quickly crash a release version. It is designed to help you predict errors and fix them beforehand when building your applications.

The reason why your error catcher doesn't handle "the NULL pointer" error in a release build is probably because you either have forgotten to use a try - catch block or then you are trying to check the error handler after the GetProcAddress is called. When HINSTANCE parameter is NULL, GetProcAddress will cause a runtime error. Check the HINSTANCE parameter instantly after you call LoadLibrary.

For more detailed error analysis, you should paste the library loading code here.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: How does this happen? Pin
the_augy11-Jul-04 20:04
the_augy11-Jul-04 20:04 
AnswerRe: How does this happen? Pin
V.11-Jul-04 20:44
professionalV.11-Jul-04 20:44 
Generalhelp! Pin
sunmozhou11-Jul-04 16:28
sunmozhou11-Jul-04 16:28 
GeneralRe: help! Pin
Ryan Binns11-Jul-04 17:53
Ryan Binns11-Jul-04 17:53 
GeneralRe: help! Pin
ThatsAlok11-Jul-04 22:32
ThatsAlok11-Jul-04 22:32 
QuestionString = File || Directory? Pin
Timothy Grabrian11-Jul-04 16:05
professionalTimothy Grabrian11-Jul-04 16:05 
AnswerRe: String = File || Directory? Pin
valikac11-Jul-04 17:15
valikac11-Jul-04 17:15 
AnswerRe: String = File || Directory? Pin
Michael Dunn11-Jul-04 19:56
sitebuilderMichael Dunn11-Jul-04 19:56 
AnswerRe: String = File || Directory? Pin
Anonymous11-Jul-04 23:42
Anonymous11-Jul-04 23:42 
GeneralMultiline listbox Pin
alesha11-Jul-04 14:22
alesha11-Jul-04 14:22 
GeneralRe: Multiline listbox Pin
Ryan Binns11-Jul-04 17:59
Ryan Binns11-Jul-04 17:59 
Generalbidirectional dictionary Pin
peterchen11-Jul-04 13:38
peterchen11-Jul-04 13:38 
GeneralRe: bidirectional dictionary Pin
Roger Allen12-Jul-04 0:31
Roger Allen12-Jul-04 0:31 
GeneralRe: bidirectional dictionary Pin
peterchen12-Jul-04 5:53
peterchen12-Jul-04 5:53 
Generalregexp - I'll never understand them... Pin
peterchen11-Jul-04 12:38
peterchen11-Jul-04 12:38 
GeneralRe: regexp - I'll never understand them... Pin
palbano11-Jul-04 13:22
palbano11-Jul-04 13:22 
GeneralRe: regexp - I'll never understand them... Pin
peterchen11-Jul-04 13:39
peterchen11-Jul-04 13:39 

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.