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

URGENT: Need to call VB6 DLL from C# .net application without referencing VB6 DLL

P: n/a
Guys,
I am using c# to call some DLL. Here is my situation, I tried to create
reference to this dll in my project and I am able to call this dll
successfully, but when actual dll is upgraded to new version it is
giving COM exception like CLSID is not registered. Because of this I am
having some admin problems. I want a solution without referencing the
dll I need to call the original DLL OR how to overcome this situation
if I reference the DLL in the project.

Could someone help me out what I can do to solve this issue?
Any help would be greatly appreciated

Tx,
csharpguy

May 21 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I would have a word with whomever creates the VB6 DLL and get them to set
"binary compatibility". There is no reason for a VB6 DLL to change it's
class Id between compiles. If it is being compiled with binary compatibility
then they class id remains the same, unless they "break" the interface by
changing the signatures of the public interface.

HTH
Steve

"csharpguy" <ch********@gmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
Guys,
I am using c# to call some DLL. Here is my situation, I tried to create
reference to this dll in my project and I am able to call this dll
successfully, but when actual dll is upgraded to new version it is
giving COM exception like CLSID is not registered. Because of this I am
having some admin problems. I want a solution without referencing the
dll I need to call the original DLL OR how to overcome this situation
if I reference the DLL in the project.

Could someone help me out what I can do to solve this issue?
Any help would be greatly appreciated

Tx,
csharpguy

May 21 '06 #2

P: n/a
Steve,
Thanks for the reply. But VB6 DLL is a third party DLL, We cannot make
it binary.

Is there any other solution?. Can we use PInvoke, if so how do we get
class variables?

I appreciate your help.

Thanks

May 22 '06 #3

P: n/a
In the VB world, I'd be using late binding and invoking the DLL after
creating a reference via a call to CreateObject(). I'm not sufficiently
proficient in .Net to advise you on what the equivalent call is. Sorry.

Steve
"csharpguy" <ch********@gmail.com> wrote in message
news:11*********************@j55g2000cwa.googlegro ups.com...
Steve,
Thanks for the reply. But VB6 DLL is a third party DLL, We cannot make
it binary.

Is there any other solution?. Can we use PInvoke, if so how do we get
class variables?

I appreciate your help.

Thanks

May 22 '06 #4

P: n/a
alternative of CreateObject in C# world is

Type type1;

type1 = Type.GetTypeFromProgID(ProgId);

obj1 = Activator.CreateInstance(type1);

I hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com

May 22 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.