.net dll을 C++ 프로젝트로 가져 오려고합니다. 다음 코드 C++ 코드 constains는 :노래 C# dll을 C++ 프로젝트로 가져 오는 중입니까?
#include "stdafx.h"
#import "RemoteAgentLibs.tlb" named_guids raw_interfaces_only
int main() {
HRESULT init = CoInitialize(NULL);
if (init != S_OK) return 1;
ImportedNamespace::_ClassNamePtr myclass;
myclass = new ImportedNamespace::_ClassNamePtr("ImportedNamespace.ClassName");
myclass->MyMeyhod();
}
모든 것이 잘 작동 전까지 나는 확인 내 .NET 프로젝트의 속성에서 "어셈블리 서명". .NET 프로젝트에서 내가 얻을 경고 :
Warning 3 "path to dll" does not contain any types that can be unregistered for COM Interop.
Warning 3 "path to dll" does not contain any types that can be registered for COM Interop.
에서 C++ 프로젝트 I 얻을 오류 : 강력한 이름을 가져와 problme이 DLL을 서명이 왜
error C2039: 'MyMethod' : is not a member of 'ImportedNamespace::_ClassNamePtr'
누군가가 말해 주시겠습니까? 또는 내 DLL을 C++ 프로젝트로 가져오고 GAC에 DLL을 추가하는 다른 방법이 있습니까
당신의 C++ 프로젝트의 강력한 이름이 서명 되었습니까? 보통 둘 다 있어야합니다. –
내 C++ 프로젝트의 속성 -> 구성 속성 -> 링커 -> 고급 -> KeyFile에 대해 생각합니다. 동일한 파일에 대한 경로를 사용하여 .net 프로젝트에 서명했습니다. – user3227048