Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > The Academy > Tilted Knowledge and How-To


 
 
LinkBack Thread Tools
Old 09-02-2003, 09:10 AM   #1 (permalink)
Riiiiight........
 
C++ / Visual Basic question

So i have a executable written in C++, and i wish to call this executable in Visual Basic, and be able to read results from running the C++ program.

The C program outputs its results in a text file when it's done running.

So my question is, how do I check, from Visual Basic for Applications, that the C program is done running?

thanks.
dimbulb is offline  
Old 09-02-2003, 10:07 AM   #2 (permalink)
Everything's better with bacon
 
SaltPork's Avatar
 
Location: In your local grocer's freezer.
You have to use ShellandWait I think from advapi32.dll.
__________________
It was like that when I got here....I swear.
SaltPork is offline  
Old 09-02-2003, 04:36 PM   #3 (permalink)
Banned
 
Location: Greater Vancouver
I would use Shell, get the process ID, and use OpenProcess with the SYNCHRONIZE flag set.

Then, with the handle obtained from OpenProcess, use WaitForSingleObject
Flippy is offline  
Old 09-02-2003, 08:21 PM   #4 (permalink)
Insane
 
cowlick's Avatar
 
Location: Seattle
So am I out of line in suggesting you simply throw a COM interface on the C++ program and load it from VB to get a rich programatic exchange?
__________________
"It's a long story," says I, and let him up.
cowlick is offline  
Old 09-10-2003, 08:51 PM   #5 (permalink)
Crazy
 
Location: Salt Lake City
Quote:
Originally posted by cowlick
So am I out of line in suggesting you simply throw a COM interface on the C++ program and load it from VB to get a rich programatic exchange?
Not at all, though some might argue the word "simply" is a bit misleading...
Syncronizing the processes like ^^^ they said up there is probably easiest.
__________________
---<>---^^---<>---^^---<>---
---^^---<>---^^---<>---^^---
---<>---^^---<>---^^---><---
GreasyP is offline  
Old 09-12-2003, 09:37 AM   #6 (permalink)
Insane
 
cowlick's Avatar
 
Location: Seattle
Crud. I find VB one of the most annoying languages ever. What a lax grammar they build that language on.
I'd much rather C, C++, C#, Java, Lisp, JScript, Fortran...
__________________
"It's a long story," says I, and let him up.
cowlick is offline  
 

Tags
basic, question, visual

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 07:58 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76