来自VB的Cll用于C# [英] dll from VB for C#
本文介绍了来自VB的Cll用于C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
如何在C#代码中使用VB库?我有library.dll文件,之后
将它添加到C#中的引用我只能看到4种方法,而在添加
之后它可以看到VB的引用我可以看到15种方法。
解决方案
VB或VB.NET?如果这是经典的VB,试试这个。打破二进制兼容性和
编译到一个新的DLL。然后在C#中检查,看看你是否仍然看不到
方法。如果是这样,它与COM接口有关。我不确定
解决方案是什么,但这就是我要开始看的地方。
---
Gregory A. Beamer
MVP; MCP:+ I,SE,SD,DBA
***************************
在盒子外面思考!
*************************** >
" mamin"写道:
您好
如何在C#代码中使用VB库?我有library.dll文件,并且在将其添加到C#中的引用之后我只能看到4种方法,而在将它添加到VB的引用之后我可以看到15种方法。
不幸的是它是VB.NET :(
此外我没有这个dll的来源。 />
U?ytkownik" Cowboy(Gregory A. Beamer) - MVP"
< No ************ @ comcast.netNoSpamM> napisa3 w wiadomo?ci
新闻:85 ********************************** @ microsof t.com ...VB或VB.NET?如果这是经典的VB,试试这个。打破二进制兼容性
并编译成一个新的DLL。然后在C#中查看并查看如果你仍然看不到
方法。如果是这样,它与COM接口有关。我不确定
解决方案是什么,但这是我开始看的地方。
---
Gregory A. Beamer
MVP; MCP:+ I,SE,SD,DBA
********************
在外面思考电子邮箱!
*******************************
mamin写道:
您好
如何在C#代码中使用VB库?我有library.dll文件,在将其添加到C#中的引用之后我只能看到4种方法,而在
之后将它添加到VB的引用中我可以看到15种方法。
mamin,
您在VB中看到的方法是否可能是静态的?在C#中,你是
在实例上看不到它们,相反,只有在确定范围时才会看到它们(VB对此更加宽松)。 />
希望这会有所帮助。
-
- Nicholas Paldino [.NET / C#MVP]
- mv*@spam.guard.caspershouse.com
" mA最小" <毫安*** @ autograf.pl>在消息中写道
news:cq ********** @ nemesis.news.tpi.pl ...这是VB.NET不幸的是:(
此外我没有这个dll的来源。
U?ytkownik" Cowboy(Gregory A. Beamer) - MVP"
< No * ***********@comcast.netNoSpamM> napisa3 w wiadomo?ci
新闻:85 ********************** ************ @ microsof t.com ...VB或VB.NET?如果这是经典的VB,试试这个。打破二进制兼容性
和编译成一个新的DLL。然后检查C#,看看你是否仍然看不到
方法。因此,它与COM接口有关。我不确定
解决方案是什么,但这是我开始看的地方。
---
MVP; MCP:+ I,SE,SD,DBA
******************** *******
在盒子外面思考!
*************************** >
mamin写道:
>嗨
>如何在C#代码中使用VB库?我有library.dll文件和
>之后
>将它添加到C#中的引用中我只能看到4种方法,而在添加>之后它给VB的参考资料我可以看到15种方法。
>
>
>
>
Hi
How can I use VB libraries in C# code? I have library.dll file and after
adding it to references in C# i can see only 4 methods, while after adding
it to VB''s references i can see 15 methods.
解决方案
VB or VB.NET? If this is classic VB, try this. Break binary compatibility and
compile to a new DLL. Then examine in C# and see if you still cannot see the
methods. If so, it has to do with COM interfaces. I am not sure what the
solution is, but that is where I would start to look.
---
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"mamin" wrote:
Hi
How can I use VB libraries in C# code? I have library.dll file and after
adding it to references in C# i can see only 4 methods, while after adding
it to VB''s references i can see 15 methods.
It''s VB.NET unfortunately :(
Moreover I don''t have source of this dll.
U?ytkownik "Cowboy (Gregory A. Beamer) - MVP"
<No************@comcast.netNoSpamM> napisa3 w wiadomo?ci
news:85**********************************@microsof t.com...VB or VB.NET? If this is classic VB, try this. Break binary compatibility and compile to a new DLL. Then examine in C# and see if you still cannot see the methods. If so, it has to do with COM interfaces. I am not sure what the
solution is, but that is where I would start to look.
---
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"mamin" wrote:Hi
How can I use VB libraries in C# code? I have library.dll file and after
adding it to references in C# i can see only 4 methods, while after adding it to VB''s references i can see 15 methods.
mamin,
Is it possible that the methods you see in VB are static? In C#, you
won''t see them on instances, rather, you will see them only when scoped
correctly (VB is more lax about this).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"mamin" <ma***@autograf.pl> wrote in message
news:cq**********@nemesis.news.tpi.pl...It''s VB.NET unfortunately :(
Moreover I don''t have source of this dll.
U?ytkownik "Cowboy (Gregory A. Beamer) - MVP"
<No************@comcast.netNoSpamM> napisa3 w wiadomo?ci
news:85**********************************@microsof t.com...VB or VB.NET? If this is classic VB, try this. Break binary compatibility
andcompile to a new DLL. Then examine in C# and see if you still cannot see
themethods. If so, it has to do with COM interfaces. I am not sure what the
solution is, but that is where I would start to look.
---
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"mamin" wrote:> Hi
> How can I use VB libraries in C# code? I have library.dll file and
> after
> adding it to references in C# i can see only 4 methods, while after adding > it to VB''s references i can see 15 methods.
>
>
>
这篇关于来自VB的Cll用于C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文