.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 19th, 2003, 06:48 AM
koatto koatto is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 6 koatto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Starting a serverside Application

I try to start a process from an ASP.NET web form with the following code. It starts, i see it on the taskbar, but it doesnt
bring up any window.

Process p = new Process();
p.StartInfo.FileName="c:\\windows\\system32\\calc.exe";
p.StartInfo.CreateNoWindow=false;
p.StartInfo.UseShellExecute=false;
p.EnableRaisingEvents=true;
p.Start();

I think a possible solution is related to ASPNET user rights.

Any suggestion?

thanks

Reply With Quote
  #2  
Old November 23rd, 2003, 08:17 PM
neuralSea neuralSea is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 15 neuralSea User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: reply to starting a serverside program.

Is it showing up as running in your system as a process or application? If so, could be a script problem and you are looking for a solution too far from home.

Cheers,

neuralSea

If you have already found the solution - which I' m sure you have why not post it?

Reply With Quote
  #3  
Old November 24th, 2003, 03:57 AM
koatto koatto is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 6 koatto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Maybe a solution

Things are getting better since i start the process with API calls
instead of C# managed code.
If found on MSDN instruction to run an interactive client process,
it starts and brings up a window, but something very strange
still happens.
The window is without borders, something like transparent,
closing and maximizing button arent and the title bar is displayed
without any text.
But the windows is, i can get its handle, and is responding.
If i execute the same code outside asp.net, from a normal winform or console app everything works fine.

Strange but, for the moment, working.

Reply With Quote
  #4  
Old November 27th, 2003, 08:28 PM
neuralSea neuralSea is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 15 neuralSea User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
need more info

Hi Koatto,

Sounds like you have called the API correctly but haven't declared which of its properties you are using. I'd check the code for using that particular part of the abstraction layer. Does this sound like a valid area to explore?

I need more information.

Cheers,

neuralSea

Reply With Quote
  #5  
Old November 28th, 2003, 07:20 AM
koatto koatto is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 6 koatto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thats the code starting my process :

APIWrapper.PROCESS_INFORMATION ProcessInformation = new APIWrapper.PROCESS_INFORMATION();
APIWrapper.STARTUPINFO si = new APIWrapper.STARTUPINFO();
si.cb = Marshal.SizeOf(si);
si.lpReserved = null;
si.lpTitle = null;
si.lpDesktop = "WinSta0\\Default";
si.dwX = si.dwY = 0;
si.dwXSize = si.dwYSize = 20;
si.dwFlags = 1;
si.wShowWindow = 5;
si.lpReserved2 = 0;
si.cbReserved2 = 0;
APIWrapper.SECURITY_ATTRIBUTES sa = new APIWrapper.SECURITY_ATTRIBUTES();
int ret = APIWrapper.CreateProcess(null,"calc",ref sa, ref sa, false, new IntPtr(0), new IntPtr(), null, ref si, ref ProcessInformation);
Process proc = Process.GetProcessById(ProcessInformation.dwProcessId);

Reply With Quote
  #6  
Old December 8th, 2003, 04:29 PM
neuralSea neuralSea is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 15 neuralSea User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
message for Koatto

Hi Koatto, Apologies for the delay. Not being familiar with asp.net this is only a best guess but I think you are missing a couple of lines in initialising your properties. Since I'm not terribly au fait with the object APIWrapper.STARTUPINFO() I'd start by making sure that all things that need initialising are initialised. It probably works elsewhere because the API uses OS resources that are not immediately available to you using ASP.NET. If you have an object browser/dynamic help/etc in your IDE see if you can find the additional properties that need to be included in order for your program to work. Sorry for the simplistic answer but I've often found that therein lies the solution.

Hope this helps.

Good luck!

Cheers,

neuralSea

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Starting a serverside Application


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT