|
we're talking about a user who don't even know the fundamental differences between debug and release... do you think he could have customized its settings by any chance ?
|
|
|
|
|
My response was to your assertion that, "you cannot debug a program compiled in release mode". This is simply not true.
Steve
|
|
|
|
|
Rajasegar wrote: I am trying to debug a program in release build.
Why?
You definitely should use the debug build for that.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Okay, we used to debug from release builds in our development environment,
btw i will try to debug it from debug build, will this solve my problem,
but i would like to know what exactly is the problem...........
R@j@$eg@r
|
|
|
|
|
Rajasegar wrote: but i would like to know what exactly is the problem...........
how can we know ?
|
|
|
|
|
Often this problem comes from memory which was corrupted somewhere in the application. So check in your code if you do not write outside an array, work with freed pointers, and so on.
Jouir et faire jouir sans faire de mal ni à toi ni à personne, voilà je crois le fondement de toute morale
Fold with us! ¤ flickr
|
|
|
|
|
You can debug from release mode if you build with program database and switch off the optimization.
The debugger looks for the PDB file and will load it if present.
Change project setting in C/C++ General Tab to disable(debug) optimization and create Debug Info in Program Database.
Optimization can shuffle code around and remove redundant stuff which can confuse the debugger because the binary does not match the source.
Good Luck.
|
|
|
|
|
hi,
thanx for the reply buddy....
This problem still persists in both the release and debug builds of the same program. Initially i tried to debug in release build, but now i tried it in debug build, and now also i am getting the same message, i have tried the settings you mentioned, but still the message appears....
R@j@$eg@r
|
|
|
|
|
|
Rajasegar wrote: but now i tried it in debug build, and now also i am getting the same message
Ok.
The debugger should show you where in the code the error occures.
Maybe you need to user the "Call Stack" window to step up the call stack to your code.
There you should be able to find the problem.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Should have said that the suggestion will only help you debug a release version of an app. Not necessarily find this specific problem.
You could try the Exception dialog in the Debug menu. Only available during debugging. It lets you control debugger behaviour in the event of an exception. Can be useful but time consuming.
|
|
|
|
|
Not enough information. Can you list the call stack? The OS version. A list of loaded DLL's and their versions and base addresses?
Steve
|
|
|
|
|
I have a class derived from CDialogBar.
I create it in CMainFrm::OnCreate()function.
Used- EnableDocking(0) and FloatControlBar(), ShowControlBar() fuinctions to show, set poesition and set size of DialogBar.
Now it works well.
But in one condition (Say by clicking on some Menu) I dont want Dialogbar to be moved elsewhere. Meaning positions for Dialogbar should get locked. . Again by clicking on same menu it should be moved anywhere.
This is the requirement.
Now I tryed everything for making it FIXED at one place with
OnMOve() for dialogBar. With SetWindowpos() function.
For SetWindowPos() I tryed last flag parameter to be NORESIZE but it didnt worked. To confirm that this function works I tryed SWP_HIDEWINDOW then it hides the window.
Is there any way that I can toggle between FIXED position mode and Moving mode for Dialogbar???
Parametrs passed to create of Dialogbar
CBRS_BOTTOM | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
Is there any message I can get in MainFrame when I am resizing the DialogBar...
AmolM
|
|
|
|
|
Did you try to modify the window style?
If this does not work, AFAIK, you should override your CDialogClass and block the resizing from within, that is to forbid to resize it with the mouse if a boolean set by your menu item is true.
Aamol M wrote: SetWindowPos() I tryed last flag parameter to be NORESIZE but it didnt worked.
The SWP_NOSIZE flag is used to specify that the SetWindowPos function arguments relative to resizing won't be used.
Jouir et faire jouir sans faire de mal ni à toi ni à personne, voilà je crois le fondement de toute morale
Fold with us! ¤ flickr
|
|
|
|
|
ModifyStyle() will work if I remove the caption Bar of it BUT it does not look good. AND requirement is just to make it locked without removing caption abr.
Sorry. I have used SWP_NOMOVE flag for not moving the DialogBar...
My problem is I want to LOCK the positions in one case and unlock the positions (user can move it anywhere in other case.
But what should I override in my class???
I handled OnMove(), OnSize() every other meaage in DialogBar class but it doesnt come there at any time.
Is there anything I get notified in CMainFrm OR myDialogBar class that dialogBar is about to move....
I also handled WM_CAPUTRECHANGED message in DialogBar class. Control comes here when I release the capture from that dialogBar. But even at this time I call FloatControlBar() to some fixed position then also it doesnt work.
I have read somewhwre that DialogBar notification are sent to the parent window. In this case CMainFrm. But I didnt get it.
In CalcDynamicSize() handler of Dialogbar class, control comes here when we even click on caption bar of it. But there also I cant do anything to set the positions to default. I have uesed FloatControlBar() here.
AmolM
|
|
|
|
|
Aamol M wrote: I handled OnMove(), OnSize() every other meaage in DialogBar
I wouldn't try that way, because the dialog bar should resize itself when the application resizes, whatever the user-defined lock (or you will face ugly display problems, for instance when your dialog bar docked in the application will be higher than its container). I would rather try to prevent the user to resize by blocking its actions means, that is the mouse and the maximize/minimize buttons if any. So I would rather work on mouse and button messages
I won't be able to be more precise, I don't work with CDialogBar but generally with CControlBar derived classes.
HTH anyway,
When they kick at your front door
How you gonna come?
With your hands on your head
Or on the trigger of your gun?
Fold with us! ¤ flickr
|
|
|
|
|
Yes. You are right....
Here it is nothing to do with resizing the dialogbar. Its perfectly acceptable that the controls and dialogbar remains as is regardless of application size. I have only 3 bitmaps to show on dialogbar.
I hv handled OnLButtonClick for DialogBar by not calling default LButton event and now I can only handle moving of it (blocking of MOVE)from DialogBar. But when I click on CaptionBar of dialogBar then event doesnt come for LButtonDown() in DialogBar class. So if I can know "When I click on CaptionBar of DialogBar then where shd I get message (in MainFrame - parent of that window) or somewhere else. If that only I can figure out, then in that case I will not call default OnLButtonDown() and things shd work for me....
But I cant find where the event comes when I click on CaptionBar() of DialogBar......
Thanks
AmolM
|
|
|
|
|
Hi all,
Recently, I have encountered a problem and I tried to debug it. I found that system throw out a CMemoryException when I try to allocate 256MB memory.
I have a member function in one class . see the below list.
ClassA:ClassA()<br />
<br />
{<br />
<br />
...<br />
<br />
mImage = NULL;<br />
<br />
...<br />
<br />
}<br />
<br />
ClassA:~ClassA()<br />
<br />
{<br />
<br />
delete []mImage;<br />
<br />
}<br />
<br />
bool ClassA : FuncA()<br />
<br />
{<br />
<br />
...<br />
try<br />
{<br />
<br />
unsigned long* mImage = new unsigned long[67108864];
<br />
}<br />
catch( CMemoryException* pEX)<br />
{<br />
CString cstmp;<br />
CString csOut;<br />
MEMORYSTATUS stat; <br />
GlobalMemoryStatus (&stat); <br />
<br />
cstmp.Format("The MemoryStatus structure is %ld bytes long.\n",stat.dwLength);<br />
csOut+=cstmp;<br />
cstmp.Format("It should be %d.\n", sizeof (stat));<br />
csOut+=cstmp; <br />
cstmp.Format("%ld percent of memory is in use.\n",stat.dwMemoryLoad);<br />
csOut+=cstmp;<br />
cstmp.Format("There are %7d total Kbytes of physical memory.\n",stat.dwTotalPhys/ 1024);<br />
csOut+=cstmp;<br />
cstmp.Format("There are %7d free Kbytes of physical memory.\n",stat.dwAvailPhys/1024);<br />
csOut+=cstmp;<br />
cstmp.Format ("There are %7d total Kbytes of paging file.\n",stat.dwTotalPageFile/1024);<br />
csOut+=cstmp;<br />
cstmp.Format("There are %7d free Kbytes of paging file.\n",stat.dwAvailPageFile /1024);<br />
csOut+=cstmp;<br />
cstmp.Format("There are %7x total Kbytes of virtual memory.\n",stat.dwTotalVirtual/1024);<br />
csOut+=cstmp; <br />
cstmp.Format("There are %7x free Kbytes of virtual memory.\n",stat.dwAvailVirtual/1024);<br />
csOut+=cstmp;<br />
pEx->Delete();<br />
AfxMessageBox(csOut); <br />
}<br />
...<br />
}
When I called FuncA() to allocate memory and if I called another function beforre, system will throw out CMemoryException.
But if I called FuncA() to allocate memory and I don't called another function, sysem will not throw out CMemoryException.
When system throw out CMemoryException, I tried to print out the usage status of memory.
The result is as below
The MemoryStatus structure is 32 bytes long.
It should be 32.
36 percent of memory is in use.
There are 2096100 total Kbytes of physical memory.
There are 1321288 free Kbytes of physical memory.
There are 4041780 total Kbytes of paging file.
There are 3615048 free Kbytes of paging file.
There are 1fff80 total Kbytes of virtual memory.
There are 70e94 free Kbytes of virtual memory.
I think system has enough memory but I can't allocate successfully.Why? Could anybody give me some suggestions? Just like adjust some parameters for complier or OS.
Regards,
Pogo
|
|
|
|
|
One thought - you are allocating this in one big chunk of 256Mb.
Have you tried doing 16 lots of 16. and seeing how it fails?
And check the available RAM after each chunk of allocation to see if it drops nicely as expected.
Iain.
|
|
|
|
|
OK~ I see! I will try. Thanks for your suggestion.
|
|
|
|
|
Pogo Lin wrote: I think system has enough memory...
But is there a contiguous 256MB chunk?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I don't know. Could you tell me how to check that system has a contiguous 256MB chunk?
Thanks a lot.
|
|
|
|
|
I have a little problem for using SaveAs in outlook
Can someone tell me how to assign the parameter for olVCard ?
It is a variant, but I always fail. I don't know why.
Outlook::_ContactItemPtr pContact = NULL;
lpDispatch->QueryInterface(IID__ContactItem, (void**)&pContact);
if(pContact)
{
_variant_t VAR = vtMissing;
VAR.intVal = OlSaveAsType::olVCard;
HRESULT hr = pContact->SaveAs(L"c:\\11.vcf",VAR);
assert(SUCCEEDED(hr));
}
Reference:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/jul07/hey0724.mspx
On Error Resume Next
Const olFolderContacts = 10
Const olVCard = 6
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set colContacts = objNamespace.GetDefaultFolder(olFolderContacts).Items
For Each objContact In colContacts
strName = objContact.FirstName & objContact.LastName
strPath = "C:\Test\" & strName & ".vcf"
objContact.SaveAs strpath, olVCard
Next
|
|
|
|
|
faulfish wrote: ...but I always fail.
What is this supposed to mean?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all!
i need help.. i m calling fileRead function which reads the file and put some values in three strings cName1 ,cSvnPath1 ,cPassword1...now my question is ...that how should i call this function in main file so that these three strings can be utilised in main file only...??? please answer as early as possible.
void FileOperation::fileRead(char cName[100] , char cSvnPath[100] , char cPass[100])
{
char cName1[100];
char cSvnPath1[100];
char cPassword1[100];
FILE *fp;
fp = fopen("config.txt","r");
fgets(cName1 , 100, fp);
fgets(cSvnPath1 ,100 , fp);
fgets(cPassword1 ,1 ,fp);
fclose(fp);
}
|
|
|
|