In .Net 2003 I can start a .Net executable, a Win32 executable and a Win16 executable (written with VB 3 in 16 bits) with the Start static methode of the Process Class.
In .Net 2005 when I try to start a Win16 executable I receive the error : The parameter is incorrect
Can somebody help me

How to start a win16 exe with Process.Start static methode
The Bairnsei
The code that is making the call to Process.Start() and everything else setting up parameters and what not (if present)... is the same code that worked fine under VS2003
Can we see the code in question that is being used to launch this app
whitenoise
Here is a smal Windows Form application :
A Form with a Button and a Textbox with multiline property set to true.
PROJECT1.EXE is a small application (VB3 - 16 bit)
This code run well in VS2003 and PROJECT1.EXE start with success.
The same code in VS2005 failled on Process.Start(path) and display the error in the textbox.
Why
public partial class Form1 : Form{
public Form1(){
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string path = @"C:\PROJECT1.EXE";
try
{
Process.Start(path);}
catch (Win32Exception w){
string s = "";s += w.Message +
"\r\n";s += w.ErrorCode.ToString() +
"\r\n";s += w.NativeErrorCode.ToString() +
"\r\n";s += w.StackTrace +
"\r\n";s += w.Source +
"\r\n";s += w.GetBaseException().Message;
this.textBox1.Text = s;}
}
Valerio
Ok! I found the solution.
When you said it works fine on your computer with a 16-bit app located in system32, I copy my 16-bit exe in system32 and try again. Wonderfull, it works.
I think it's because system32 is included in the path environment system variable.
Then I try to start the 16-bit exe in its original location with a StartInfo.WorkingDirectory property set to the original location. Wonderfull, it works too.
So the question is why did I need to set the WorkingDirectory for a 16-bit app and not for a 32-bit or .Net app and why did I need to do it with VS2005 and not with VS2003
Answer : Mistery of Microsoft.
Thanks for your help.
My company ILICOM informatique (in Belgium) is still looking for the best way to do something for your Student Loan Debt.
Best regards,
Michel.
deathy
I keep looking at that and it looks fine... I even tried loading a couple of 16-bit apps I found in my system32 directory with Process.Start() and it worked fine...
Nothing I have found on MSDN with regards to Process.Start() has said anything about issues with 16-bit apps, however one article on using the Shell() method from the VB side of things does say that it can sometimes have a problem with 16-bit apps and suggests using a small 32-bit wrapper to execute it.
Any chance of quickly banging out a 32-bit windows app whose sole job is executing your 16-bit app through a Shell() or System() call