Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have an vb6.0 application and need to call it from c#. Process.start works fine for this but is very slow for each call. Is it possible to load vb6.0 exe when c# application is loaded at first time and execute when necessary in order to avoid that delay.
Actually data communications between application is not the issue. Just need to call a vb6 exe (GUI) file from c# application. Even a simple vb6 form (exe), when calling from Visual studio (c# win application) takes minimum 4 seconds to load the form using proccess.start()

What I have tried:

MyvbApplication.StartInfo.FileName = "MEDICURE.exe";
MyVbapplicatkion.StartInfo.Arguments = "PatientRegistration";
MyVbApplication.StartInfo.CreateNoWindow = true;
MyVbApplication.Start();
Posted
Updated 12-Mar-19 1:36am
v2

1 solution

No, because you need to pass arguments to the app, and they are only read when the app feels like it - normally when it powers up.

I'd suggest that the simplest solution would be to change the VB6 app to support interprocess communications Interprocess Communications - Windows applications | Microsoft Docs[^] and see if you can get a socket or similar running between them.
 
Share this answer
 
Comments
skumarop 12-Mar-19 7:27am    
Actually data communications between application is not the issue. Just need to call a vb6 exe (GUI) file from c# application. Even a simple vb6 form (exe), when calling from Visual studio (c# win application) takes 4 seconds to load the form using proccess.start
OriginalGriff 12-Mar-19 7:35am    
That's why you need to change it to using communications: Starting an app will always be slow (how slow depends on the size of the app and what it does when it starts up).
The only way to get rid of the delay is to not restart the app each time you need it, and that means communicating with the app instead of opening it each time you need it.
skumarop 12-Mar-19 7:55am    
That is what exactly i need. Thanks.
Could you provide any example of interprocess communication for reference.
OriginalGriff 12-Mar-19 8:01am    
Follow the link I gave in the answer - you need to modify both your VB6 (which I don't have a compiler for anymore since it's been dead for over 15 years, so I can't give you code) and your C# code to get them talking.
skumarop 12-Mar-19 8:11am    
Thanks a lot.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900