如何从vb.net中的不同vc ++ dll中调用相同的方法名称 [英] how to call same method name from defferent vc++ dll in vb.net

查看:63
本文介绍了如何从vb.net中的不同vc ++ dll中调用相同的方法名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个dll
1.hello.dll
2.hellox64.dll

这两个dll相同,但平台不同.
我想根据Plateform(x86& x64)从两个dll调用相同的函数
vb.net代码

I have two dll
1.hello.dll
2.hellox64.dll

both the dll are same but except in platform.
I want to call the same function from the both dll''s according to plateform(x86 & x64)
vb.net code

If (IntPtr.Size = "8") Then
                rc = ABCx64(parameters)
            Else
                rc = ABC(parameters)


并调用
之类的代码


And calling code like


Public Declare Function ABC Lib "hello" (ByVal parameters As Integer) As IntPtr

Public Declare Function ABCx64 Lib "hellox64" Alias "ABC" (ByVal parameters As Integer) As IntPtr



问题是它可以在x86位上正常工作,但不要求x64位,错误是找不到ABCx64.



The problem is it is work fine in x86 bit but not calling for x64 bit,error is ABCx64 is not find

推荐答案

希望这会帮助您http://bytes.com/topic/net/answers/658235-call-visual -c-dll-using-vb-net


这篇关于如何从vb.net中的不同vc ++ dll中调用相同的方法名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆