开发者

Calling .Net Classes from Visual Basic 6

I have a .net dll file. I have to call one of the methods in this dll file from a VB prog开发者_运维知识库ram.

This dll file uses another .net dll file for logging purpose.

I able to call a .net class library method from VB6 application. But, I am getting the exception that unable to load assembly (which is used for logging).

How the vb6 application will search the dll files required for the execution?


Are both .NET assemblies in the GAC? You should be using the following -

Type Library Exporter (Tlbexp.exe)

http://msdn.microsoft.com/en-us/library/hfzzah2c.aspx

... and/or Assembly Registration Tool (Regasm.exe)

http://msdn.microsoft.com/en-us/library/tzat5yw6.aspx


VB6 can only work with .NET if the .NET classes are exposed as COM objects. And unless the .NET programmers knew you needed to call their method, chances are they didn't expose their classes as COM objects.


If you are using com-call to make sure you can acces functionality out of your .net project it will indeed search through your .dll file. If you are trying to do things that depend on the logging and you have not compiled it with the dll used in your comcall it won't be able to run because of dependencies.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜