Quote:
Originally posted by sde
i want this app to catch the exceptions it throws out when it can't find the dll , or the dll successfully registers .. but i'm too n00b to know where to start.
|
Code:
#include <stdio.h>
# include <windows.h>
#include <unistd.h>
int main()
{
int ret=-5;
if(!access("C:\\Program Files\\program\\file.dll", F_OK))
ret=system("regsvr32 \"C:\\Program Files\\program\\file.dll\"");
switch(ret)
{
case -5:
printf("Dll file does not exist\n");
return -1;
case 0:
printf("Successful return\n");
return 0;
default:
printf("system call returned with errno: %s\n, WEXITSTATUS(ret));
return ret;
}
}
Quote:
if it can't put find the dll, i'd like to allow the user to define the path to the file.
|
Dont know if there is any way to get a dialogue with the user without some interaction from the lower level runtime machine in .NET, else just make it a dos like app, asking on stdout and reading from stdin..