Click here to Skip to main content
15,906,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: code out of synch with debugger? Pin
PJ Arends6-May-05 5:41
professionalPJ Arends6-May-05 5:41 
GeneralRe: code out of synch with debugger? Pin
bryce10-May-05 19:41
bryce10-May-05 19:41 
GeneralRe: code out of synch with debugger? Pin
PJ Arends11-May-05 9:41
professionalPJ Arends11-May-05 9:41 
GeneralRe: code out of synch with debugger? Pin
rbid5-Sep-05 1:43
rbid5-Sep-05 1:43 
Questionhow will i use unistd.h in VC++ Pin
Tuscon5-May-05 15:50
Tuscon5-May-05 15:50 
AnswerRe: how will i use unistd.h in VC++ Pin
Mike Dimmick5-May-05 17:08
Mike Dimmick5-May-05 17:08 
AnswerRe: how will i use unistd.h in VC++ Pin
ThatsAlok5-May-05 20:39
ThatsAlok5-May-05 20:39 
GeneralEmbed Exectuable Pin
zx2c45-May-05 15:05
zx2c45-May-05 15:05 
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 <windows.h><br />
#include <tchar.h><br />
#include <shellapi.h><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: Embed Exectuable Pin
David Crow6-May-05 4:12
David Crow6-May-05 4:12 
GeneralRe: Embed Exectuable Pin
zx2c46-May-05 14:55
zx2c46-May-05 14:55 
GeneralConvert a CStringArray member to char[49] Pin
Member 6674685-May-05 14:19
Member 6674685-May-05 14:19 
GeneralRe: Convert a CStringArray member to char[49] Pin
Arsalan Malik5-May-05 18:21
Arsalan Malik5-May-05 18:21 
GeneralPlease help in getting Unicode Filenames into a file Pin
stvprg5-May-05 11:52
stvprg5-May-05 11:52 
GeneralSaving printer options Pin
crowbarcberg5-May-05 11:09
crowbarcberg5-May-05 11:09 
GeneralRe: Saving printer options Pin
PJ Arends5-May-05 12:25
professionalPJ Arends5-May-05 12:25 
GeneralRe: Saving printer options Pin
crowbarcberg5-May-05 17:27
crowbarcberg5-May-05 17:27 
GeneralRe: Saving printer options Pin
Ryan Binns5-May-05 18:09
Ryan Binns5-May-05 18:09 
GeneralRe: Saving printer options Pin
crowbarcberg6-May-05 2:44
crowbarcberg6-May-05 2:44 
GeneralRe: Saving printer options Pin
PJ Arends6-May-05 5:47
professionalPJ Arends6-May-05 5:47 
GeneralRe: Saving printer options Pin
PJ Arends6-May-05 6:45
professionalPJ Arends6-May-05 6:45 
GeneralRe: Saving printer options Pin
crowbarcberg6-May-05 9:14
crowbarcberg6-May-05 9:14 
GeneralRe: Saving printer options Pin
PJ Arends6-May-05 10:59
professionalPJ Arends6-May-05 10:59 
GeneralRe: Saving printer options Pin
crowbarcberg6-May-05 11:15
crowbarcberg6-May-05 11:15 
GeneralRe: Saving printer options Pin
PJ Arends6-May-05 13:46
professionalPJ Arends6-May-05 13:46 
GeneralRe: Saving printer options Pin
crowbarcberg6-May-05 15:31
crowbarcberg6-May-05 15:31 

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.