Solved

VB6 out of process server failing remotely over DCOM

Posted on 2004-03-22
8
1,858 Views
Last Modified: 2013-11-25
I have built an out of process COM Server in VB6. I can create an instance of an object from the server ok remotely using DCOM. However when I try to call a method I get the message

"The Visual Basic Development Environment can't provide multiple instances of a single use
class.  Consult the documentation for restrictions on debugging single-use objects"

The remote class in question IS multiuse AND it works fine if I run the same component locally on the same PC as the client. Why does the behaviour change over DCOM. The server component is registered on an NT Server. The client PC is windows 2000.

please help!
0
Comment
Question by:AlanPalan
  • 3
  • 3
8 Comments
 
LVL 15

Expert Comment

by:SRigney
Comment Utility
I think the problem is only because you are running through the IDE.  If you were to compile and run that version it would probably work fine.

When you run through the IDE then VB handles everything through it's .exe and then passes the events on to the operating system.  When you run a compiled .exe then the events go straight to the operating system.  It is this VB IDE layer that can't handle running the code.
0
 

Author Comment

by:AlanPalan
Comment Utility
Thanks for that. Unfortunately I had already tried it and got Error Loading DLL. The COM server used to work remotely perfectly over DCOM. I'm trying to establish what i've changed?? Like I mentioned if you register the server locally using server.exe /RegServer it works ok. But i need it shared on remote NT server. So I register the component on remote server, ensure that NT permissions are assigned appropriatey in DCOMCNFG, then locally use clireg32 server.vbr and setup the server address. I CAN create a remote object and i can see the server.exe out of process server running in the task manager on the remote server. But i get the same error message when i call a method.

"The Visual Basic Development Environment can't provide multiple instances of a single use class.  Consult the documentation for restrictions on debugging single-use objects"


thanks anyway for your input. any other advice gratefully accepted\rewarded!
0
 
LVL 15

Expert Comment

by:SRigney
Comment Utility
The error itself is still saying, the Development Environment.  Are you trying to run it through the VB IDE on the remote machine?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:AlanPalan
Comment Utility
Don't know if this helps but ...

The remote component is compiled to a .exe file and registered on the server using /RegServer.
The remote component NEVER runs in the IDE.

The client IS running in the VB6 IDE (although I have also complied the client and ran outside the IDE as mentioned, in this case I get a cannot load DLL error message).

The code is as follows.

Global oCon As dbcon.conDBase

  Set oCon = New dbcon.conDBase
  oCon.StartMonitoringMe objICB


The server is 'dbcon', conDBase is defined as a class within the 'dbcon' server. The first ' Set oCon = New dbcon.conDBase' works ok. The dbcon.exe runs on the server and I guess the dbcon.conDBase is created. Atleast it in not set to 'Nothing' and the line executes ok. When the StartMonitoringMe method is called this is when the error message appears.


One complication is the client application is an ActiveX document? I don't know if this makes any differrence. In-case the registry on the server has gone 'Pear Shaped' I rebuilt the server component with a differrent name so fresh COM entries would be made and also modifed the client to use it. But still same problem. If I register the dbcon.exe on the same machine as the client it then all works ok as expected?

A few weeks ago it DID all work ok over DCOM and I can't identify any changes i've made that would alter this. I orginally changed the threading model of the server object to one thread per object as I thought this would be more reliable. Indeed it all worked fine. However before releasing the client s.w. I though't i'd change the server back to a thread pool (20) just to see if I could go back without having to rebuild and re-release all the client installations (incase I had to). Clearly this has not worked but nor can i get back to orinigal situation even when i rebuild and register the whole lot??
0
 

Author Comment

by:AlanPalan
Comment Utility
The situation is now resolved:-

1) The component was built on a windows 2000 platform and loaded onto an NT platform. The server component was using a version of ADO that is not supported on the target platform. Thus the component registered OK on the target and objects could be created from it but methods calls would fail with no indication of the problem?? Clearly the /RegServer did not detect the ADO 2.7 reference in the server component that was not on the target platform.

2) Using clireg32 server.vbr -s sotw -t server.tlb -d rather than just clireg32 server.vbr and using the pop up form also seemed to improve situation on client.

Thanks for advice anyhow.

0
 
LVL 15

Expert Comment

by:SRigney
Comment Utility
If you post a request to delete this question and refund the points in the support room they will clean it up, so it will not remain open for you.
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
Comment Utility
PAQed, with points refunded (500)

ee_ai_construct
Community Support Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
wordsWithout 49 77
How Complex Is This Java Course ? 9 62
count11 challenge 6 47
VB6 Compile Compatibility Issue 4 25
This is an explanation of a simple data model to help parse a JSON feed
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now