Solved

VB6 out of process server failing remotely over DCOM

Posted on 2004-03-22
8
1,888 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
ID: 10651978
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
ID: 10656088
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
ID: 10657166
The error itself is still saying, the Development Environment.  Are you trying to run it through the VB IDE on the remote machine?
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:AlanPalan
ID: 10657705
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
ID: 10677555
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
ID: 10678035
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
ID: 10862033
PAQed, with points refunded (500)

ee_ai_construct
Community Support Moderator
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

828 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