|
I don't know how ... I use Win7 for few days ...
|
|
|
|
|
First of all, is there a reason that you are using VC6? The environment was built for Win98 and was already slightly dated at the time of WinXP (didn't always function 100%). It might be wise to make the switch to Visual C++ 2010 (Express Edition for home use).
At any rate, if you're stuck with VC6 for a reason, installing the service packs can help increase stability, compatibility and security, so it's a good advice to install them.
To run the studio in elevated mode is a bit bothersome, but can be done by right-clicking the executable or shortcut to the executable and selecting "Run as Administrator".
There is no easy way to run it elevated when you double click a project file from explorer, unfortunately.
I know Visual Studio 2007 even came with the advice to run elevated on Vista/Win7 (along with the advice to upgrade to 2010 to avoid this and other issues), so that's why it's probably useful for VC6 too.
Another thing, try to avoid navigating to Libraries inside VC6 file browse dialogs. I've seen several pre-Win7 applications crash when trying to navigate to a Library (such as the Documents library which includes both the My Documents folder and the Public Documents folder).
Finally, you can try playing around with the Compatibility settings, such as setting its environment to WinXP (or Win98) and seeing if that helps any.
Hope any of this helps. Best advice in this text is: go to a newer version of Visual Studio if you can.
|
|
|
|
|
No, I haven't install any SP ... should I ?
|
|
|
|
|
Hello,
I developed a program to update my aplication. I created the MFC program myApp.exe and Console download.exe.
The download.exe when is running, this update the file "myApp.exe" and de myApp.exe running, this update the file "Download.exe too.
Than, I create the parameter /v to return version program into download.exe
"download.exe /v" return 1.00.
but now, I need the myApp.exe (MFC program) get that return. How to do this?
My idea is compare this version before to update the programa.
regards
André
|
|
|
|
|
Are you using CreateProcess() or ShellExecute() to start download.exe?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I didnt. I have been using
CreateProcess(
NULL
"cmd /C download.exe"
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ); // Pointer to PROCESS_INFORMATION structure.
|
|
|
|
|
You can look at the hProcess member of pi and call GetExitCodeProcess() .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
ok, perfect I have been using this, but I can't getting the return of download.exe /v. I still didn't find the member to do get this return... The member GetExitCodeProcess() return to me if the state of command, but I need the return of executable and not your state.
Example in line prompt, I need to get the '1.00'.
c:\download.exe /v
1.00
c:\
|
|
|
|
|
Is download.exe a console application? If so, its main() function will be returning an int (i.e., 1). That value is available from GetExitCodeProcess() .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Now, I understood.
I returned in the main the value of version (version * 1000). And I can to do the MFC to get it with GetExitCodeProcess() and converting the version (version / 1000) to double value.
I forgot that main return int value and I didnt understand that GetExitCodeProcess to get this.
Thanks to explain this.
André
|
|
|
|
|
int SynchronizedThread::RunCommand(CString Command, bool WaitForIt)
{
PROCESS_INFORMATION ProcInfo;
STARTUPINFO StartInfo;
DWORD exit_status;
memset(&StartInfo, 0, sizeof(StartInfo));
StartInfo.cb = sizeof(StartInfo);
if (CreateProcess(NULL, (LPSTR)(LPCTSTR)Command, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &StartInfo, &ProcInfo))
{
if (WaitForIt)
{
WaitForSingleObject(ProcInfo.hProcess, INFINITE);
GetExitCodeProcess(ProcInfo.hProcess, &exit_status);
CloseHandle(ProcInfo.hProcess);
CloseHandle(ProcInfo.hThread);
}
else
exit_status = EXIT_SUCCESS;
return exit_status;
}
return EXIT_FAILURE;
}
|
|
|
|
|
I dont need monitor the thread, I need to know how get the return of line command of executable.
Example... my program of MFC needs to get this '1.00'
prompt (line command)
c:\download.exe /v
1.00
c:\
Do you know to get it?
|
|
|
|
|
Of course you need to monitor the thread, the exit code isn't available until the program exits and how do you know when that happens unless you monitor the thread?
You don't have to sit and wait until it's done, you can periodically check the state of the thread (wait with a short timeout or other "test" conditions for the state of the handle) and then you'll know the exit code is valid.
Also, it's better to have the command line be "Download.exe /v" (whatever /v means to your program) than to have a .BAT file run the command. This way you'll be sure to get the exit code of the application.
|
|
|
|
|
Sorry, I forgot the console application, the main return an int;
Now, I understood the GetExitCodeProcess() getting the int main.
Thanks
André.
|
|
|
|
|
Minifilters get passed a PFLT_CALLBACK_DATA and a PCFLT_RELATED_OBJECTS when called by the system.
Does anyone know of a way to change, or add, parameters to the application being run?
==============================
Nothing to say.
|
|
|
|
|
_itoa can convert int value such as 15 to F, but the atoi function cannot convert it back. it simply treat any letter that is not numerical( '0' - '9' ) as wrong input value.
I have an edit control to display something hexadecimal, say a pointer, a handle,so I do the follow,
_itoa( i, szBuffer, 16 ) ;
SetDlgItemText( hDlg,szBuffer ) ;
when I want the value back, I need to convert it back to int representation. But I am stuck here.
Does someone know any function that fix my problem?
|
|
|
|
|
|
|
I keep getting this error from my program when I try to debug it.
Program: C:\Users\Jeffrey\Desktop\WinSTM\.\Debug\WinSTM.exe
File: f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\filelist.cpp Line:225
It is referring to this piece of code:
ENSURE(SUCCEEDED(hr));
Add(psi, strAppID);
#endif
Can anyone help tell me what this is referring to so that I can fix it?
solved here:Debug Assertion Error Visual Studio 2010[^]
modified on Thursday, August 25, 2011 3:47 PM
|
|
|
|
|
AndrewG1231 wrote: Can anyone help tell me what this is referring to so that I can fix it?
The ENSURE() macro expands to a macro named ENSURE_THROW() . That macro is the one that actually contains the assertion. You might look in afx.h around line 369 (I don't have VS2010) to see what condition is actually asserting.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I think Code-o-Mat is on to something in his response to your previous thread below.
Change this:
if (m_Bitmap != 0)
DeleteObject(m_Bitmap);
To this:
if (m_Bitmap != 0)
{
DeleteObject(m_Bitmap);
m_Bitmap = NULL;
}
Compile it, and see if the error occurs again.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Yes, I have made this change and the error persists.
|
|
|
|
|
Thanks. Too bad it didn't solve the main problem, but nevertheless it was probably not working correctly.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
The ENSURE and SUCCEEDED macros are quite commonly used to throw a debug assertion failure when some API call returns "false" or "failed" or whatever.
"hr" is the interesting variable being checked and is a common name for "handle for a resource".
If you found the "ENSURE" statement, the really interesting part is above it, where the value of "hr" was set to something the "ENSURE" statement is unhappy with. Look at that.
When you hit the assertion failure and enter the debugger, follow the call stack backwards (down in the listing) until you find something that's in your own code and double click on that, it will take you to your call that called the API that had the argument it was unhappy with. Follow that procedure over and over until you find the call that really messed up the argument.
Remember this process as it will help you over and over again as you run into problems in the future. There is no substitute for learning a good debugging procedure and how to use the debugging tools in your compiler.
|
|
|
|
|
Yes, the hr value is E_INVALIDARG....will this indicate a bad pointer value?
|
|
|
|