|
Does this question relevant to c++? or its another question
|
|
|
|
|
I want to find the cause using VC++ debugger.
Before I found some dlls of Adobe Reader was running while File Dialog was open in Call stack window. This time problem is only in release mode.
Best Regards,
Suman
|
|
|
|
|
I too had that pblm in the file selection dialog after setting the _WIN32_WINNT=0x501 . But I found that the pblm is not coming if the CFileDialog is created in heap instead of stack.
nave
|
|
|
|
|
How can we decide creating dialog in heap or stack?
Best Regards,
Suman
|
|
|
|
|
rp_suman wrote: How can we decide creating dialog in heap or stack
I though the problem is in your program. But if it is in third party applications, whats the use even if you found out its in stack or heap?
If the problem is in your application, change the creation of CFileDialog stack to heap as follows
CFileDialog *pDlg = new CFileDialog;<br />
pDlg->DoModal();<br />
delete pDlg;
nave
|
|
|
|
|
The problem is not happening if I make copy of the application exe and data used by application once. And happens again if I make copy of the copy. ie., problem in alternate copies of exe&data.
This seems little complicated and I continue debugging.
Thank you very much for great help from all!!
Best Regards,
Suman
|
|
|
|
|
Can you tell me at what line the exception happens...?
nave
|
|
|
|
|
Naveen R wrote: Can you tell me at what line the exception happens...?
Where did he indicate that it was an exception?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In the subject itself...
nave
|
|
|
|
|
What is the value of _WIN32_WINNT ? Does the problem happen with GetOpenFileName() ? Are you using a hook?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The problem was, in release mode, m_ofn.lpstrInitialDir member of CFileDialog was initialized from the corruped INI file. Debug mode it was using correct file.
I am not using _WIN32_WINNT or hook.
Thanks a lot for great help!!
Best Regards,
Suman
|
|
|
|
|
i am calling a exe file from my program which in turn calling an batch. after executing this exe compltely only, i have to open a message box. but this is posting while the batch fle is opened. i used createprocess.
CString ovpncheck1;
ovpncheck1 = "C:\\Program Files\\OpenVPN\\bin\\sample.exe";
STARTUPINFO startup;
ZeroMemory(&startup,sizeof(startup));
PROCESS_INFORMATION pInfo;
ZeroMemory(&pInfo,sizeof(pInfo));
startup.cb=sizeof(startup);
startup.dwFlags=STARTF_USESTDHANDLES;
startup.hStdInput=NULL;
CreateProcess(NULL,ovpncheck1.GetBuffer(ovpncheck1.GetLength() + 1), NULL,NULL,TRUE,CREATE_NEW_CONSOLE,NULL,NULL,&startup,&pInfo); // PROCESS_INFORMATION
WaitForSingleObject(pInfo.hProcess,INFINITE);
MessageBox("Click YES to Configure EncryptaKey VPN 2","EncryptaKey VPN",MB_YESNO|MB_ICONQUESTION);
how to open the messagebox only afetr executing the exe completely
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Create a Hint (That can be a simple file or an registry end) at the
end of the execution of the batch file or the exe (if src is available).
CreateProcess(NULL,ovpncheck1.GetBuffer(ovpncheck1.GetLength() + 1), NULL,NULL,TRUE,CREATE_NEW_CONSOLE,NULL,NULL,&startup,&pInfo); // PROCESS_INFORMATION
WaitForSingleObject(pInfo.hProcess,INFINITE);
//check for the hint here
//if (completed) call ur message
//this is the raw way of doing it.
MessageBox("Click YES to Configure EncryptaKey VPN 2","EncryptaKey VPN",MB_YESNO|MB_ICONQUESTION);
|
|
|
|
|
i dont know how to confirm that the process is completed since the process is to install a package
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: i am calling a exe file from my program which in turn calling an batch. after executing this exe compltely only, i have to open a message box. but this is posting while the batch fle is opened.
It sounds like the problem is the other exe is not waiting on the batch file? So if your program is waiting on the exe (which is not waiting on the batch file), your program is also not waiting on the batch file? Can you confirm this (e.g., run calc.exe and see if your program waits for it)?
deeps_cute wrote: startup.hStdInput=NULL;
Since you've already called ZeroMemory() , this statement is pointless.
deeps_cute wrote: CreateProcess(NULL,ovpncheck1.GetBuffer(ovpncheck1.GetLength() + 1)...
Why are you calling GetBuffer() ? It is not necessary.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
PROCESS_INFORMATION prcInfo;
STARTUPINFO startupInfo;
memset(&prcInfo, 0, sizeof(PROCESS_INFORMATION) );
memset(&startupInfo, 0, sizeof(STARTUPINFO ) );
startupInfo.cb = sizeof (STARTUPINFO );
//DEBUG_ONLY_THIS_PROCESS
BOOL blnStatus = CreateProcess("e:\\temp\\samp.bat", NULL, //CreateProcess("c:\\winnt\\system32\\calc.exe", NULL,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&startupInfo,
&prcInfo);
if (blnStatus )
{
STILL_ACTIVE
DWORD dwExitCode=0;
BOOL blnExit = GetExitCodeProcess(prcInfo.hProcess, &dwExitCode);
WaitForSingleObject(prcInfo.hProcess, INFINITE);
blnExit = GetExitCodeProcess(prcInfo.hProcess, &dwExitCode);
dwExitCode=0;
AfxMessageBox("Hello Fin",MB_OK);
CloseHandle(prcInfo.hProcess);
//This is the code that i had tested working fine for me.
// i tested in both the case in which the first one i called
//the executable file directly, in the second time i called
//using a batch file. The next statement of WaitForSingleObject is watiting actuall to end its process.
|
|
|
|
|
I working with print.
I want print preview multipage.
Please help me.
|
|
|
|
|
I really dont understand what is the second argument to the AfxBeginThread function.Suppose I have a variable that holds a string and the value to that variable is assigned in the global thread calling function.I have to display that string in an edit box.Now should I inevitably create a structure that has this variable as a member?If I create one what will be my second argument to the AfxBeginThread function.If I dont what will be my second argument.I hope you get my question
|
|
|
|
|
Typically, I create a class and pass the address of the class to the thread proc.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
See here[^] if helpful for you
|
|
|
|
|
Hi i created a application of contact record. The program builds fine but when i run the application i get this following error.
Project CM.exe raised exception class EAccessViolation with message 'Access violation at address 40006A2F in module 'rt160.bpl'. Read of address 00000018'.Process stopped. Use Step or Run to continue.
The application is workin fine over console mode. So same thing when implemented over windows is giving me the above error.
Code Guard was enabled, so i disabled the code guard, its function option, resource function.But still the same error....
Any one got any idea about this exception error.
Thanks in advance....
sspecialist
|
|
|
|
|
Software_Specialist wrote: Read of address 00000018
You are dereferencing a null pointer somewhere.
|
|
|
|
|
Hi,
I have subclassed a window I am working on, and want to access the controls on that window so that I can access the messages that are being passed to and from them, how do you do this? I can get everything that happens on the window, mousemove, window moving, paint etc but I want to work with the controls...?
Any ideas or pointers would be great.
Do I have to subclass them as well, surely they are in some kind of array/linked list structure that I should be able to iterate over?
Many thanks, Ron
|
|
|
|
|
It depends how much control you want over these controls. I think you got three options:
1) If you just want to get/set text or like, you can get their Windows object and make limited calls.
2) If you want to call all their methods for each control, you can declare a control variable for it.
3) If you want to modify/enhance/add behavious, you need to subclass them.
Best,
Jun
|
|
|
|
|
if u want to handle the messages passed to the controls, I think u will have to subclass them, I couldn't figure out there r some ways else could work out. , for the messages passed from controls, u need subclass the controls parent window which u have already done.
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|