|
HI all ,
Well i definitely do a ParseCommandLine(cmdInfo);
and later if (!ProcessShellCommand(cmdInfo))
return FALSE;
cmdInfo members are as follows
m_nShellCommand = FileNew
m_bRunEmbedded = 0;
m_bRunAutomated = 0;
m_bShowSplash =1;
Rest all string members of cmdInfo are empty
Callstack at unhandled exception
msvcr80.dll!_crt_debugger_hook(int _Reserved=2015552886)
|
|
|
|
|
THis problem happens for my VS2003 code after i port it to VS2005
|
|
|
|
|
So how are you verifying that ProcessShellCommand() is the culprit?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i need to do a button click only once and after the button is clicked once i need to disable the buttonclick option untill the operations inside the button click get completed,what should be done???
|
|
|
|
|
I think it's same as your question, Disable the Button window (call CWnd::EnableWindow(FALSE)) in the button event handler and enable it (CWnd::EnableWindow(TRUE)) after done.
|
|
|
|
|
|
manju#123 wrote: ,e I want result as "http://SERVER".....
_tcscat
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
thank you sir..
I got it..
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
And why did you delete the original post? Just adding "answered" on the topic by editing it is anough and maybe others can take profit of your question.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I create a MFC prject with a dialog.
I add a button to the dialog in resource.
But when I double click the button and want to add the even of click.
It appears the error message and stop the addding.
Somebody could tell me how to solve this problem.
The error message when I double click the button in thae dialog:
Add/Remove operation is impossible, becuase the code element CDialogCommon is read only
PS:CDialogCommon is the class I created and bounded it with a Dialog.
|
|
|
|
|
akira32 wrote: Add/Remove operation is impossible, becuase the code element CDialogCommon is read only
The message itself it is clear that you cannot added new handler because the file is read only. So just take the DialogCommon.h and CDialogCommon.cpp and remove the readonly attribute
|
|
|
|
|
Hello everyone,
I am confused what is the function of the 4 assembly instructions? I posted the 4 assembly instructions and related whole source code/assembly code below.
Any ideas?
00BA13CC lea edi,[ebp-0C0h]
00BA13D2 mov ecx,30h
00BA13D7 mov eax,0CCCCCCCCh
00BA13DC rep stos dword ptr es:[edi]
int sumExample (int a, int b)
{
00BA13C0 push ebp
00BA13C1 mov ebp,esp
00BA13C3 sub esp,0C0h
00BA13C9 push ebx
00BA13CA push esi
00BA13CB push edi
00BA13CC lea edi,[ebp-0C0h]
00BA13D2 mov ecx,30h
00BA13D7 mov eax,0CCCCCCCCh
00BA13DC rep stos dword ptr es:[edi]
return a + b;
00BA13DE mov eax,dword ptr [a]
00BA13E1 add eax,dword ptr [b]
}
#include <iostream>
using namespace std;
int sumExample (int a, int b)
{
return a + b;
}
int main()
{
int c = sumExample (100, 200);
cout << c << endl;
return 0;
}
thanks in advance,
George
|
|
|
|
|
George_George wrote: Any ideas?
I think you are running a debug version. In the release version it wont come.
The purpose of that instructions is to initialize all the memory location of from ebp-0C0h to edp with value 0CCCCCCCCh. The address "ebp - 0C0h" to ebp is the stack range of the function sumExample().
|
|
|
|
|
Thanks Naveen,
1.
You are correct, I am using debug version. So, only debug version will initialize stack used in current function to zero, and release version will not (I have tried in my sample, it is yes. Here I want to ask for a general answer.)
2.
How do you calculate the memory used will be 0x0C0 bytes?
regards,
George
|
|
|
|
|
George_George wrote: So, only debug version will initialize stack used in current function to zero
No to 0 but to 0x0CCCCCCCC
George_George wrote: How do you calculate the memory used will be 0x0C0 bytes?
Compiler does this at compile time itself. It calculate this value by adding the size of variables, flags to push etc.
|
|
|
|
|
Cool, nave!
From the code I posted in my 1st post, do you have any ideas why the stack used is 30h? I am very confused why the address begins with ebp-0C0h?
regards,
George
|
|
|
|
|
George_George wrote: do you have any ideas why the stack used is 30h?
Stack size is actually C0h. An that 30h is a counter ( C0h/4 = 30h ). I dont know why the stack size became C0h in your case. May be the compiler allocates atleast that much stack for a function and I have found it depends on the compiler version.
|
|
|
|
|
Thanks nave,
I found why I am confused by reading your reply, the counter is in the basis of 4-byte, not 1-byte, correct?
regards,
George
|
|
|
|
|
4 is the sizeof doubleword and the count is the count of doublewords as it uses "store string instruction" (rep stosd).[^]. if it uses rep stosb[^] it would be 1 byte
|
|
|
|
|
1.
Cool, Rajkumar. I think the 4 assembly instruction is doing stack initialization work for the stack space used for foo function, correct?
2.
But from the 4 assembly instruction, how do you know it ends from address ebp-0C0h and is 30 * 4 bytes length?
regards,
George
|
|
|
|
|
George_George wrote: I think the 4 assembly instruction is doing stack initialization work for the stack space used for foo function, correct?
i think so (i admit), to facilitate ease debug VC++ compiler fills stack variables with 0cch and heap with 0cdh(if my knowledge is correct ).
George_George wrote: But from the 4 assembly instruction, how do you know it ends from address ebp-0C0h and is 30 * 4 bytes length?
as naveen said, it is the stack frame size calculated by compiler, refer fixed-allocation-size
in [Prolog and Epilog^] and [Stack Allocation^] for paramters considered for that.
modified on Monday, July 21, 2008 9:28 AM
|
|
|
|
|
Thanks Rajkumar,
1.
Rajkumar R wrote: it is the stack frame size calculated by compiler, refer fixed-allocation-size
Do you mean stack will be initialized just according to how much data will be used actually? Or no matter how much data will be used, a fixed size will be initialized?
2.
My confusion is, from the assembly code I posted, more stack space than I acually used is initialized. Any comments?
regards,
George
|
|
|
|
|
Hi George,
I believe the whole idea is twofold:
1. to initialize your function's local variables to a strange value,
increasing the probability that you will discover potential "variable value used before
being set" mistakes. Your function does not have local variabled, so this does not apply here.
2. allocate more stack space than needed, and fill it with something that springs out
in a hex dump, so you can easily recognize the stack frames of each of your functions.
Both of these reasons don't hold true for release code, since they cost both CPU cycles
and stack space.
|
|
|
|
|
Thanks Luc,
Luc Pattyn wrote: allocate more stack space than needed
It is ok. But how to calculate the actual stack space used? For example, in my sample?
regards,
George
|
|
|
|
|
The compiler is responsible for stack allocation. It knows what it wants
to store on stack, and it can round it up to whatever number it chooses,
as long as it emits correct code (e.g. it should not initialize more memory
than it has allocated for each and every function).
|
|
|
|