Solved

Exception Details: System.ComponentModel.Win32Exception: Access is denied

Posted on 2007-04-04
7
6,341 Views
Last Modified: 2011-09-20
Hi people.

i have a rather annoying problem.  I am trying to execute an exe called PDF2SWF from a .net dll whch in turn is being called from a webpage.  This is the code i am using to call it

private string ConvertToSwf(string filename, string appPath)
{            
      string swfName = "";
      try
      {
            FileInfo file = new FileInfo(filename);
            string arguments = "\"" + file.FullName + "\"";
            swfName = Path.Combine(m_outputPath, Path.GetFileNameWithoutExtension(file.Name) + ".swf");
            arguments += " \"" + swfName + "\"";
               
            ProcessStartInfo procStart = new ProcessStartInfo(appPath, arguments);

            procStart.UseShellExecute = true;
            procStart.WindowStyle = ProcessWindowStyle.Hidden;
            Process console = new Process();
            console = new Process();

            console.StartInfo = procStart;
            console.Start();

            console.WaitForExit();
            console.Close();
            console.Dispose();
      }
      catch (Exception ex)
      {
            CLogger.AddLogEntry("Unable to load Thumb Generator : " + ex.ToString());
      }
      return swfName;
}

when i try to execute the exe directly from the DLL i et no errors it just doesnt work, however when i try to execute a batch file from the dll which in turn calls the exe i get this error:

System.ComponentModel.Win32Exception: The system cannot find the file specified

Note:

The strange thing is that at one point it did work, no problem, but i was having other problems so i had the change the code, but by fixing that i seemed to have broken this - the fix wasnt related t ths but it still refuses to work.

Any ideas?
0
Comment
Question by:apresto
  • 3
  • 2
7 Comments
 
LVL 9

Expert Comment

by:sun4sunday
ID: 18849494
have a look on this
http://support.microsoft.com/?id=329291

sun4sunday
0
 
LVL 23

Author Comment

by:apresto
ID: 18849755
Thanks for the reply,  But i dont understand, the link explains something different, im not trying to write to the event log - i googled and found that yesterday too
0
 
LVL 23

Author Comment

by:apresto
ID: 18850644
I fixed my problem i will ask for a delete
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 9

Expert Comment

by:sun4sunday
ID: 18855515
If you can share the solution, it will help for all and you can ask for a refund.
sun4sunday
0
 
LVL 23

Author Comment

by:apresto
ID: 18990694
i had unregistered my dll and not re registered - i believe this was the problem anyway
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 19229759
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question