设置IPC机制(32位到64位) [英] Setup IPC mechanism(32-bit to 64-bit)

查看:93
本文介绍了设置IPC机制(32位到64位)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在这里和其他地方研究了一段时间并意识到这一点  https://www.scribd.com/document/56629579/64-Bit-Insider-Volume- 1-Issue-7  描述了
的一些选项。我有一个32位DLL,没有源代码。我无法完全了解设置这项工作的IPC机制。

I researched this here and elsewhere for some time and realize that https://www.scribd.com/document/56629579/64-Bit-Insider-Volume-1-Issue-7 describes some options. I have a 32-bit DLL and no source code. And I couldn't quite understand the IPC mechanism to setup to make this work.


这是我尝试在没有IPC的情况下进行的。

Here is my attempt to do it without IPC.


最初我在我的64位C#代码中尝试过这个。我以为我可以获得对DLL指针的引用,但我得到了null。

Initially I tried this in my 64-bit C# code. I thought I could get a reference to the DLL's pointer but I got null.

static class NativeMethods
    {
    [System.Runtime.InteropServices.DllImport("kernel32.dll")]
    public static extern IntPtr LoadLibrary(string dllToLoad);

    [DllImport("kernel32.dll")]
    public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);

    [DllImport("kernel32.dll")]
    public static extern bool FreeLibrary(IntPtr hModule);

}



我也认为这可行。但事实并非如此。

I also thought that this could work. It didn't.

        [DllImport("C:\\emulator\\pcshll32.dll")]
    public static extern UInt32 hllapi(out UInt32 Func, StringBuilder Data, out UInt32 Length, out UInt32 RetC);



似乎有一个设置这个IPC机制的过程。我该怎么做呢?

It seems that there is a process to setup this IPC mechanism. How can I go about doing that ?





推荐答案

引用文章讨论了64/32位IPC COM的上下文(组件对象模型)。 你想使用的32位dll是否包含注册和实例化COM对象的代码?
The referenced article discusses 64/32 bit IPC in the context of COM (Component Object Model).  Does the 32 bit dll that you wish to use contain code to register and instantiate COM objects?


这篇关于设置IPC机制(32位到64位)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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