|
you can try the following code to the a message function.
{
PROCESS_INFORMATION pi;
STARTUPINFO si;
memset(&si,0,sizeof(si));
si.cb=sizeof(si);
si.wShowWindow=SW_SHOW;
si.dwFlags=STARTF_USESHOWWINDOW;
BOOL fRet=CreateProcess(NULL,
"c:\\windows\\notepad.exe c:\\autoexec.bat",
//the notepad.exe can be repalced to other .exe NULL,
NULL,
FALSE,
NORMAL_PRIORITY_CLASS|CREATE_NEW_CONSOLE,
NULL,
NULL,
&si,
&pi);
if(!fRet)
{
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL );
AfxMessageBox( (LPCTSTR)lpMsgBuf);
LocalFree( lpMsgBuf );
}
else
{
AfxMessageBox("CreateProcess susceesfully");
m_hPro=pi.hProcess;
}
|
|
|
|
|
(i'm not sure) import your Original exe as a Resource in your projet.. then download it from your New Exe to disk.. and shellExectue it..(its not visible to the user).. i hope i get u right.. i've done this in VB long before. i'm not sure with VC..
Regards,
V
|
|
|
|
|
|
Trollslayer wrote:
Thanks, thats the kind of solution I was after.
and this example will help you in that :-
http://www.codeproject.com/cpp/UpdateResource.asp[^]
Trollslayer wrote:
The tigress is here
Runnnnnnnnnnnnnnnnnn........................ kidding hope you don't mind
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
-- modified at 7:33 Wednesday 31st August, 2005
|
|
|
|
|
|
ThatsAlok wrote:
The tigress is here
Runnnnnnnnnnnnnnnnnn........................
you wont run.. if u had actually seen the tigress' photo in her profile!!.. i'm gonna present her to your kid for his next b'day ..
LOL
V
|
|
|
|
|
Vivekuniq wrote:
...if u had actually seen the tigress' photo in her profile!!
very frightenning !!!! uhhh:->
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Vivekuniq wrote:
'm gonna present her to your kid for his next b'day ..
Kiddssssssssss..............whoes
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hey alok cool.. man.. i know you are Geniune bachelor.. i just said for fun.. K.. lets keep this way.. "lets give it as a gift to Tox's kid!!!".. i hope Tox is married!
V
|
|
|
|
|
Vivekuniq wrote:
i hope Tox is married!
arf, no yet
but still in love... lol. that's a good start isn't it ?
ps: little tox is only 23 !!!
but he has all his life and the one after to give so much love to the woman in his heart...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
but still in love... lol
Greatz...... You never told me , what she is doing
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote:
what she is doing
i'm not sure about the real english naming, but when i google for the translation for it, it says "midwife"...
actually, she studies to "help babies to get born"... if you understand what i mean ... !?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
as subject
thx
I love Programming
|
|
|
|
|
this is done automatically...
int i = 0x57;
ASSERT(i == 87);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
An integer is neither an hex or a decimal. It's an integer and that's it ! Now, it's representation (so you will print it on the screen, in a file, ...) can change from hew to decimal. But then, it's not converting an integer but converting a string.
|
|
|
|
|
hex, dec, oct are just ways to represent the same integer...
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
yes, the diffrent is the string's represent format, i know how to represent a integer to diffrent format string as
<br />
char *_itoa(<br />
int value,<br />
char *string,<br />
int radix <br />
);
but
int atoi( const char *string );
the function has only one param, no format param
must i write a function to do this?
I love Programming
|
|
|
|
|
an integer is an integer !!!!
it is stored as a serie of bits in memory, wether you stored an hexa value, an octal one, or a decimal one...
int i = 0x05;
<hr>
int i = \005;
<hr>
int i = 5;
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Take a look at the sprintf function instead. It will do what you are looking for (and even much more ).
Hexa:
sprintf(Buffer,"%x",Number);
Decimal:
sprintf(Buffer,"%d",Number);
|
|
|
|
|
An integer is an integer and it doesn't matter how you represent it. If you are trying to print it in different representations you may take a look to print flags[^].
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
xiaohe521 wrote:
int atoi( const char *string );
the function has only one param, no format param
must i write a function to do this?
I think you are trying to convert a hexadecimal number (which is a string) to an integer. Am I right?
|
|
|
|
|
Use the strtol() function to convert numeric strings in various bases into integers.
|
|
|
|
|
How do u convert a Number to an Integer..?
V
|
|
|
|
|
ah... there's now azt least one interresting post on that thread...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|