|
Try ShellExecute
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
CreateProcess, WinExec, ShellExecute or ShellExecuteEx spring to mind. All documented in the MSDN
|
|
|
|
|
Nice to see you on the VC++ forum, PJN!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Admittedly I know less about threads then I thought I did about an hour ago. I had thought that threads allow for a process to be completed at the same time code execution is continuing past the creation of the thread. Is this a correct way to look at them (threads) and if so, is there a way to hold the program until the completion of the last created thread?
---------------------------------------------
Be good! But if you can't be good, at least be good at it and try not to get any on ya!
-mjf
|
|
|
|
|
Collect the handles that each createthreadex_ call returns to you in an array. Then call WaitForMultipleObjects on the the array in you exit handler. You can then guarantee that all your child theads have completed before your process thread.
Ryan.
Computers allow you to make more mistakes than any other invention, with the possible exception of handguns and tequila.
|
|
|
|
|
Don't forget to pass TRUE as the WaitAll (3rd) parameter.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
do these 2 functions (spaw* and _exec) work under windows (not dos)?
thx
includeh10
|
|
|
|
|
they'll work under both .
-c
"[it was..] one of those evenings when you feel that not only will there definitely be a revolution, but that the Association of Manufacturers will foot the bill."
-- Umberto Eco, Foucault's Pendulum
|
|
|
|
|
I have a directory and i want read the file without i know the name of file.
How i can start?
|
|
|
|
|
Have a look at FindFirstFile and friends.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
This function searches a directory for a file whose name matches the specified file name. FindFirstFile examines subdirectory names as well as file names.
I don't know the name of the file.
|
|
|
|
|
Look deeper into the docs The function supports wildcards, take advantage of them.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Use CFileFind class may be esaier
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
This solution are not good. Other solition?
|
|
|
|
|
It says that cout is an undecalred identifier when i #include <iostream>
thanks
|
|
|
|
|
It is std::cout , although many samples omit the prefix for brevity.
You can stick to the simpler cout including
using namespace std; right after the #include s, though this is not, for a variety of reasons, a good policy to follow in general.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi all!
I'm searching for a free (legal, of course) Visual C++ CD, I mean, the Introductory or Student version or something similar.
Where can I find it ?
Can I download it from some webstite ?
I need the 6.0 release (or later).
Please help!
|
|
|
|
|
|
Thank you!
I've found the same Introductory version on another book too:
Learn Visual C++ N:-Dow
|
|
|
|
|
Hi
I want to create a dynamic link library in Visual C++ for use in Visual Basic.
From VB i pass a String to the dll, so far so good, but now i want to return another String to the VB-program. My problem is now the memory access error, that occurs in the running VB programm.
What types in the c++dll can i return to VB, that expect a String??
thanx for your replies
|
|
|
|
|
A BSTR , I think. CComBSTR could be useful to do this.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I though about creating a Edit window in my app that when called
at runtime would catch all OutputDebugStrings that my program was
making.
After some nosing about on MSDN about catching OutPutDebugStrings i
wrote a thread function as below and called it from a menu option. The
idea was to eventually create a small window that would be updated with
any OutPutDebugStrings that were caught.
<br />
UINT catchDebugString(LPVOID param)<br />
{<br />
TCHAR myChar[1024];<br />
DWORD dwProcessId = GetCurrentProcessId();<br />
HANDLE hHandle = OpenProcess( PROCESS_ALL_ACCESS, false, dwProcessId );<br />
<br />
if ( DebugActiveProcess( dwProcessId ) == 0 )<br />
return 0;<br />
<br />
DEBUG_EVENT de;<br />
<br />
while ( WaitForDebugEvent( &de, INFINITE ) )<br />
{ <br />
if ( de.dwDebugEventCode == OUTPUT_DEBUG_STRING_EVENT )<br />
{<br />
OUTPUT_DEBUG_STRING_INFO deStr = de.u.DebugString; <br />
<br />
ReadProcessMemory(hHandle, deStr.lpDebugStringData, myChar, 1024, NULL);<br />
}<br />
<br />
if ( EXIT_PROCESS_DEBUG_EVENT == de.dwDebugEventCode )<br />
break;<br />
<br />
ContinueDebugEvent( de.dwProcessId, de.dwThreadId, DBG_CONTINUE );<br />
} <br />
<br />
return 1;<br />
}<br />
All was well until i found out i cant call DebugActiveProcess( dwProcessId )
with my own process id , there by making it so i cant catch my own OutputDebugStrings.
I just wondered if anyone out there had any ideas of how i could overcome this
problem or if there is another way to catch OutputDebugStrings??
cheers
AdrianCooper me;
while(CKitchen::beerInFridge()) {
me.watchTV();
me.consumeBeer(myKitchen.getBeerCan());
}
|
|
|
|
|
DebugView do that and lot more
http://www.sysinternals.com/ntw2k/freeware/debugview.shtml
U have to change ur process privilege to debug mode first if u still wanna do it
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
hey there papa... yes i am aware of debug output viewer applications but want to do this programatically..
AdrianCooper me;
while(CKitchen::beerInFridge()) {
me.watchTV();
me.consumeBeer(myKitchen.getBeerCan());
}
|
|
|
|