Click here to Skip to main content
15,889,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ syntax question Pin
Nishad S27-Apr-06 19:09
Nishad S27-Apr-06 19:09 
GeneralRe: C++ syntax question Pin
includeh1027-Apr-06 19:37
includeh1027-Apr-06 19:37 
GeneralRe: C++ syntax question Pin
toxcct27-Apr-06 22:28
toxcct27-Apr-06 22:28 
AnswerRe: C++ syntax question Pin
Michael Dunn27-Apr-06 19:46
sitebuilderMichael Dunn27-Apr-06 19:46 
GeneralRe: C++ syntax question Pin
Nishad S27-Apr-06 20:15
Nishad S27-Apr-06 20:15 
GeneralRe: C++ syntax question Pin
Michael Dunn27-Apr-06 20:37
sitebuilderMichael Dunn27-Apr-06 20:37 
AnswerRe: C++ syntax question [Edited] Pin
Maxwell Chen27-Apr-06 20:14
Maxwell Chen27-Apr-06 20:14 
QuestionIs it code optimization problem ? Pin
dharani27-Apr-06 16:28
dharani27-Apr-06 16:28 
Hello all
I have several binaries say ProductA1.exe ,ProductA2.exe and ProductA3.exe . My question is about a piece of code in all these binaries.(Though the binaries A2 and A3 differ in some other .cpp files , the code I am pasting below is exactly the same in all of them ..)

Purpose of the code : This code launches a .chm help file .

Code :
FunctionOne()
{
.....
.....
if(dwData != 0)
{
if(HtmlHelp(hwndCaller,
lpszHelpFile,
HH_HELP_CONTEXT,
dwData) == NULL)
{
HtmlHelp(hwndCaller,
lpszHelpFile,
HH_HELP_CONTEXT,
(DWORD)HELPID_ABOUT);
}
}
else
{
HtmlHelp(hwndCaller,
lpszHelpFile,
HH_DISPLAY_TOC,
(DWORD)HELPID_ABOUT);

}

.....
}

Problem : When I launch ProductA1.exe , the .chm file is not launched as the code enters the block if(dwData!=0) . But when I launch ProcuctA2.exe the help file is started . But in ProductA3.exe it again does not work !!!!
So I set active config as "Debug" and debugged the relevantfile.cpp and found that it works fine . But surprisingly only once I was able to reproduce the problem . ie => The same lines of code were executed and HtmlHelp( ) function was called but there was no help file shown on screen !!! . The behaviour same like ProductA1 and ProductA3 release EXEs.

So I set active config as "Release" and debugged (with "generate debug info" on in settings) again the beahvior is good !!
I put a dialog box inside the if blocks and replaced the my release exe with ProductA1 and ProductA3.exe , it works fine .

My question : Is it code optimization problem ? I can disable optimization using #pragma optimize ("", off) . But I strongly feel it is not code optmization problem becasue , i have seen variable values becoming junk in release and not in debug .
But in my case the sames EXEs are differing in behavioir .And also the behavior is confusing . And surprisingly when i started help from my collegues systems the help starts in all EXEs !! All the systems have XP SP2 1 GB RAM.

Can anyone throw any ideas ?


redindian

-- modified at 22:29 Thursday 27th April, 2006
AnswerRe: Is it code optimization problem ? Pin
Renjith Ramachandran27-Apr-06 20:04
Renjith Ramachandran27-Apr-06 20:04 
QuestionHow to drag and drop CListCtrl header? Pin
Ajax9527-Apr-06 14:07
Ajax9527-Apr-06 14:07 
AnswerRe: How to drag and drop CListCtrl header? Pin
Naveen27-Apr-06 17:30
Naveen27-Apr-06 17:30 
QuestionWhy does VC++ 2005 produce much larger EXE's than VC++ 2003 or VC++ 6.0 ? Pin
Defenestration27-Apr-06 13:45
Defenestration27-Apr-06 13:45 
AnswerRe: Why does VC++ 2005 produce much larger EXE's than VC++ 2003 or VC++ 6.0 ? Pin
Michael Dunn27-Apr-06 19:49
sitebuilderMichael Dunn27-Apr-06 19:49 
GeneralRe: Why does VC++ 2005 produce much larger EXE's than VC++ 2003 or VC++ 6.0 ? Pin
Defenestration2-May-06 16:12
Defenestration2-May-06 16:12 
QuestionFile's properties - Rt click, Summary Pin
john john mackey27-Apr-06 12:32
john john mackey27-Apr-06 12:32 
AnswerRe: File's properties - Rt click, Summary Pin
valikac27-Apr-06 12:44
valikac27-Apr-06 12:44 
AnswerRe: File's properties - Rt click, Summary Pin
Hamid_RT28-Apr-06 1:47
Hamid_RT28-Apr-06 1:47 
AnswerRe: File's properties - Rt click, Summary Pin
David Crow28-Apr-06 2:53
David Crow28-Apr-06 2:53 
GeneralRe: File's properties - Rt click, Summary Pin
john john mackey28-Apr-06 6:22
john john mackey28-Apr-06 6:22 
Questionstrange c code Pin
xyhan27-Apr-06 11:47
xyhan27-Apr-06 11:47 
AnswerRe: strange c code Pin
Trollslayer27-Apr-06 12:36
mentorTrollslayer27-Apr-06 12:36 
AnswerRe: strange c code Pin
Stephen Hewitt27-Apr-06 16:23
Stephen Hewitt27-Apr-06 16:23 
GeneralRe: strange c code Pin
xyhan28-Apr-06 5:34
xyhan28-Apr-06 5:34 
AnswerRe: strange c code Pin
Michael Dunn27-Apr-06 19:50
sitebuilderMichael Dunn27-Apr-06 19:50 
GeneralRe: strange c code Pin
xyhan1-May-06 7:01
xyhan1-May-06 7:01 

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.