|
Is Visual C++ 6 compatible with Vista?
|
|
|
|
|
Daniel Kanev wrote: Is Visual C++ 6 compatible with Vista?
Yes.
"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
|
|
|
|
|
try, you'll see...
|
|
|
|
|
Yes, even though Vista will say otherwise, VC6 works fine.
|
|
|
|
|
Hello!!
I m having a problem with waiting for a single object. My app freezes when the wait-function kicks in.
This happens inside a dlg... maybe that is the reason why it freezes??? (because I want to keep track of the update steps -> reading values, downloading CAB-file and installing)
Here s my code:
if (CreateProcess(lpAppPath, // wceload.exe
strCommandLine, // \somepath\test.CAB /delete 1
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&startupInfo,
&processInformation
)
)
{
WaitForSingleObject(processInformation.hProcess, INFINITE);//here is where the program freezes
CloseHandle(processInformation.hProcess);
CloseHandle(processInformation.hThread);
}
Please can anybody help me!!!
-erik
-- modified at 11:24 Friday 6th July, 2007
|
|
|
|
|
it waits for the program started thru CreateProcess() ends...
did you ensure that it actually terminated ?
|
|
|
|
|
What i want to do, is install the CAB-file. The cabfile gets installed, but the waitforsingleobject does not understand that the install is finished. Maybe that is because wceload has not terminated yet? if so, is there a way to end wceload on install completion?
|
|
|
|
|
erikbe wrote: WaitForSingleObject(processInformation.hProcess, INFINITE);//here is where the program freezes
Notice the second argument to WaitForSingleObject() . It sounds as though your program is doing exactly what you told it to...waiting infinitely.
"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
|
|
|
|
|
Yes, my program does wait infinitely
I think The WaitForSingleObject()-function either waits for the dWord(in this case INFINITE), or it treminates when the process sends it an event. Not quite sure how it works. Though in just about all code examples I found online, this dWord is used.
|
|
|
|
|
I believe WaitForSingleObject() will wait until what you're waiting on is signaled or returns.
I use WaitForSingleObject() when I want to wait for either a thread or a process to terminate, before doing what I want to do, or for an event to get signaled. As such, what you are doing will probably wait for the process to terminate. If you want to wait for an event within that process, you will have to do something more complicated.
|
|
|
|
|
Problem solved:
if (CreateProcess( lpAppPath,
strCommandLine,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
NULL,
&processInformation
)
)
{
DWORD dw = MsgWaitForMultipleObjects(1, &pi.hProcess, FALSE, INFINITE, QS_POSTMESSAGE|QS_SENDMESSAGE );
}
else
{
AfxMessageBox(L"The process could not be started...");
}
MsgWaitForMultipleObjects(...)
As the documentation says:
Use caution when calling the wait functions and code that directly or indirectly creates windows. If a thread creates any windows, it must process messages. Message broadcasts are sent to all windows in the system. A thread that uses a wait function with no time-out interval may cause the system to become deadlocked. For example, the Dynamic Data Exchange (DDE) protocol and the COM function CoInitialize both indirectly create windows that can cause a deadlock. Therefore, if you have a thread that creates windows, use MsgWaitForMultipleObjects or MsgWaitForMultipleObjectsEx , rather than WaitForSingleObject .
|
|
|
|
|
On my OS regional setting is Chinese(PRC).
I hav a MFC dialog. One of the control is of ControlType "CEdit". This control is restricted to take numeric inputs (ES_NUMBER) only and that too of 2 digits (using SetLimitText(2)) only.
While running the application, when I enter a single digit it automatically gets twice. For instance if I enter 5 it gets converted to 55 and so on... So in that case I cannot enter 2 digits as max limit of the control is set to 2.
Plz help...
Thanks in advance...
Regards
SG div>
|
|
|
|
|
Do you have an EN_CHANGE handler?
"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 want to write a program and I need to see that is a certain program running or not , how can I do that ?
thanks
|
|
|
|
|
If the program is service, you can find with IsServiceRunning API.
If it is Window/Dialog Exe, you can do it with FindWindowEx API. Read how to use FindWindowEx API.
|
|
|
|
|
|
Be careful when using FindWindowEx() . It has the potential to cause a deadlock situation.
"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 think its good advise about FindWindow.;)
|
|
|
|
|
When i close a dialog bar using close button on dialogbar which messages get generated as i wanna resize other windows and their child controls .
Please help urgent...
do i have to override RecalcLayout function of main frame.
Thanks,
Sandip.
|
|
|
|
|
SandipG wrote: When i close a dialog bar using close button on dialogbar which messages get generated
WM_SYSCOMMAND?
This episode brought to you by the number 5
|
|
|
|
|
Hi,
I'm coding a treeview which resembles with the one in Windows Explorer.
Initially root item is Desktop and it's IShellFolder interface can be easily
retrived using SHGetDesktopFolder() function.
Can any one tell me how to get IShellFolder interface to any folder? e.g. "C:\"
Regards,
Abhijeet
---
Never look back...
|
|
|
|
|
|
This class must contain a function which return the position when it was made a change of bytes. For example if in char I have 0 0 0 1 0, the function must to return 4. If I have 0 0 0 0 0 0 1 1 1 1, the function must to return 6. Bytes are loaded from a file.txt. I want a solution, if it possible in next 2 days.
Thanks,
nickalai
|
|
|
|
|
nickalai17 wrote: I want a solution, if it possible in next 2 days.
are you asking us to do your homework ?
that's not gonna happen.
|
|
|
|
|
Your homework is due in 2 days ? Better get started, instead of trying to find someone to do it for you online. If you get stuck, you can ask us specific questions, of course.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|