Click here to Skip to main content
15,915,086 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: tutorials on Visual C++ Pin
Ravi Bhavnani7-May-05 3:58
professionalRavi Bhavnani7-May-05 3:58 
Generalsending broadcast packets Pin
Mridang Agarwalla6-May-05 17:13
Mridang Agarwalla6-May-05 17:13 
GeneralRe: sending broadcast packets Pin
CodeBeetle8-May-05 9:44
CodeBeetle8-May-05 9:44 
GeneralRe: sending broadcast packets Pin
Mridang Agarwalla8-May-05 17:18
Mridang Agarwalla8-May-05 17:18 
GeneralCString Pin
locoone6-May-05 15:52
locoone6-May-05 15:52 
GeneralRe: CString Pin
simon wan6-May-05 15:59
simon wan6-May-05 15:59 
GeneralRe: CString Pin
ThatsAlok6-May-05 21:33
ThatsAlok6-May-05 21:33 
GeneralEmbeded Executable Resource Pin
zx2c46-May-05 15:15
zx2c46-May-05 15:15 
Any idea how to embed an exectuable inside another executable, and then from with in your program, call the embeded exectuable with out creating another process or wrting the embed exectuable to disk?

I have a C++ program (straight C++, not managed). It has some logic and then depending on a number of conditions, ShellExecute()s another exectble file (client.exe), which happens to be a .net file. Is there anyway that I can add this client.exe file as a resource of my C++ program, and then call the beginning of the code from within the C++ program, so I wouldn't have to extract the resource or create a new process

Please help

Thanks,
Jason A. Donenfeld

PS: This is what I have now:
<br />
#define WIN32_LEAN_AND_MEAN<br />
#include<br />
#include<br />
#include<br />
<br />
#define INSTANCEMESSAGE "ShowZIM"<br />
#define WINDOW_TITLE "ZX2C4InstantMessenger"<br />
#define MUTEX_STRING "Local\\ZX2C4IM"<br />
#define FILE "client.exe"<br />
<br />
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)<br />
{<br />
if(_tcscmp(lpCmdLine,"clone"))<br />
{<br />
CreateMutex(NULL,TRUE,MUTEX_STRING);<br />
if(GetLastError()==ERROR_ALREADY_EXISTS)<br />
{<br />
SendMessage(FindWindow(NULL, WINDOW_TITLE), RegisterWindowMessage(INSTANCEMESSAGE), NULL, NULL);<br />
return 0;<br />
}<br />
}<br />
ShellExecute(NULL,NULL,FILE,lpCmdLine,NULL,SW_SHOW);<br />
return 0;<br />
}<br />

GeneralRe: Embeded Executable Resource Pin
Gary R. Wheeler8-May-05 4:34
Gary R. Wheeler8-May-05 4:34 
GeneralRe: Embeded Executable Resource Pin
Gary R. Wheeler8-May-05 4:39
Gary R. Wheeler8-May-05 4:39 
GeneralCFileDialog customization Pin
Anonymous6-May-05 14:09
Anonymous6-May-05 14:09 
GeneralRe: CFileDialog customization Pin
Jaime Olivares6-May-05 15:23
Jaime Olivares6-May-05 15:23 
GeneralVC++ 6.0 Class Wizard parsing problem Pin
humots6-May-05 13:36
humots6-May-05 13:36 
GeneralRe: VC++ 6.0 Class Wizard parsing problem Pin
Gary R. Wheeler8-May-05 4:43
Gary R. Wheeler8-May-05 4:43 
Generalno scroll clock display Pin
knapak6-May-05 12:04
knapak6-May-05 12:04 
GeneralRe: no scroll clock display Pin
khan++6-May-05 19:45
khan++6-May-05 19:45 
GeneralRe: no scroll clock display Pin
Ravi Bhavnani7-May-05 4:02
professionalRavi Bhavnani7-May-05 4:02 
Question24 bit DIB has different values on PPC and Desktop PC? Pin
georgiek506-May-05 11:52
georgiek506-May-05 11:52 
AnswerRe: 24 bit DIB has different values on PPC and Desktop PC? Pin
Chris Losinger7-May-05 6:40
professionalChris Losinger7-May-05 6:40 
QuestionAre their any comment plugins for vs.net to help c++? Pin
FocusedWolf6-May-05 11:46
FocusedWolf6-May-05 11:46 
AnswerRe: Are their any comment plugins for vs.net to help c++? Pin
FocusedWolf6-May-05 12:02
FocusedWolf6-May-05 12:02 
GeneralRe: Are their any comment plugins for vs.net to help c++? Pin
Gary R. Wheeler8-May-05 4:49
Gary R. Wheeler8-May-05 4:49 
GeneralHeap error when init'ing AcDbDatabase Pin
Ista6-May-05 11:34
Ista6-May-05 11:34 
Questioncan u terminate the dos window? Pin
includeh106-May-05 11:20
includeh106-May-05 11:20 
AnswerRe: can u terminate the dos window? Pin
CodeBeetle8-May-05 9:50
CodeBeetle8-May-05 9:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.