Using a .NET assembly in a VB6 application

H

Henke

Hi!

Is it possible to use a .NET assembly in a VB6 application? We have an old
VB application to which we'd like to add a new module, no communication is
needed to the old app. Is it possible to develop it using VB.NET and then
use/call it in the VB6 application.

Thnaks in advance!
/Henke
 
H

Henke

That looks nice, calling methods and returng values from a .NET class looks
like it would work.
I'm not good at COM+ so sorry for asking:
Can my COM+ objects have a user interface?

/Henke
 
C

CJ Taylor

I gotta question about this, and it may sound incredibly dumb but I don't
understand how the interop works. Or at least confused.

Given that its managed code that simply exposes a com interface, would it be
correct in saying that if you built an Active X control it would require the
CLR?

Or can you build an ActiveX Control with .NET?
 
A

Armin Zingler

CJ Taylor said:
I gotta question about this, and it may sound incredibly dumb but I
don't understand how the interop works. Or at least confused.

Given that its managed code that simply exposes a com interface,
would it be correct in saying that if you built an Active X control
it would require the CLR?

yes, it would, but...
Or can you build an ActiveX Control with .NET?

....no, you can't. At least there is no "built-in" way. I'm not sure but I
think a link has already been posted that could take you to a "work-around".
I didn't follow it, so everybody else can say more about it.
 
A

Armin Zingler

Henke said:
That looks nice, calling methods and returng values from a .NET class
looks like it would work.
I'm not good at COM+ so sorry for asking:
Can my COM+ objects have a user interface?

See my reply to CJ. Or short: I'm almost sure that they can't. You might
pass a window handle to the COMponent and use it to paint on it, but that's
all I can say.
 
C

CJ Taylor

Fair enough, I appreicate the reply. I had somene ask me abuot this and I
didn't know how to give the answer since I have yet to develop and ActiveX
application since leaving VB6.

My question regarding the CLR was not to sound dumb, but I was reading some
articles on MSDN that was talking about bringing the managed classes into a
single type library for the activex control, which made me think that maybe
it creates its own interop between all of them, I don't know, never played
with it.

And regarding the ActiveX control in .NET, I had seen a few posts about it,
read some articles but was unsure on how it worked, which is why I posted.
I greatly appreciate your insight on this though.

Thanks,
CJ
 
H

Henke

How should the component be used in VB.
I add a reference, and then tries to add it through Components->Browse. But
when I add the dll-file it says not an ActiveX component. What am I missing
here?

Thanks!
/Henke
 
A

Armin Zingler

Henke said:
How should the component be used in VB.
I add a reference, and then tries to add it through
Components->Browse. But when I add the dll-file it says not an
ActiveX component. What am I missing here?

After regasm.exe, the component must be available in Project -> References.
 

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