|
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.
|
|
|
|
|
What I'm using: VS2005, MFC, and FreeImage 3.93 and the C++ wrapper class provided by the FreeImage author...
I've been playing around with this most of the weekend.
What I'm Doing: I have a CWnd in which I'm trying to show a slide show of images (contained in a folder on the hard drive). The list of files that can be displayed is contained in a CStringArray called m_saFileNames . The slide show is controlled by a couple of timer threads, one to allows the current image to be displayed for a certain length of time, and another that keeps the next image from being displayed for a certain length of time. These threads are firing their messages correctly.
I've allocated a pointer for the image object (fitWinImage* m_pLastImage ) in the CWnd's constructor. Here's the function that's called that displays the image.
void CSaverWnd::FadeOn()
{
TRACE("CSaverWnd::FadeOn()\n");
if (m_pLastImage)
{
CString sFileName = m_saFileNames.GetAt(m_nNextImage);
m_pLastImage->clear();
m_pLastImage->load(sFileName);
if (m_pLastImage->isValid())
{
CPaintDC dc(this);
ScaleImg(m_pLastImage);
int nImgWidth = m_pLastImage->getWidth();
int nImgHeight = m_pLastImage->getHeight();
int imgX = (int)((m_rect.Width() - nImgWidth) * 0.5);
int imgY = (int)((m_rect.Height() - nImgHeight) * 0.5);
m_rectLastImage.SetRect(imgX, imgY, imgX+nImgWidth, imgY+nImgHeight);
m_pLastImage->draw(dc.GetSafeHdc(), m_rectLastImage);
}
}
}
The problem: It shows the first image, but won't show any of the rest. I've verified that images are being loaded (the image size and name change each time this function is called), but the draw function doesn't seem to be doing anything beyond the first image.
Any help?
-- modified at 19:00 Sunday 8th April, 2007
Solved, but it wouldn't mean anything to anyone but me.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Are the dimensions in m_rectLastImage valid after the first image is displayed?
Never mind, I wasn't looking at the code carefully enough.
/ravi
|
|
|
|
|
is void CSaverWnd::FadeOn() being called by WM_PAINT corresponding function? if not, CPaintDC dc(this); the dc get in this way will not have a valid clipping filed in screen, means using that dc couldn't paint as u wished.
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
William.Wang wrote: CSaverWnd::FadeOn() being called by WM_PAINT corresponding function?
Nope, it's called by the OnFadeOn message handler, which is triggered when the FadeOff thread sends the appropriate message back to the window.
I'm writing a screen saver for myself because a) I can't find anything already written that I want to try, b) I don't really trust programs I get off the net anymore, and c) I've never written a screen saver before. The saver fades pictures and/or quotes on/off the screen.
I may even write an article about it when I'm done.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
hi i am new to this language.....could u please suggest me how to create two applications using GUI in VC++????
it should display in the same screen...
-- modified at 16:04 Sunday 8th April, 2007
deepthi bhattachar
|
|
|
|
|
deepthi bhattachar wrote: could u please suggest me how to create two applications using GUI in VC++????
That's a pretty open ended question that can't be answered in a few paragraphs. If you're very new to MFC, I suggest you take a look at this[^] set of tutorials.
/ravi
|
|
|
|
|