Qt大型工程开发技术选型PartFinal:CLR调用COM组件
这里其实没什么内容了,直接上代码吧,如下文所示:
#pragma once
#using <mscorlib.dll>
using namespace Main_Activerserver_DemoLib;
using namespace cli;
ref class MainProcess
{
public:
MainProcess() {
}
void Init() {
System::Type ^comType = System::Type::GetTypeFromProgID("Main_Activerserver_Demo.OutPut_Class.1");
Object ^comInstance = System::Activator::CreateInstance(comType);
int parameter = 114514;
array<Object^>^ parameters = { parameter };
comType->InvokeMember("receive_from_progress", System::Reflection::BindingFlags::InvokeMethod, nullptr, comInstance, parameters);
//test->receive_from_progress
}
void receive_from_com(System::Int32 test) {
System::Console::WriteLine(test);
}
};
标签:comType,PartFinal,Qt,System,开发技术,test,COM
From: https://www.cnblogs.com/Leventure/p/17010865.html