shellexecute Hi
My code goes like this.Compiling it gives no errors. On linking I get the warning
"No module definition file specefied: using defaults"
I cannot give absolute path since I am using in autorun and I wouldnt know the drive letter in user's PC.
#include<string.h>
#include<stdio.h>
#include<windows.h>
#include<shellapi.h>
#include<dir.h>
#include<error.h>
main()
{
int retval;
char buffer[MAXPATH];
char *buffer1="SetUp1.htm";
getcwd(buffer, MAXPATH);
strncat(buffer, buffer1 , 12);
retval=ShellExecute(NULL,"open","explorer.exe",buffer,NULL,SW_SHOWMAXIMIZED );
if (retval==(ERROR_FILE_NOT_FOUND))
{printf("Please download Internet Explorer \n");
printf("If you have IE installed on your machine directly click on SetUp1.htm \n from the CD ROM ");}
return 0;
}
Now when I use start.exe on the CD in autorun file ,using windows 2000 everything is fine. SetUp1.htm opens in a full window in IE.
The same thing run on Windows 98 guves the following error. When I close the error box, it works fine. How do I get rid of this error. Any ideas?
Thanks
START caused a general protection fault
in module START.EXE at 0001:0000352e.
Registers:
EAX=000000b4 CS=4fa7 EIP=0000352e EFLGS=00000206
EBX=122f0d18 SS=1267 ESP=00002252 EBP=80eb2262
ECX=00000014 DS=1267 ESI=00000d12 FS=1227
EDX=005000b4 ES=1267 EDI=00000d1e GS=0000
Bytes at CS:EIP:
c4 5e f4 26 8b 07 3b 46 06 75 69 c4 5e f4 26 8b
Stack dump:
0d120d1e 13e20000 125f1267 36c21267 36282287 1267125f 4fa74cc1 0d120d1e 4fa7016f 00d81267 0ce80d12 4fa754c4 0ce80d12 55052294 00000000 0d120000 |