Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problems calling vb6 queued component in vb.net

16 views
Skip to first unread message

Jeff Bishop

unread,
Oct 6, 2005, 11:58:22 AM10/6/05
to
Hello Everyone,

I am having problems getting a component that was written in VB6 to work
inside of vb.net. It is a queued component. Can someone send me some
sample code that would work in this instance? Here are some questions:

1. Should GetObject still work inside of vb.net? If so, what should the
variable be declared as as far as a new vb.net datatype goes?

2. Do you have to make any changes in application configuration or include
any references/Imports to get this queued component to work?

Any help is sincerely appreciated.

Jeff


Frank Boyne

unread,
Oct 6, 2005, 6:37:18 PM10/6/05
to
"Jeff Bishop" <jef...@email.arizona.edu> wrote in message
news:eBELI7oy...@TK2MSFTNGP15.phx.gbl...

> 1. Should GetObject still work inside of vb.net? If so, what should the
> variable be declared as as far as a new vb.net datatype goes?

GetObject should still work in VB.NET. The function returns an object so
you can do something like

Dim o as Object
o = GetObject (...)

The downside to this approach is that you are late-binding so you get no
help from the compiler. That's okay in some circumstances (e.g., you are
writing code that applies to lots of different kinds of object so o has to
be pretty generic).

> 2. Do you have to make any changes in application configuration or
> include any references/Imports to get this queued component to work?

I don't have a queued component to experiment with but I think your best
approach is to add to your VB.NET project a COM reference for your queued
component. That way you can use early-binding and get all the compiler
help. You can still use GetObject if you want to.

For example, this code sample is from the article Using COM+ Services in
.NET
http://msdn.microsoft.com/library/en-us/dndotnet/html/comservnet.asp

Sub Main()
Dim objTest As COMPlusJumpStart.COMPlusServices
Dim strMoniker

strMoniker = _
"queue:/new:COMPlusJumpStart.COMPlusServices"
objTest = GetObject(strMoniker)
objTest.QueueTest()
End Sub

0 new messages