[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Running Object Table Visibility

Posted on 2008-10-10
5
Medium Priority
?
753 Views
Last Modified: 2013-11-10
I have a straightforward COM object (implemented in Delphi 6 if that makes a difference). This uses RegisterActiveObject() to register itself in the ROT, and all works fine for standard WIN32 apps. The first instance of the object needs to be created but after that GetActiveObject() works fine and a single instance of the object works for everybody.
Now I have someone who wants to use this from a C# application. He says that if the object is already out there then he can't use GetActiveObject() and that he can't see it in the ROT. OTOH if he creates the object in his own code then further instances via GetActiveObject() work OK (and now he can see it in the ROT). Anyone know whats going on here? And what do I have to do to make the initial (non-C# created) instance visible for him?
0
Comment
Question by:mikrobe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 22687142
As far as I'm aware RegisterActiveObject() does not enter the object in the reistry but only on the local object table. Therefore only the CLSID is available. Accordingly I'd expect the C# callerof GetActiveObject to use the CLSID. Is that the case?
0
 

Author Comment

by:mikrobe
ID: 22687871
Yes, he's using the CLSID to get hold of the object. Also to do the CoCreateInstance() that he has to use to create a new instance if he can't find one out there already. The create works so he seems to have the right CLSID, and once he's created his own then he can do the GetActiveObject() with no problems (and can see the object in the ROT from his part of the world). The problem we are trying to solve is when the first instance is created outside of C# in the 'normal' Windows world by (say) a Delphi app. This app can create the first instance and further executions of the Delphi app can use GetActiveObject(). But the C# app can't see it and has to create its own before it appears in the ROT as seen from there. It's almost as if we are looking at two separate versions of the ROT??
0
 
LVL 27

Expert Comment

by:BigRat
ID: 22701353
So, it seems that, since one can create an object with CoCreateInstance, we have a full registry entry.

BUT once a "universal" object has been created the GetActiveObject() returns nothing.

Next question - what exactly is being fed into GetActiveObject() under C#; The CLSID?
0
 

Accepted Solution

by:
mikrobe earned 0 total points
ID: 22701389
This is now at least partially cleared up. It turns out that although the object is not visible when he tests this in the C# environment, if he runs his compiled program in the real world outside then everything works as expected, so his (and my) code is basically OK. Why it's like this I don't know, but the people using his program are going to be real world as well, si it's not a blocking problem.
0
 
LVL 27

Assisted Solution

by:BigRat
BigRat earned 100 total points
ID: 22701436
Hmmm, interesting. I could just imagine having a second ROT for testing purposes, since C# code is dymanically interpreted it is easy to do such tricks.

Still, glad you found what was wrong. Ask for a point refund.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
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 …
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…
Starting up a Project
Suggested Courses

656 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