Код: Выделить всё
comКод: Выделить всё
// ...
hr = CoCreateInstance(
CLSID_rclsid,
NULL, CLSCTX_ALL,
CLSID_riid,
reinterpret_cast(&pMyComServer));
if (SUCCEEDED(hr)) {
g_hr = hr;
g_pMyComServer = pMyComServer;
pMyComServer->GetData();
}
// ...
CoUninitialize();
// ...
Код: Выделить всё
[Guid("D9084CEE-5C65-4AB6-9E10-2718595FAD83")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[ComVisible(true)]
public interface IPipeClient
{
void GetData();
}
[Guid("6BEE99C5-CEB5-4B2B-B605-0E6648162AEA")]
[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
public class PipeClient : IPipeClient
{
public void GetData(){...}
// ...
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... -com-class
Мобильная версия