|
-
Jan 29th, 2007, 01:55 PM
#1
Thread Starter
New Member
Executing a console Application (.EXE File) from a VB 6 DLL
Hello... I'm a complete newbie when it comes to VB 6 and i need to execute a Console Apoplication develped under Visual Studio Net using C#. I also need to wait for the execution to finish it and capture the return code of it in order to perform some other actions.
Thanks a lot in advance
-
Jan 29th, 2007, 02:02 PM
#2
Lively Member
Re: Executing a console Application (.EXE File) from a VB 6 DLL
Hello,
We would like to help you , but can you be a Little more precise ?
Thank you 
Best Regards,
Didier.
-
Jan 29th, 2007, 02:23 PM
#3
Thread Starter
New Member
Re: Executing a console Application (.EXE File) from a VB 6 DLL
Sure... I'm working in a CRM Platform named Pivotal. I wrotea couple of Console Applications in C# in Visual studio Net which are used to send formatted e-mails and print to disk crystal reports in several diferent formats, such as PDF, HTML, etc.
In order to execute those console applications, pivotal needs a DLL registered in the windows Register with a particular key, so I made a new DLL in C# that does that exactly. This DLL only has a method which receives two strings as imput args, the path & file name of the console application i need to execute, and another string that has all the input arguments that that console needs. Is a generic Console Louncher. However, pivotal doesn't recognizes .NET DLLs, so I'm forced to create a VB6 console Launcher in order to execute those apps.
I'll paste the code used in the C# console launcher, which only important things is that it has to wait until the end o the application execution before returning control to the OS.
Code:
using System;
using System.Diagnostics;
using System.ComponentModel;
namespace ConsoleLauncherLib
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class ConsoleLauncherLib
{
public ConsoleLauncherLib()
{
//
// TODO: Add constructor logic here
//
}
public static int execConsole(string ubicacion, string argumentos)
{
ProcessStartInfo _procesoInfo = new ProcessStartInfo(ubicacion,argumentos);
_procesoInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process _proceso = Process.Start(_procesoInfo);
_proceso.WaitForExit();
int x = _proceso.ExitCode;
return x;
}
}
}
Thanks a lot for any help you can give me . I'm still trying to figure how to create a sub function for this
-
Jan 30th, 2007, 08:20 AM
#4
Thread Starter
New Member
Re: Executing a console Application (.EXE File) from a VB 6 DLL
So... doesn't anyone has a solution for this? I'm really in a tight spot here
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|