RDweb: Cannot run legacy VB6 DLL more than once, at the same time
Asked Answered
I

1

6

We have a VB6 program installed on all of our clients' local C drives, along with an associated VB6 DLL program. The program was written back before my time in the 90s. It was not designed to run off a server or to allow multiple user access to the same EXE at the same time, hence why it's on everyone's C drive. However, all running sessions of it refer to the same database source on a separate SQL Server via ODBC. The database connectivity works fine.

Ok that's all history, with everyone working remotely (Covid19)!

Today however, our clients are all remoting into a virtual server via RD Web. We want them to avoid using our VPN. We have TWO virtual servers allocated to RDweb users: TS01 and TS02, and license for up to 64 users. Every user is automatically allocated one of the two servers. If two people log in at the same time, and one in TS01 and the other in TS02 - everything is fine! It's when a 3rd person logs in and is given either of the servers, and runs the program, is when it crashes, with this error:

enter image description here

The DLL is registered in both Computer\HKEY_CLASSES_ROOT\ and Computer\HKEY_LOCAL_MACHINE\SOFTWARE\, but not LOCAL_USER, which I think is necessary to make this be a multi-user program, within a server environment.

Converting the app is not an option, as we don't have VB6 compilers. Do we need to wrap the DLL in "something"?

Any ideas how to get this legacy program to run for multiple users, are appreciated.

Thanks

Inveigh answered 7/4, 2020 at 22:52 Comment(24)
The vote to close for the reason of "It's about general computing hardware and software" doesn't make sense to me. This is a programming question if it involves potentially modifying software or how that software is installed & configured.Oligochaete
With normal RDP (ie remote access to a desktop) it seems to act as if multiple users login independently. Is RDP Web the same? Are there specific functional changes to your program that you anticipate so that a multi-user scenario is possible?Oligochaete
"running legacy Windows programs via the web" not sure what you mean by that for a desktop application. In remote desktop, that shouldn't be a problem, and if there are issues, they can probably be fixed by tweaking some server config (In that case, that won't be a programming question anymore)Clydesdale
@Inveigh I think this question would be improved a lot if you could add more details and try to narrow down what information you are asking for. The configuration you are attempting seems vaguely described; and its also not clear what you've tried so far and what problems, if any, you have run into doing it. I think these kinds of details are going to get you better answers.Oligochaete
I may be off topic here. We use RemoteApp (not RDP Web) as a multi-user environment for our legacy VB6/Delphi7 application.Lithesome
@Lithesome IMO the topicality of the question depends on details which haven't been provided yet. Regardless, its an interesting technical area and I hope the OP does update the question or even posts an answer themselves if its already solved.Oligochaete
Even if the code was not designed to run in multi-instance, running multiple users via RDP can potentially let you bypass the limitation. BUT, if the LOGIC part is not designed to run with multiple instances (for example - code that requires locking) - you could end up with deadlocks!. so, as @UuDdLrLrSs said - more details are required to help you determine what are the "next steps".Nodule
@UuDdLrLrSs question re-worded. Not sure what more I can say to make this more clear. It's pretty simple question - how to run a windows 32bit program for multiple users from the single installation?Inveigh
I can't believe no one has a solution to a very simple problem. How do I allow multiple users to run the same EXE/DLL program within a server, at the same time. That is the same question isn't it?Inveigh
The fact that it works for the first person to get in, whoever they are, suggests to me that DLL registration is not the problem. What's the exact error message that they get?Oligochaete
At least as a test, if you can recompile, could you ditch the DLL and just compile it into the EXE? And/or can you reproduce this problem with a simple-as-possible test program?Oligochaete
I've written a popular VB6 app that some customers ran using Terminal Services and RDP. The app also talked to a shared database. If it worked for my app then it appears the problem is with the code/os, can you tell us the EventLog created when the app crashes? You might need a memory dump to uncover what the violation is or it might be better to try other RDP technology, for example a VPN Gateway if users have work PCs.Cumuliform
@JeremyThompson so you're saying any legacy Windows program should run multiple times, when using RDP?Inveigh
All I'm saying is that I wrote a VB6 app, customers used Terminal Services and I heard that it worked fine for a handful of users. Terminal Services has limits, may I suggest you change the connection string (using SSL) and get people run the VB6 app off their desktops pointing to a database on a server given its not working via RDP.Cumuliform
@JeremyThompson that's what I suggested, but my boss won't allow it. No VPN no Windows RDP. It has to be through RD WebInveigh
What is the exception they get ? Can you should the complete exception?Muscadine
100% agree with @TarunLalwani, what's the exact error?Oligochaete
I think the answers are learn.microsoft.com/en-us/windows/win32/sbscs/… and learn.microsoft.com/en-us/windows/win32/sbscs/…Inveigh
Would it be possible to set up RDP on each person's office workstation and have them remote into their work computer since it is already working on their computers?Semiskilled
I don't understand why you are focused on SXS as a solution to this. Whether the DLLs are registered or run SXS they should operate the same way (AFAIK). When they are registered the process still runs per-user.Oligochaete
@Semiskilled - not an optionInveigh
Can't you get a login script to copy an instance of the dll to a user specific area and ensure that this area is included as an environment variable (or is the start in directory for the exe?)Centrosome
Have you tracked down the exact moment or operation that results in the "Violation error"? I would use Process Monitor and see if you can pinpoint exactly what fails.Oligochaete
@Centrosome - hmm good idea. Will do if the answer below does not workInveigh
R
1

Try installing/copying VB program and related DLLs in each users folders (like home folder and shortcuts pointing to these HOME directories). If the program runs, it should update the database in the same way. Sometimes, most workarounds are simple. If they need different locked DLL working space then give them that (May have memory issues later)

Please see this https://mcmap.net/q/718991/-how-can-you-force-vb6-to-use-the-dlls-and-ocxs-from-the-app-directory

and

https://learn.microsoft.com/en-us/archive/msdn-magazine/2005/april/simplify-app-deployment-with-clickonce-and-registration-free-com

Some DLLs are not designed to be shared and this behaviour cannot be modified without reprogramming. There are in process and out process (threads ) DLLs. Or there can be many other issues. If its not working, its not allowed by design.

https://support.microsoft.com/en-au/help/911359/a-client-application-may-intermittently-receive-an-error-message-when

The shared DLLs that are used system wide do not have this limitation as many they are designed to be used by many applications. Please try and comment the behaviour.

Reticle answered 20/5, 2020 at 21:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.