Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Starting C app using .Net (API issues in C App)

  • 07-03-2008 12:38pm
    #1
    Registered Users, Registered Users 2 Posts: 214 ✭✭


    Hi All,

    I have a c# .Net application that is responsible for monitoring processes and starting them if they dont exist, see code snippet below:
    ProcessStartInfo psiStartDetails = new ProcessStartInfo();
    psiStartDetails.FileName = "C:\\MyApp.exe" //C Application
    Process proc = new Process();
    proc.StartInfo = psiStartDetails;
    proc.EnableRaisingEvents = true;
    proc.Exited += new EventHandler(StartProcAgain);
     
    proc.Start();
    

    The problem with this is the C application "myApp.exe" uses the FindFirstFile Api to check for the existence of a file, this does not return the expected result for if the file exists or not, but works fine if you double click the exe to start it.

    I tought it was down to permissions using .Net so i checked this out in VB 6 using the Shell command (Same issue).

    I then created a batch file to start the C app (this worked).

    Anyone have any ideas why the Process.Start & Shell commands seem to disable the FindFirstFile API?


Advertisement