Running Object Table from VB 
Author Message
 Running Object Table from VB

I would like to use the ROT  RegisterActiveObject, RevokeActiveObject api
calls to give my object the ability to be located via the vb
Getobject(,"project.classname") support.

I have looked at the ROTHook project via the "Give your classes GetObject
Support" from the Periodicals 1997 section of msdn.  But the project code
looks incomplete to me or there is just to much hidden in the TLB file.

All I really need is a simple example where reference counting isn't
cooridinated.

Any examples or references would be greatly appreciated
thanks much :+}
John



Mon, 19 Apr 2004 03:11:25 GMT  
 Running Object Table from VB
The MSDN article is unfortunately little more than a teaser. It only shows
how to use the code, not how it was written. I'd be happy to send you the
bits from the article (with a couple of minor updates) but you're running
spam-free, or you can get an enhanced version in my book
(http://www.PowerVB.com). The enhanced version overcomes a limitation
inherent in the initial implementation. -Matt


Quote:
> I would like to use the ROT  RegisterActiveObject, RevokeActiveObject api
> calls to give my object the ability to be located via the vb
> Getobject(,"project.classname") support.

> I have looked at the ROTHook project via the "Give your classes GetObject
> Support" from the Periodicals 1997 section of msdn.  But the project code
> looks incomplete to me or there is just to much hidden in the TLB file.

> All I really need is a simple example where reference counting isn't
> cooridinated.

> Any examples or references would be greatly appreciated
> thanks much :+}
> John



Mon, 19 Apr 2004 03:11:18 GMT  
 Running Object Table from VB
I believe the final challenge to useing these api Calls is in  being able to
get the IUnKnown Interface pointer, which is the first parameter of the
RegisterActiveObject call.

??? How can I retrieve a IUnKnown Interface pointer for a created/
instanciated object?

Thanks John


Quote:
> I would like to use the ROT  RegisterActiveObject, RevokeActiveObject api
> calls to give my object the ability to be located via the vb
> Getobject(,"project.classname") support.

> I have looked at the ROTHook project via the "Give your classes GetObject
> Support" from the Periodicals 1997 section of msdn.  But the project code
> looks incomplete to me or there is just to much hidden in the TLB file.

> All I really need is a simple example where reference counting isn't
> cooridinated.

> Any examples or references would be greatly appreciated
> thanks much :+}
> John



Mon, 19 Apr 2004 05:01:39 GMT  
 Running Object Table from VB
Kudo's to Matthew Curland.  Your ROTHook implementation has made it possible
to create a VB application using multiple threads which share a global
common data area.  Your customer (ie I bought the book) support was great.

The original problem was to work arround the VB limitation of having a
single MODAL form for the application.  By running multiple threads each
thread can have a single MODAL form.  By using the ROTHook abilities I
create a single instanciation of a global common "Class" which all the
threads can access via the syntax :       Set  GlobalRef =
GetObject(,"MyApplication.GlobalClass")

thanks Again.
John Fors



Tue, 20 Apr 2004 00:33:44 GMT  
 Running Object Table from VB
This will work fine as long as you only allow one instance of the
application to launch. However, if you launch a second instance, then your
GetObject call in the second process will attach to the global object from
the first process. There are two workarounds to this problem offered in the
book. The first is to use a 'custom class object' (page 138), which uses
CoRegisterClassObject to give you a process-level global object that can be
retrieved from any thread or component without using the ROT (the DynamicMDI
sample uses this technique as well). The second technique uses the ROT, but
decorates the moniker you put in so it is specific to the current process.
This is discussed on page 209. -Matt


Quote:
> Kudo's to Matthew Curland.  Your ROTHook implementation has made it
possible
> to create a VB application using multiple threads which share a global
> common data area.  Your customer (ie I bought the book) support was great.

> The original problem was to work arround the VB limitation of having a
> single MODAL form for the application.  By running multiple threads each
> thread can have a single MODAL form.  By using the ROTHook abilities I
> create a single instanciation of a global common "Class" which all the
> threads can access via the syntax :       Set  GlobalRef =
> GetObject(,"MyApplication.GlobalClass")

> thanks Again.
> John Fors



Tue, 20 Apr 2004 03:37:14 GMT  
 Running Object Table from VB
dim punk as IUnknown
Dim oYourObject As clsYourVBClass

Set punk = oYourObject
but this is no obligatory code... all VB object support IUnknown (except
script classes and classes that support the dispinterface only)

--
Egbert Nierop

Session management for webfarms:
http://www.nieropwebconsult.nl/asp_session_manager.htm


Quote:
> I believe the final challenge to useing these api Calls is in  being able
to
> get the IUnKnown Interface pointer, which is the first parameter of the
> RegisterActiveObject call.

> ??? How can I retrieve a IUnKnown Interface pointer for a created/
> instanciated object?

> Thanks John



> > I would like to use the ROT  RegisterActiveObject, RevokeActiveObject
api
> > calls to give my object the ability to be located via the vb
> > Getobject(,"project.classname") support.

> > I have looked at the ROTHook project via the "Give your classes
GetObject
> > Support" from the Periodicals 1997 section of msdn.  But the project
code
> > looks incomplete to me or there is just to much hidden in the TLB file.

> > All I really need is a simple example where reference counting isn't
> > cooridinated.

> > Any examples or references would be greatly appreciated
> > thanks much :+}
> > John



Mon, 19 Apr 2004 15:02:32 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Running Object Table from VB

2. running object table

3. Running Object Table

4. Running Object Table (ROT) still in vogue?

5. Registering a class with the Running Object Table (ROT)

6. Running Object Table (ROT)

7. Trouble running report off a table that was just created using VB code

8. Using VB to run an Access 7.0 Make table into Access 2

9. Accessing and OLE Table object with VB

10. Problem with VB table object

11. Accessing and OLE Table object with VB

12. Table object index propety (VB 3)

 

 
Powered by phpBB® Forum Software