如何使用DLLImport进行互操作 [英] How to use DLLImport for Inter-operability

查看:74
本文介绍了如何使用DLLImport进行互操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以向我解释我们如何在C#中将DLLImport用于用户定义的函数.即
我在VB6.0中定义了一个函数Ge​​tMessage().
我知道,我可以使用TLBIMP.exe导入它.我可以在C#中使用DLLImport使用该函数吗?如果可以的话,需要执行哪些步骤.

请说明

Can anybody explain me how do we use DLLImport in C# for user defined functions. i.e
I have a function GetMessage() defined in VB6.0.
I know, I can import it using TLBIMP.exe. Can I use the function using DLLImport in c#. If I can, what are the steps required to do so.

Please explain

推荐答案

类似的内容:

something like:

[DllImport("TestLib.dll",CallingConvention=CallingConvention.Cdecl)]
public static extern string GetMessage(  );


也许?

您必须仔细检查从c#到VB的调用约定


perhaps?

you''d have to double check the calling convention from c# to VB


这篇关于如何使用DLLImport进行互操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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