excute code

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2008
Posts: 8
Reputation: solaf_111 is an unknown quantity at this point 
Solved Threads: 0
solaf_111 solaf_111 is offline Offline
Newbie Poster

excute code

 
0
  #1
Jul 4th, 2008
hello
i programing the code && design the interfaces
then , connect the programing with db "store the results in db"
then connect the db with interface and appeare the results on edit boxes in the interface
now , we want excute the programing code when click specific button .so, we use this function :
ShellExecute(this->m_hWnd,"open","proto1.exe","","", SW_SHOW );
when we run the interface and click the button excute the programing code"proto1.exe"
but the result false . the results diffrent about the results that appere when excute the file separetly on console also the data base some time doesn't update .so, the results itrated
also , the same copy from proto1 that deal with db and interface when take it in other place provide the same false results . althogh , ather copy of ptoto1 that dosn't deal with db and interface work very good
note , in proto1 code read from 2 files and these files important to programing the code and the results depod on them
in interface , the user do prowse and select 2 files . these file appear in edit boxes then stored in 2 other static files"in each chose for user change the content of files" that the proto1 read from them

i hope knowing why the results appearing false and db does not update
Last edited by solaf_111; Jul 4th, 2008 at 12:54 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,625
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1496
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: excute code

 
0
  #2
Jul 4th, 2008
>>when we run the interface and click the button excute the programing code"proto1.exe"
but the result false

Do you mean ShellExecute() return 0? My guess is that you need to add the full path to the proto1.exe program. Example:
ShellExecute(this->m_hWnd,"open","c:\\mydir\\proto1.exe","","", SW_SHOW );
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 8
Reputation: solaf_111 is an unknown quantity at this point 
Solved Threads: 0
solaf_111 solaf_111 is offline Offline
Newbie Poster

Re: excute code

 
0
  #3
Jul 4th, 2008
yes, i do full path & put it in the same folder
both the same problem
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,625
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1496
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: excute code

 
0
  #4
Jul 4th, 2008
I'm sorry but I don't know how to help you. What compiler are you using? Are you using MFC or some other GUI ? What database are you using? How is proto1.exe accessing the database (ODBC or something else)? After running proto1.exe have you check the results in the db from command prompt or some other methodl outside your program?

Can't help you much without seeing code so that we can try the same thing to duplicate your problem.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 979
Reputation: mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice 
Solved Threads: 209
mitrmkar mitrmkar is offline Offline
Posting Shark

Re: excute code

 
0
  #5
Jul 4th, 2008
Originally Posted by solaf_111 View Post
yes, i do full path & put it in the same folder
both the same problem
Could it be that the current working directory (the lpDirectory argument) is not what it should be at the time you call ShellExecute(), i.e. proto1 does not find the files?
Note that you should specify NULL for lpDirectory in order to use the calling program's working directory (now you are using a zero-length string).

http://msdn.microsoft.com/en-us/libr...53(VS.85).aspx
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC