By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,385 Members | 847 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,385 IT Pros & Developers. It's quick & easy.

dll problem: vb6 and vb.net writing smart tags

P: n/a
Hi,

In a nutshell, my question is: how do i make a dll that I compile from
vb.net code register and work like one compiled as an ActiveX dll in VB6?

The IDE of my copy of visual basic.net does not provide me with the
option to build a class library (dll)--instead I can use the command
line (though I don't know how to replicate the "Register for COM
Interop" option that is grayed-out in the IDE, which may be my problem).

I am trying to build smart tags (a dll that will be recognized by Office
products--in my case Word and Excel). I can get them working
successfully from VB6, but I really want to use .NET instead. From VB6,
I did nothing more than A) compile an activeX DLL, and B) Manually add
two neccessary entries in the Smart Tags key of the registry. At this
point Word automatically recognizes my dll and executes the code within
it as appropriate.

From VB.NET, I A) compile a dll from the command line, B) run "regasm
dllname.dll", and C) Manually add the two entries in the Smart Tags key
of the registry. However, Word does not recognize that my vb.net
smarttag dll even exists, much less the words within it.

So, what is the VB6 compiler doing when it compiles an activeX DLL (I
assume it's making certain registry entries?) and how do I replicate
that from the command line for vb.net?

Thanks very much for any knowledge you have!

-Casey
Nov 21 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
On 2004-11-30, C Williams <no****@thank.you> wrote:
Hi,

In a nutshell, my question is: how do i make a dll that I compile from
vb.net code register and work like one compiled as an ActiveX dll in VB6?

The IDE of my copy of visual basic.net does not provide me with the
option to build a class library (dll)--instead I can use the command
line (though I don't know how to replicate the "Register for COM
Interop" option that is grayed-out in the IDE, which may be my problem).

I am trying to build smart tags (a dll that will be recognized by Office
products--in my case Word and Excel). I can get them working
successfully from VB6, but I really want to use .NET instead. From VB6,
I did nothing more than A) compile an activeX DLL, and B) Manually add
two neccessary entries in the Smart Tags key of the registry. At this
point Word automatically recognizes my dll and executes the code within
it as appropriate.

From VB.NET, I A) compile a dll from the command line, B) run "regasm
dllname.dll", and C) Manually add the two entries in the Smart Tags key
of the registry. However, Word does not recognize that my vb.net
smarttag dll even exists, much less the words within it.

So, what is the VB6 compiler doing when it compiles an activeX DLL (I
assume it's making certain registry entries?) and how do I replicate
that from the command line for vb.net?

Thanks very much for any knowledge you have!

-Casey


I'm not an export on this - I've never needed to create a COM Callable
Wrapper (CCW), but I believe once you compile your assembly you'll want
too run tlbexport on it. This should generate a typelibary so that it
can be called from COM.

--
Tom Shelton [MVP]
Nov 21 '05 #2

P: n/a
On 2004-11-30, C Williams <no****@thank.you> wrote:
Hi,

In a nutshell, my question is: how do i make a dll that I compile from
vb.net code register and work like one compiled as an ActiveX dll in VB6?

The IDE of my copy of visual basic.net does not provide me with the
option to build a class library (dll)--instead I can use the command
line (though I don't know how to replicate the "Register for COM
Interop" option that is grayed-out in the IDE, which may be my problem).

I am trying to build smart tags (a dll that will be recognized by Office
products--in my case Word and Excel). I can get them working
successfully from VB6, but I really want to use .NET instead. From VB6,
I did nothing more than A) compile an activeX DLL, and B) Manually add
two neccessary entries in the Smart Tags key of the registry. At this
point Word automatically recognizes my dll and executes the code within
it as appropriate.

From VB.NET, I A) compile a dll from the command line, B) run "regasm
dllname.dll", and C) Manually add the two entries in the Smart Tags key
of the registry. However, Word does not recognize that my vb.net
smarttag dll even exists, much less the words within it.

So, what is the VB6 compiler doing when it compiles an activeX DLL (I
assume it's making certain registry entries?) and how do I replicate
that from the command line for vb.net?

Thanks very much for any knowledge you have!

-Casey


As a further note, there is information on this in the documentation...
Look for information on COM Callable Wrappers and tlbexport.

--
Tom Shelton [MVP]
Nov 21 '05 #3

P: n/a
You don't need to do this, check the 'Register for COM Interop' box in
Project Properties and it'll do it for you. You then need to regasm it
(rather than regsvr32) if you want it on another machine.
"Tom Shelton" wrote:
On 2004-11-30, C Williams <no****@thank.you> wrote:
Hi,

In a nutshell, my question is: how do i make a dll that I compile from
vb.net code register and work like one compiled as an ActiveX dll in VB6?

The IDE of my copy of visual basic.net does not provide me with the
option to build a class library (dll)--instead I can use the command
line (though I don't know how to replicate the "Register for COM
Interop" option that is grayed-out in the IDE, which may be my problem).

I am trying to build smart tags (a dll that will be recognized by Office
products--in my case Word and Excel). I can get them working
successfully from VB6, but I really want to use .NET instead. From VB6,
I did nothing more than A) compile an activeX DLL, and B) Manually add
two neccessary entries in the Smart Tags key of the registry. At this
point Word automatically recognizes my dll and executes the code within
it as appropriate.

From VB.NET, I A) compile a dll from the command line, B) run "regasm
dllname.dll", and C) Manually add the two entries in the Smart Tags key
of the registry. However, Word does not recognize that my vb.net
smarttag dll even exists, much less the words within it.

So, what is the VB6 compiler doing when it compiles an activeX DLL (I
assume it's making certain registry entries?) and how do I replicate
that from the command line for vb.net?

Thanks very much for any knowledge you have!

-Casey


I'm not an export on this - I've never needed to create a COM Callable
Wrapper (CCW), but I believe once you compile your assembly you'll want
too run tlbexport on it. This should generate a typelibary so that it
can be called from COM.

--
Tom Shelton [MVP]

Nov 21 '05 #4

P: n/a
On Tue, 30 Nov 2004 23:12:35 GMT, C Williams <no****@thank.you> wrote:

Hi,

In a nutshell, my question is: how do i make a dll that I compile from
vb.net code register and work like one compiled as an ActiveX dll in VB6?

The IDE of my copy of visual basic.net does not provide me with the
option to build a class library (dll)--instead I can use the command
line (though I don't know how to replicate the "Register for COM
Interop" option that is grayed-out in the IDE, which may be my problem).

I am trying to build smart tags (a dll that will be recognized by Office
products--in my case Word and Excel). I can get them working
successfully from VB6, but I really want to use .NET instead. From VB6,
I did nothing more than A) compile an activeX DLL, and B) Manually add
two neccessary entries in the Smart Tags key of the registry. At this
point Word automatically recognizes my dll and executes the code within
it as appropriate.

From VB.NET, I A) compile a dll from the command line, B) run "regasm
dllname.dll", and C) Manually add the two entries in the Smart Tags key
of the registry. However, Word does not recognize that my vb.net
smarttag dll even exists, much less the words within it.

So, what is the VB6 compiler doing when it compiles an activeX DLL (I
assume it's making certain registry entries?) and how do I replicate
that from the command line for vb.net?

Thanks very much for any knowledge you have!

If this is an Office Add-in you may want to take a look at the following MS KB article:

http://support.microsoft.com/default...b;en-us;302896
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 21 '05 #5

P: n/a


Actually the following article is probably a bit more applicable:

Building Smart Tags in Microsoft Visual Basic .NET
http://msdn.microsoft.com/library/de...dc_stvbnet.asp
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 21 '05 #6

P: n/a
In article <D8**********************************@microsoft.co m>, Bonj wrote:
You don't need to do this, check the 'Register for COM Interop' box in
Project Properties and it'll do it for you. You then need to regasm it
(rather than regsvr32) if you want it on another machine.


He can't check the register for com interop box though... He says it is
greyed out... I suspect that it is the VB.NET standard product - but I
don't have that to confirm. If so, then he'll need to do this stuff
manually from the command line...

--
Tom Shelton [MVP]
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 2 Build 2600
System Up Time: 39 Days, 19 Hours, 33 Minutes, 47 Seconds
Nov 21 '05 #7

P: n/a
Thanks, Tom. I might not be understanding it correctly, but the
documentation says:

Tlbexp.exe generates a type library but does not register it. This is in
contrast to the Assembly Registration tool (Regasm.exe), which both
generates and registers a type library. To generate and register a type
library with COM, use Regasm.exe.

Because I think I need to get my library registered, I tried adding the
/tlb flag to regasm, but again to no avail.
Tom Shelton wrote:
On 2004-11-30, C Williams <no****@thank.you> wrote:
Hi,

In a nutshell, my question is: how do i make a dll that I compile from
vb.net code register and work like one compiled as an ActiveX dll in VB6?

The IDE of my copy of visual basic.net does not provide me with the
option to build a class library (dll)--instead I can use the command
line (though I don't know how to replicate the "Register for COM
Interop" option that is grayed-out in the IDE, which may be my problem).

I am trying to build smart tags (a dll that will be recognized by Office
products--in my case Word and Excel). I can get them working
successfully from VB6, but I really want to use .NET instead. From VB6,
I did nothing more than A) compile an activeX DLL, and B) Manually add
two neccessary entries in the Smart Tags key of the registry. At this
point Word automatically recognizes my dll and executes the code within
it as appropriate.

From VB.NET, I A) compile a dll from the command line, B) run "regasm
dllname.dll", and C) Manually add the two entries in the Smart Tags key
of the registry. However, Word does not recognize that my vb.net
smarttag dll even exists, much less the words within it.

So, what is the VB6 compiler doing when it compiles an activeX DLL (I
assume it's making certain registry entries?) and how do I replicate
that from the command line for vb.net?

Thanks very much for any knowledge you have!

-Casey

As a further note, there is information on this in the documentation...
Look for information on COM Callable Wrappers and tlbexport.

Nov 21 '05 #8

P: n/a
I actually have read this article and found it quite useful. The only
problem with it is that it instructs the user to click "Register for COM
Interop" and then compile a class library. I can't do that, though, and
am trying to figure out how to do so from the command line.

Any help would be appreciated!

Paul Clement wrote:

Actually the following article is probably a bit more applicable:

Building Smart Tags in Microsoft Visual Basic .NET
http://msdn.microsoft.com/library/de...dc_stvbnet.asp
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)

Nov 21 '05 #9

P: n/a
Okay, I have discovered two solutions for those who are interested. Tom
was right--I just didn't take it far enough.

1)compile dll using vbc.exe and then run "regasm name.dll /tlb: name.tlb
/codebase "

The /codebase is important, even though I did not strong name my dll and
it gives a warning when regasm exectues. Not sure what's up with
that...but it works.

The other way is far simpler--change my version of Visual Basic so that
it allows the "register for com interop" option. Thank you Herfried Wagner!
http://dotnet.mvps.org/dotnet/faqs/?...raries&lang=en

C Williams wrote:
Hi,

In a nutshell, my question is: how do i make a dll that I compile from
vb.net code register and work like one compiled as an ActiveX dll in VB6?

The IDE of my copy of visual basic.net does not provide me with the
option to build a class library (dll)--instead I can use the command
line (though I don't know how to replicate the "Register for COM
Interop" option that is grayed-out in the IDE, which may be my problem).

I am trying to build smart tags (a dll that will be recognized by Office
products--in my case Word and Excel). I can get them working
successfully from VB6, but I really want to use .NET instead. From VB6,
I did nothing more than A) compile an activeX DLL, and B) Manually add
two neccessary entries in the Smart Tags key of the registry. At this
point Word automatically recognizes my dll and executes the code within
it as appropriate.

From VB.NET, I A) compile a dll from the command line, B) run "regasm
dllname.dll", and C) Manually add the two entries in the Smart Tags key
of the registry. However, Word does not recognize that my vb.net
smarttag dll even exists, much less the words within it.

So, what is the VB6 compiler doing when it compiles an activeX DLL (I
assume it's making certain registry entries?) and how do I replicate
that from the command line for vb.net?

Thanks very much for any knowledge you have!

-Casey

Nov 21 '05 #10

P: n/a
> I suspect that it is the VB.NET standard product

That's the most likely explanation.
- but I
don't have that to confirm. If so, then he'll need to do this stuff
manually from the command line...

--
Tom Shelton [MVP]
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 2 Build 2600
System Up Time: 39 Days, 19 Hours, 33 Minutes, 47 Seconds

Nov 21 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.