vb6 to vb.net upgrade question

G

Guest

Hi I am upgrading some vb6 code to vb.net and I am having difficulty
correcting a casting error while working with a COM object.

In vb6 the code is:
Dim oNewED As EmbeddedDirective
Set oNewED = oMsgServer.EmbeddedDirectives.New
In vb.net the code is:
Dim oNewED As EmbeddedDirective
oNewED = oMsgServer.EmbeddedDirectives

The casting error occurs in " oNewED = oMsgServer.EmbeddedDirectives".
EmbeddedDirectives returns a object that will not cast to the
EmbeddedDirective class in .net. However in vb6 it seems to be cast
successfully. A difference between the two is the ".New" I am not sure what
this means, it is not in the object model. I would appreciate any assistance
that you could give.

Thanks,

Eric
 
C

Cor Ligthert [MVP]

Eric,

Did you know that for vblanguage questions is a special newsgroup.

Microsoft.public.dotnet.languages.vb

I assume that the .New is a method that returns a new object however it is
hard to see.
Just removing that won't help you, because than the statements are complete
different.

You should therefore know what oMsgServer is, I assume a DLL.

However, I think it is better to ask this question in the language vb
newsgroup too, I don't see this direct without to know what oMsgServer is.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top