从非托管代码C ++调用托管API RegisterAssembly(...)等 [英] To invoke Managed API RegisterAssembly(...) etc., from Unmanaged Code C++
问题描述
大家好,
Q 1. GacInstall(字符串程序集名称)& RegisterAssembly(字符串程序集名称)已经实现/源代码是否存在。 ?
即。项目有以下二进制文件进行注册(Win32 dll',COM dll',.NET Dll'/ assembly with COM接口,纯.NET dll'/程序集。
Q 2.我的应用程序是非托管C ++,我需要嵌入以上调用我需要执行任何编译器开关设置(因为如上所述调用托管调用)。
即。,如何调用混合模式调用,从非托管代码到托管代码虽然我已启用项目设置为/ CLR Safe
和
..
Hi All,
Q 1. Does GacInstall(string assemblyname) & RegisterAssembly(string assemblyname) been implemented/does the source code exist for the same. ?
ie., project having below binaries for subjecting to registration(Win32 dll''s, COM dll''s, .NET Dll''s/assemblies with COM Interfaces, pure .NET dll''s/assemblies.
Q 2. my Application is of Unmanaged C++, I need to embed the above calls does I need to perform any compiler switch settings(because invoking managed calls as above).
ie., how to invoke mixed mode call, from Unmanaged code to managed code though I have enabled the project settings to /CLR Safe
and
..
#using <mscorlib.dll>
//I could not get autocompletion for the below namespaces
#include "Abc.h"
.......
#using namespace System;
#using namespace System.Enterpriseservices.internal.publish;
{
Publish p = new Publish();
p.GacInstall(string assemblypath);
}
int Somefunc(void)
{
.....
return 0;
}
详细信息:VS 2010 IDE,Windows 7操作系统。
问候,
VishaK_90
----- -------------------------------------------------- -------------------------
Details: VS 2010 IDE , Windows 7 O/S.
Regards,
VishaK_90
--------------------------------------------------------------------------------
推荐答案
Q1。它们都是Microsoft产品,因此除非您购买开发者订阅MSDN,否则源代码可能无法使用。
Q2。为什么要尝试将这些调用嵌入到非托管代码中;你的目的不明确?
Q1. They are both Microsoft products so the source code is probably not available unless you buy a developer subscription to MSDN.
Q2. Why are you trying to embed these calls into unmanaged code; your purpose is not clear?
这篇关于从非托管代码C ++调用托管API RegisterAssembly(...)等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!