Solved

VB6 out of process server failing remotely over DCOM

Posted on 2004-03-22
8
1,867 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to split this in C++ 4 93
firstChar challenge 13 106
how to update exe applicatio from internet ? 6 66
Rubik's Cube Code for Effective Presentation 3 40
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

939 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

4 Experts available now in Live!

Get 1:1 Help Now