473,769 Members | 7,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

COM Calling DotNet

I am unclear about what all the requirements are to call a simple vb.net
application, installed in the GAC, from COM (such as writing vba in Word to
call the dotnet dll).

I believe I have installed the dll in the GAC. It is in there and has a
public token. I did not create a key-value pair. I believe it is strong
named, as it shows up in the GAC.

How do I browse the objects of it? I would like to call it late bound, but
the errors I get show that the properties or methods are not available.

I have put <ComClass()as an attribute at the beginning of the public
class.

In VS 2008, I have chosen Register to COM interop.

I have all the options in Wise Installbuilder showing that it installs the
assembly in the GAC.

I have made sure that the class has this code:
Public Sub New
MyBase.New
End Sub

Just how many guesses do we need to do to just call a dotnet object? Is
there an article that lists what is required, instead of just parts and
pieces.

Please help.
Nov 20 '08 #1
8 1989
Also, I found this article:

http://msdn.microsoft.com/en-us/libr...sz(vs.71).aspx

In which it states:
In addition, it is not necessary to install assemblies into the global
assembly cache to make them accessible to COM interop or unmanaged code.

I sure wish I could figure out how to deploy a dotnet application, with has
a dll with public functions, and have COM objects use that, and not have to
use the GAC. But I need the code to be late bound in the COM programs
because I will not be able to set references to the DLLs or even know where
they are installed. Please point me in the right direction!


"Derek Hart" <de********@yah oo.comwrote in message
news:Oi******** ******@TK2MSFTN GP03.phx.gbl...
>I am unclear about what all the requirements are to call a simple vb.net
application, installed in the GAC, from COM (such as writing vba in Word to
call the dotnet dll).

I believe I have installed the dll in the GAC. It is in there and has a
public token. I did not create a key-value pair. I believe it is strong
named, as it shows up in the GAC.

How do I browse the objects of it? I would like to call it late bound, but
the errors I get show that the properties or methods are not available.

I have put <ComClass()as an attribute at the beginning of the public
class.

In VS 2008, I have chosen Register to COM interop.

I have all the options in Wise Installbuilder showing that it installs the
assembly in the GAC.

I have made sure that the class has this code:
Public Sub New
MyBase.New
End Sub

Just how many guesses do we need to do to just call a dotnet object? Is
there an article that lists what is required, instead of just parts and
pieces.

Please help.

Nov 20 '08 #2
Hello Derek ,

All the steps that you describe ( make the assembly com visisble , create
a public sub new )
sounds how i create my .Net dll`s COM callable however i missed only one
thing you did not mention

Did you register the COM capable assembly with regasm.exe ?
My dll`s are callable with CreateObject from VBA ,VBS and even PHP , with
PHP however i discovered that the assembly needed to be deployed in the GAC
or the APACHE assembly directory
here is some copy paste code i created a long time ago for this group

http://groups.google.com/group/micro...996d74d250974e

As you see i create my own interface id`s , as this gives me the benefit of
compatibility through my rules
HTH

Michel Posseth
http://www.vbdotnetcoder.com


"Derek Hart" <de********@yah oo.comschreef in bericht
news:uy******** ******@TK2MSFTN GP06.phx.gbl...
Also, I found this article:

http://msdn.microsoft.com/en-us/libr...sz(vs.71).aspx

In which it states:
In addition, it is not necessary to install assemblies into the global
assembly cache to make them accessible to COM interop or unmanaged code.

I sure wish I could figure out how to deploy a dotnet application, with
has a dll with public functions, and have COM objects use that, and not
have to use the GAC. But I need the code to be late bound in the COM
programs because I will not be able to set references to the DLLs or even
know where they are installed. Please point me in the right direction!


"Derek Hart" <de********@yah oo.comwrote in message
news:Oi******** ******@TK2MSFTN GP03.phx.gbl...
>>I am unclear about what all the requirements are to call a simple vb.net
application , installed in the GAC, from COM (such as writing vba in Word
to call the dotnet dll).

I believe I have installed the dll in the GAC. It is in there and has a
public token. I did not create a key-value pair. I believe it is strong
named, as it shows up in the GAC.

How do I browse the objects of it? I would like to call it late bound,
but the errors I get show that the properties or methods are not
available.

I have put <ComClass()as an attribute at the beginning of the public
class.

In VS 2008, I have chosen Register to COM interop.

I have all the options in Wise Installbuilder showing that it installs
the assembly in the GAC.

I have made sure that the class has this code:
Public Sub New
MyBase.New
End Sub

Just how many guesses do we need to do to just call a dotnet object? Is
there an article that lists what is required, instead of just parts and
pieces.

Please help.


Nov 20 '08 #3
"I would like to call it late bound, but the errors I get show that the
properties or methods are not available"

That is, when doing what ? Calling CreateObject or CreateObject works and it
fails when you call a method ? Also what is the error you get ?

I've done this once by calling manuall regasm (that shows a warning if the
DLL is not in the GAC). It still worked for me

--
Patrice

"Derek Hart" <de********@yah oo.coma écrit dans le message de groupe de
discussion : uy************* *@TK2MSFTNGP06. phx.gbl...
Also, I found this article:

http://msdn.microsoft.com/en-us/libr...sz(vs.71).aspx

In which it states:
In addition, it is not necessary to install assemblies into the global
assembly cache to make them accessible to COM interop or unmanaged code.

I sure wish I could figure out how to deploy a dotnet application, with
has a dll with public functions, and have COM objects use that, and not
have to use the GAC. But I need the code to be late bound in the COM
programs because I will not be able to set references to the DLLs or even
know where they are installed. Please point me in the right direction!


"Derek Hart" <de********@yah oo.comwrote in message
news:Oi******** ******@TK2MSFTN GP03.phx.gbl...
>>I am unclear about what all the requirements are to call a simple vb.net
application , installed in the GAC, from COM (such as writing vba in Word
to call the dotnet dll).

I believe I have installed the dll in the GAC. It is in there and has a
public token. I did not create a key-value pair. I believe it is strong
named, as it shows up in the GAC.

How do I browse the objects of it? I would like to call it late bound,
but the errors I get show that the properties or methods are not
available.

I have put <ComClass()as an attribute at the beginning of the public
class.

In VS 2008, I have chosen Register to COM interop.

I have all the options in Wise Installbuilder showing that it installs
the assembly in the GAC.

I have made sure that the class has this code:
Public Sub New
MyBase.New
End Sub

Just how many guesses do we need to do to just call a dotnet object? Is
there an article that lists what is required, instead of just parts and
pieces.

Please help.

Nov 20 '08 #4
If I could get more specific, I would appreciate your thoughts. Please let
me know if my steps are wrong, or I am missing some, or if I don't need
some.

1) This is all I have done to strong name the vb.net dll. In the project
properties, under Signing, I have chosen Sign The Assembly and chosen New in
the combo box to make a new file. I simply named the file and gave it a
password. I did nothing in reference to the key value pair, as I do not need
this level of security. Is it required to make a key value pair, or is
simply naming this file enough? In my references, I see the name of my key
file. Should I set the build action to Embedded Resource, or is none the
right choice?

2) I don't want to install my DLL in the GAC. So please let me know if
that should be okay. Remember, I simply want to call the dll late bound from
vba, or other com programs.

3) I have made a public sub new in the main class I am calling with no
constructors.

4) My application compiles fine, as I made every dll "strong named",
using the rules stated above. No key value pairs were done. Just what I did
above.

5) I have the following at the top of my class:
<ComClass()Publ ic Class MyClass

6) I did not do any other code inside the class, using the GUIDs as you
showed in your explanation. I did not do ComVisible anywhere, just the
ComClass code.

7) I chose Register for Com Interop in the project properties, which is
probably why it works on my development machine.

8) I chose a similar option in Wise InstallBuilder when deploying, so it
should be doing regasm in the install.

9) My CreateObject on the deployed machine still gets ActiveX cannot
create object. It seems like I am going to have to go at this for a while.
Your feedback would be appreciated.

Thank You!

"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:u4******** ******@TK2MSFTN GP05.phx.gbl...
Hello Derek ,

All the steps that you describe ( make the assembly com visisble ,
create a public sub new )
sounds how i create my .Net dll`s COM callable however i missed only one
thing you did not mention

Did you register the COM capable assembly with regasm.exe ?
My dll`s are callable with CreateObject from VBA ,VBS and even PHP , with
PHP however i discovered that the assembly needed to be deployed in the
GAC or the APACHE assembly directory
here is some copy paste code i created a long time ago for this group

http://groups.google.com/group/micro...996d74d250974e

As you see i create my own interface id`s , as this gives me the benefit
of compatibility through my rules
HTH

Michel Posseth
http://www.vbdotnetcoder.com


"Derek Hart" <de********@yah oo.comschreef in bericht
news:uy******** ******@TK2MSFTN GP06.phx.gbl...
>Also, I found this article:

http://msdn.microsoft.com/en-us/libr...sz(vs.71).aspx

In which it states:
In addition, it is not necessary to install assemblies into the global
assembly cache to make them accessible to COM interop or unmanaged code.

I sure wish I could figure out how to deploy a dotnet application, with
has a dll with public functions, and have COM objects use that, and not
have to use the GAC. But I need the code to be late bound in the COM
programs because I will not be able to set references to the DLLs or even
know where they are installed. Please point me in the right direction!


"Derek Hart" <de********@yah oo.comwrote in message
news:Oi******* *******@TK2MSFT NGP03.phx.gbl.. .
>>>I am unclear about what all the requirements are to call a simple vb.net
applicatio n, installed in the GAC, from COM (such as writing vba in Word
to call the dotnet dll).

I believe I have installed the dll in the GAC. It is in there and has a
public token. I did not create a key-value pair. I believe it is strong
named, as it shows up in the GAC.

How do I browse the objects of it? I would like to call it late bound,
but the errors I get show that the properties or methods are not
available.

I have put <ComClass()as an attribute at the beginning of the public
class.

In VS 2008, I have chosen Register to COM interop.

I have all the options in Wise Installbuilder showing that it installs
the assembly in the GAC.

I have made sure that the class has this code:
Public Sub New
MyBase.New
End Sub

Just how many guesses do we need to do to just call a dotnet object? Is
there an article that lists what is required, instead of just parts and
pieces.

Please help.



Nov 20 '08 #5
See if this helps:
http://www.simple-talk.com/dotnet/vi...-com-assembly/

--
Phil Wilson
Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972
"Derek Hart" <de********@yah oo.comwrote in message
news:uy******** ******@TK2MSFTN GP06.phx.gbl...
Also, I found this article:

http://msdn.microsoft.com/en-us/libr...sz(vs.71).aspx

In which it states:
In addition, it is not necessary to install assemblies into the global
assembly cache to make them accessible to COM interop or unmanaged code.

I sure wish I could figure out how to deploy a dotnet application, with
has a dll with public functions, and have COM objects use that, and not
have to use the GAC. But I need the code to be late bound in the COM
programs because I will not be able to set references to the DLLs or even
know where they are installed. Please point me in the right direction!


"Derek Hart" <de********@yah oo.comwrote in message
news:Oi******** ******@TK2MSFTN GP03.phx.gbl...
>>I am unclear about what all the requirements are to call a simple vb.net
application , installed in the GAC, from COM (such as writing vba in Word
to call the dotnet dll).

I believe I have installed the dll in the GAC. It is in there and has a
public token. I did not create a key-value pair. I believe it is strong
named, as it shows up in the GAC.

How do I browse the objects of it? I would like to call it late bound,
but the errors I get show that the properties or methods are not
available.

I have put <ComClass()as an attribute at the beginning of the public
class.

In VS 2008, I have chosen Register to COM interop.

I have all the options in Wise Installbuilder showing that it installs
the assembly in the GAC.

I have made sure that the class has this code:
Public Sub New
MyBase.New
End Sub

Just how many guesses do we need to do to just call a dotnet object? Is
there an article that lists what is required, instead of just parts and
pieces.

Please help.


Nov 20 '08 #6
Hello Derek ,

About 1 and 2 , This is only necesary for the GAC i do not sign or strong
name my COM dll`s at all as i install them in the callers directory path ,
note that for a hosted runtime this must be the directory of the excution
host ( for PHP the apache assembly directory and for VBS the system32 dir )

The call places are , Callers instrallation directory , GAC and System32
so your dll must be in one of these locations

As the assembly behaves as expected on your development system ,(the VS IDE
is taking care of registering the COM assembly on the dev system )
this is where your focus should be .

I guess that Wise is not registering your .Net COM component the right way
, to confirm that this is the case do the following , open a command
window on a target system , go through the command prompt to the framework
directory ( normally this is "C:\Windows\Mic rosoft.Net\Fram eworkNumber\"

If you have the blinking cursor on that location , type regasm
C:\FullpathTo\Y ourComDllName.d ll and press enter you should get a
confirmation that it succeeded .

Now your assembly should work as expected , if it does ( i know that for
95% sure ) here is the solutions for your Wise project
on any system ( this may be your dev machine ) type now at the framework
command prompt :

regasm C:\FullpathTo\Y ourComDllName.d ll /regfile:myRegis trationFile.reg

The registration file that is now created , should be included in your Wise
setup project
http://www.wisesolutions.com/upload/wfwi.pdf
see page 144 ( adding registry keys )
If you have done this , it should work for every installation you make with
your deploy package
I hope to hear from you if you succeeded (or not :-( )

Regards,

Michel Posseth


"Derek Hart" <de********@yah oo.comschreef in bericht
news:u$******** ******@TK2MSFTN GP03.phx.gbl...
If I could get more specific, I would appreciate your thoughts. Please let
me know if my steps are wrong, or I am missing some, or if I don't need
some.

1) This is all I have done to strong name the vb.net dll. In the
project properties, under Signing, I have chosen Sign The Assembly and
chosen New in the combo box to make a new file. I simply named the file
and gave it a password. I did nothing in reference to the key value pair,
as I do not need this level of security. Is it required to make a key
value pair, or is simply naming this file enough? In my references, I see
the name of my key file. Should I set the build action to Embedded
Resource, or is none the right choice?

2) I don't want to install my DLL in the GAC. So please let me know if
that should be okay. Remember, I simply want to call the dll late bound
from vba, or other com programs.

3) I have made a public sub new in the main class I am calling with no
constructors.

4) My application compiles fine, as I made every dll "strong named",
using the rules stated above. No key value pairs were done. Just what I
did above.

5) I have the following at the top of my class:
<ComClass()Publ ic Class MyClass

6) I did not do any other code inside the class, using the GUIDs as
you showed in your explanation. I did not do ComVisible anywhere, just the
ComClass code.

7) I chose Register for Com Interop in the project properties, which
is probably why it works on my development machine.

8) I chose a similar option in Wise InstallBuilder when deploying, so
it should be doing regasm in the install.

9) My CreateObject on the deployed machine still gets ActiveX cannot
create object. It seems like I am going to have to go at this for a while.
Your feedback would be appreciated.

Thank You!

"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:u4******** ******@TK2MSFTN GP05.phx.gbl...
>Hello Derek ,

All the steps that you describe ( make the assembly com visisble ,
create a public sub new )
sounds how i create my .Net dll`s COM callable however i missed only one
thing you did not mention

Did you register the COM capable assembly with regasm.exe ?
My dll`s are callable with CreateObject from VBA ,VBS and even PHP ,
with PHP however i discovered that the assembly needed to be deployed in
the GAC or the APACHE assembly directory
here is some copy paste code i created a long time ago for this group

http://groups.google.com/group/micro...996d74d250974e

As you see i create my own interface id`s , as this gives me the benefit
of compatibility through my rules
HTH

Michel Posseth
http://www.vbdotnetcoder.com


"Derek Hart" <de********@yah oo.comschreef in bericht
news:uy******* *******@TK2MSFT NGP06.phx.gbl.. .
>>Also, I found this article:

http://msdn.microsoft.com/en-us/libr...sz(vs.71).aspx

In which it states:
In addition, it is not necessary to install assemblies into the global
assembly cache to make them accessible to COM interop or unmanaged code.

I sure wish I could figure out how to deploy a dotnet application, with
has a dll with public functions, and have COM objects use that, and not
have to use the GAC. But I need the code to be late bound in the COM
programs because I will not be able to set references to the DLLs or
even know where they are installed. Please point me in the right
direction!


"Derek Hart" <de********@yah oo.comwrote in message
news:Oi****** ********@TK2MSF TNGP03.phx.gbl. ..
I am unclear about what all the requirements are to call a simple vb.net
application , installed in the GAC, from COM (such as writing vba in Word
to call the dotnet dll).

I believe I have installed the dll in the GAC. It is in there and has a
public token. I did not create a key-value pair. I believe it is strong
named, as it shows up in the GAC.

How do I browse the objects of it? I would like to call it late bound,
but the errors I get show that the properties or methods are not
available.

I have put <ComClass()as an attribute at the beginning of the public
class.

In VS 2008, I have chosen Register to COM interop.

I have all the options in Wise Installbuilder showing that it installs
the assembly in the GAC.

I have made sure that the class has this code:
Public Sub New
MyBase.New
End Sub

Just how many guesses do we need to do to just call a dotnet object? Is
there an article that lists what is required, instead of just parts and
pieces.

Please help.



Nov 20 '08 #7
Hi Michael,

We register out .NET DLL's by installing them to the target location and
then using the following command:

C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \RegAsm
<targetdir>\wha tever.dll /codebase /s /tlb

This works for us. You did not mention the requirement to use /codebase when
registering the DLL. Isn't this required for DLL's which are not in the GAC?

This article says that it is required.

http://www.code-magazine.com/article...0703112&page=3
Developers should use the /codebase switch whenever they install the
assembly into a location other than the GAC. Basically, /codebase tells
Regasm.exe to include the path to the assembly in the registry so that the
COM client using it can find it. A quick look in the registry will reveal
that, in the CLSID key of the registered .NET assembly classes, Regasm added
a string value named CodeBase to the InprocServer32\ ProductVersion subkeys.
This string value is the fully qualified path to the assembly that was
registered with the /codebase switch.

Maybe this will help the OP with his issue?

Hope this helps,

Joseph Geretz

"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:ev******** ******@TK2MSFTN GP04.phx.gbl...
Hello Derek ,

About 1 and 2 , This is only necesary for the GAC i do not sign or
strong
name my COM dll`s at all as i install them in the callers directory path
,
note that for a hosted runtime this must be the directory of the excution
host ( for PHP the apache assembly directory and for VBS the system32
dir )

The call places are , Callers instrallation directory , GAC and System32
so your dll must be in one of these locations

As the assembly behaves as expected on your development system ,(the VS
IDE
is taking care of registering the COM assembly on the dev system )
this is where your focus should be .

I guess that Wise is not registering your .Net COM component the right
way
, to confirm that this is the case do the following , open a command
window on a target system , go through the command prompt to the
framework
directory ( normally this is "C:\Windows\Mic rosoft.Net\Fram eworkNumber\"

If you have the blinking cursor on that location , type regasm
C:\FullpathTo\Y ourComDllName.d ll and press enter you should get a
confirmation that it succeeded .

Now your assembly should work as expected , if it does ( i know that
for
95% sure ) here is the solutions for your Wise project
on any system ( this may be your dev machine ) type now at the framework
command prompt :

regasm C:\FullpathTo\Y ourComDllName.d ll /regfile:myRegis trationFile.reg

The registration file that is now created , should be included in your
Wise
setup project
http://www.wisesolutions.com/upload/wfwi.pdf
see page 144 ( adding registry keys )
If you have done this , it should work for every installation you make
with
your deploy package
I hope to hear from you if you succeeded (or not :-( )

Regards,

Michel Posseth


"Derek Hart" <de********@yah oo.comschreef in bericht
news:u$******** ******@TK2MSFTN GP03.phx.gbl...
>If I could get more specific, I would appreciate your thoughts. Please
let me know if my steps are wrong, or I am missing some, or if I don't
need some.

1) This is all I have done to strong name the vb.net dll. In the
project properties, under Signing, I have chosen Sign The Assembly and
chosen New in the combo box to make a new file. I simply named the file
and gave it a password. I did nothing in reference to the key value pair,
as I do not need this level of security. Is it required to make a key
value pair, or is simply naming this file enough? In my references, I see
the name of my key file. Should I set the build action to Embedded
Resource, or is none the right choice?

2) I don't want to install my DLL in the GAC. So please let me know
if that should be okay. Remember, I simply want to call the dll late
bound from vba, or other com programs.

3) I have made a public sub new in the main class I am calling with
no constructors.

4) My application compiles fine, as I made every dll "strong named",
using the rules stated above. No key value pairs were done. Just what I
did above.

5) I have the following at the top of my class:
<ComClass()Pub lic Class MyClass

6) I did not do any other code inside the class, using the GUIDs as
you showed in your explanation. I did not do ComVisible anywhere, just
the ComClass code.

7) I chose Register for Com Interop in the project properties, which
is probably why it works on my development machine.

8) I chose a similar option in Wise InstallBuilder when deploying, so
it should be doing regasm in the install.

9) My CreateObject on the deployed machine still gets ActiveX cannot
create object. It seems like I am going to have to go at this for a
while. Your feedback would be appreciated.

Thank You!

"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:u4******* *******@TK2MSFT NGP05.phx.gbl.. .
>>Hello Derek ,

All the steps that you describe ( make the assembly com visisble ,
create a public sub new )
sounds how i create my .Net dll`s COM callable however i missed only
one thing you did not mention

Did you register the COM capable assembly with regasm.exe ?
My dll`s are callable with CreateObject from VBA ,VBS and even PHP ,
with PHP however i discovered that the assembly needed to be deployed in
the GAC or the APACHE assembly directory
here is some copy paste code i created a long time ago for this group

http://groups.google.com/group/micro...996d74d250974e

As you see i create my own interface id`s , as this gives me the
benefit of compatibility through my rules
HTH

Michel Posseth
http://www.vbdotnetcoder.com


"Derek Hart" <de********@yah oo.comschreef in bericht
news:uy****** ********@TK2MSF TNGP06.phx.gbl. ..
Also, I found this article:

http://msdn.microsoft.com/en-us/libr...sz(vs.71).aspx

In which it states:
In addition, it is not necessary to install assemblies into the global
assembly cache to make them accessible to COM interop or unmanaged
code.

I sure wish I could figure out how to deploy a dotnet application, with
has a dll with public functions, and have COM objects use that, and not
have to use the GAC. But I need the code to be late bound in the COM
programs because I will not be able to set references to the DLLs or
even know where they are installed. Please point me in the right
direction!


"Derek Hart" <de********@yah oo.comwrote in message
news:Oi***** *********@TK2MS FTNGP03.phx.gbl ...
>I am unclear about what all the requirements are to call a simple
>vb.net application, installed in the GAC, from COM (such as writing vba
>in Word to call the dotnet dll).
>
I believe I have installed the dll in the GAC. It is in there and has
a public token. I did not create a key-value pair. I believe it is
strong named, as it shows up in the GAC.
>
How do I browse the objects of it? I would like to call it late bound,
but the errors I get show that the properties or methods are not
available .
>
I have put <ComClass()as an attribute at the beginning of the public
class.
>
In VS 2008, I have chosen Register to COM interop.
>
I have all the options in Wise Installbuilder showing that it installs
the assembly in the GAC.
>
I have made sure that the class has this code:
Public Sub New
MyBase.New
End Sub
>
Just how many guesses do we need to do to just call a dotnet object?
Is there an article that lists what is required, instead of just parts
and pieces.
>
Please help.
>




Nov 21 '08 #8
Hello Joseph,

That is a good one , i guess that this is exactly what the OP needs as this
saves him form installing a copy of the Dll to the system32 or GAC to get it
to work in
third party applications that he is not aware of at the moment of
installation .

As far as i know the article you mention should tell it this way
Developers should use the /codebase switch whenever they install the
assembly into a location other than the GAC.
my version :-)

Developers should use the /codebase switch whenever they install the
assembly into a location other than the callers assembly directory , the
systen32 directory or the GAC.

However AFAIK then it is also required to sign and strong name the assembly
, personally i just copy my dll to the callers directory
regards

Michel


"Joseph Geretz" <jg*****@nospam .comschreef in bericht
news:eP******** ******@TK2MSFTN GP02.phx.gbl...
Hi Michael,

We register out .NET DLL's by installing them to the target location and
then using the following command:

C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \RegAsm
<targetdir>\wha tever.dll /codebase /s /tlb

This works for us. You did not mention the requirement to use /codebase
when registering the DLL. Isn't this required for DLL's which are not in
the GAC?

This article says that it is required.

http://www.code-magazine.com/article...0703112&page=3
Developers should use the /codebase switch whenever they install the
assembly into a location other than the GAC. Basically, /codebase tells
Regasm.exe to include the path to the assembly in the registry so that the
COM client using it can find it. A quick look in the registry will reveal
that, in the CLSID key of the registered .NET assembly classes, Regasm
added a string value named CodeBase to the InprocServer32\ ProductVersion
subkeys. This string value is the fully qualified path to the assembly
that was registered with the /codebase switch.

Maybe this will help the OP with his issue?

Hope this helps,

Joseph Geretz

"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:ev******** ******@TK2MSFTN GP04.phx.gbl...
>Hello Derek ,

About 1 and 2 , This is only necesary for the GAC i do not sign or
strong
name my COM dll`s at all as i install them in the callers directory path
,
note that for a hosted runtime this must be the directory of the excution
host ( for PHP the apache assembly directory and for VBS the system32
dir )

The call places are , Callers instrallation directory , GAC and
System32
so your dll must be in one of these locations

As the assembly behaves as expected on your development system ,(the VS
IDE
is taking care of registering the COM assembly on the dev system )
this is where your focus should be .

I guess that Wise is not registering your .Net COM component the right
way
, to confirm that this is the case do the following , open a command
window on a target system , go through the command prompt to the
framework
directory ( normally this is "C:\Windows\Mic rosoft.Net\Fram eworkNumber\"

If you have the blinking cursor on that location , type regasm
C:\FullpathTo\ YourComDllName. dll and press enter you should get a
confirmation that it succeeded .

Now your assembly should work as expected , if it does ( i know that
for
95% sure ) here is the solutions for your Wise project
on any system ( this may be your dev machine ) type now at the framework
command prompt :

regasm C:\FullpathTo\Y ourComDllName.d ll /regfile:myRegis trationFile.reg

The registration file that is now created , should be included in your
Wise
setup project
http://www.wisesolutions.com/upload/wfwi.pdf
see page 144 ( adding registry keys )
If you have done this , it should work for every installation you make
with
your deploy package
I hope to hear from you if you succeeded (or not :-( )

Regards,

Michel Posseth


"Derek Hart" <de********@yah oo.comschreef in bericht
news:u$******* *******@TK2MSFT NGP03.phx.gbl.. .
>>If I could get more specific, I would appreciate your thoughts. Please
let me know if my steps are wrong, or I am missing some, or if I don't
need some.

1) This is all I have done to strong name the vb.net dll. In the
project properties, under Signing, I have chosen Sign The Assembly and
chosen New in the combo box to make a new file. I simply named the file
and gave it a password. I did nothing in reference to the key value
pair, as I do not need this level of security. Is it required to make a
key value pair, or is simply naming this file enough? In my references,
I see the name of my key file. Should I set the build action to Embedded
Resource, or is none the right choice?

2) I don't want to install my DLL in the GAC. So please let me know
if that should be okay. Remember, I simply want to call the dll late
bound from vba, or other com programs.

3) I have made a public sub new in the main class I am calling with
no constructors.

4) My application compiles fine, as I made every dll "strong named",
using the rules stated above. No key value pairs were done. Just what I
did above.

5) I have the following at the top of my class:
<ComClass()Pu blic Class MyClass

6) I did not do any other code inside the class, using the GUIDs as
you showed in your explanation. I did not do ComVisible anywhere, just
the ComClass code.

7) I chose Register for Com Interop in the project properties, which
is probably why it works on my development machine.

8) I chose a similar option in Wise InstallBuilder when deploying,
so it should be doing regasm in the install.

9) My CreateObject on the deployed machine still gets ActiveX cannot
create object. It seems like I am going to have to go at this for a
while. Your feedback would be appreciated.

Thank You!

"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:u4****** ********@TK2MSF TNGP05.phx.gbl. ..
Hello Derek ,

All the steps that you describe ( make the assembly com visisble ,
create a public sub new )
sounds how i create my .Net dll`s COM callable however i missed only
one thing you did not mention

Did you register the COM capable assembly with regasm.exe ?
My dll`s are callable with CreateObject from VBA ,VBS and even PHP ,
with PHP however i discovered that the assembly needed to be deployed
in the GAC or the APACHE assembly directory
here is some copy paste code i created a long time ago for this group

http://groups.google.com/group/micro...996d74d250974e

As you see i create my own interface id`s , as this gives me the
benefit of compatibility through my rules
HTH

Michel Posseth
http://www.vbdotnetcoder.com


"Derek Hart" <de********@yah oo.comschreef in bericht
news:uy***** *********@TK2MS FTNGP06.phx.gbl ...
Also, I found this article:
>
http://msdn.microsoft.com/en-us/libr...sz(vs.71).aspx
>
In which it states:
In addition, it is not necessary to install assemblies into the global
assembly cache to make them accessible to COM interop or unmanaged
code.
>
I sure wish I could figure out how to deploy a dotnet application,
with has a dll with public functions, and have COM objects use that,
and not have to use the GAC. But I need the code to be late bound in
the COM programs because I will not be able to set references to the
DLLs or even know where they are installed. Please point me in the
right direction!
>
>
>
>
"Derek Hart" <de********@yah oo.comwrote in message
news:Oi**** **********@TK2M SFTNGP03.phx.gb l...
>>I am unclear about what all the requirements are to call a simple
>>vb.net application, installed in the GAC, from COM (such as writing
>>vba in Word to call the dotnet dll).
>>
>I believe I have installed the dll in the GAC. It is in there and has
>a public token. I did not create a key-value pair. I believe it is
>strong named, as it shows up in the GAC.
>>
>How do I browse the objects of it? I would like to call it late
>bound, but the errors I get show that the properties or methods are
>not available.
>>
>I have put <ComClass()as an attribute at the beginning of the
>public class.
>>
>In VS 2008, I have chosen Register to COM interop.
>>
>I have all the options in Wise Installbuilder showing that it
>installs the assembly in the GAC.
>>
>I have made sure that the class has this code:
>Public Sub New
> MyBase.New
>End Sub
>>
>Just how many guesses do we need to do to just call a dotnet object?
>Is there an article that lists what is required, instead of just
>parts and pieces.
>>
>Please help.
>>
>
>




Nov 21 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
1973
by: j23 | last post by:
I have library (static) testlib.cpp: #include <stdarg.h> void xxx(...) { char buf; va_list args; va_start(args, buf); va_end(args); }
5
3436
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS 5), but fails on IIS 6 running on a Win2003 server. The web uses Pages derived from a custom class I wrote (which itself derives from Page) to provide some common functionality. The Page_Load handler the failing webpage starts out like this: ...
2
3053
by: Thomas Schoch | last post by:
I have a file with binary data and a dll where I have to pass a OLE_HANDLE which points to the data in the file. How do I read the data (i presume as binaryreader) and then pass the OLE_HANDLE to the function? Thomas
7
4987
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type Parameter. I can call the first Method without Problems, the Parameter can be deserialized by the WebService. But if I want to call the second Method and give it an Array of Parameters, then the following exception is thrown by the WebService:...
3
12887
by: Henrik | last post by:
Hi all,,, I need to get a refferece to a XML-webservice, and get some data from it.... But I can't add it like an web-refference... What options does I else have?? I've been told that i've to use SOAP, to connect to it, but how?? Are there any good documentation for that?? all the examples that i've found, is using web-refference.. Thanks
3
9104
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. If the web service is taking a long time to complete, the aspx page returns a ‘The operation has timed-out.’ Message to the web browser after 100 seconds. I’ve added: <httpRuntime executionTimeout="300" /> to the web.config files
3
5075
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb). I changed the data type for the structure that contains the XML data from the default "String" to "xml.xmldocument" to enable easy filling of the data. my client code creates an XML document class, fills the data using standard xml dom...
5
2601
by: joeblast | last post by:
I have a Web service that gets the financial periods and hold a reference to a disconnected dataset built at initialization. Web methods work on the dataset inside the web service. Everything is fine so far. My problem is that when I call a web method to modify the dataset inside the Web service it is never updated and I get no errors. currentPeriods method will always give me 1 even if I call ChangeDataset and call currentPeriods...
3
4251
by: Jason | last post by:
I have an ASP.NET application in which I would like to call my button click event (imgSubmitSearch_Click) on the page load if certain criteria are met. Is this possible? What is the correct syntax to be able to programmatically have my imgSubmitSearch button clicked? I tried the obvious, Call imgSubmitSearch, but intellisense doesn't like that due to the sender / e arguments. Private Sub imgSubmitSearch_Click(ByVal sender As...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.