Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在没有tlb文件的情况下使用进程外COM服务器_Com_Regfreecom_Out Of Process - Fatal编程技术网

如何在没有tlb文件的情况下使用进程外COM服务器

如何在没有tlb文件的情况下使用进程外COM服务器,com,regfreecom,out-of-process,Com,Regfreecom,Out Of Process,它是关于windowscom组件的 Server.exe:32位进程外COM服务器 CLSID_应用程序:Server.exe中COM对象的GUID Client.exe:64位客户端应用程序,以无注册表方式使用Server.exe 正如我们所知,exe不能用作无注册表COM组件,为了模拟这种行为,我自己通过提供确切的路径来启动Server.exe进程: CreateProcess(“Server.exe”) IClassFactory*pFactory=CoGetClassObject(

它是关于windowscom组件的

  • Server.exe:32位进程外COM服务器
  • CLSID_应用程序:Server.exe中COM对象的GUID
  • Client.exe:64位客户端应用程序,以无注册表方式使用Server.exe
正如我们所知,exe不能用作无注册表COM组件,为了模拟这种行为,我自己通过提供确切的路径来启动Server.exe进程:

  • CreateProcess(“Server.exe”)
  • IClassFactory*pFactory=CoGetClassObject(CLSID_应用程序)
  • pFactory->CreateInstance(ppapObject)
如果我注册了Server.tlb,它可以工作,但是在注销Server.tlb之后,它就无法创建ppAppObject,即使我将清单同时嵌入Server.exe和Client.exe:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<file name="Server.tlb">
  <typelib tlbid="{DAC4A4C9-F84C-4F05-A7DC-E152869499F5}" version="1.0" helpdir=""></typelib>
</file>
<comInterfaceExternalProxyStub name="IApplication" iid="{D74208EA-71C2-471D-8681-9760B8ECE599}" tlbid="{DAC4A4C9-F84C-4F05-A7DC-E152869499F5}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
</assembly>

你对此有什么想法吗

编辑: 事实证明,如果我为接口指定tlbid,并将清单嵌入到两个exe中,
元素足够吗?您不也需要
元素吗?

我已经试过了,但不起作用。并且只能用于标记,但在我的例子中,可执行文件是exe,它不受无注册表COM的支持