When you try to register the library gives 
Exeption_Search.cpp:
#include "stdafx.h" #include <iostream> #include <Windows.h> extern "C" __declspec(dllexport) void OnConnect() { // {5994FCF1-EC8C-48CE-9078-3C4DE11FFD4E} static const GUID GUID_handler_no_null = { 0x5994fcf1, 0xec8c, 0x48ce,{ 0x90, 0x78, 0x3c, 0x4d, 0xe1, 0x1f, 0xfd, 0x4e } }; MessageBox( NULL, L"Пустое значение", 0, MB_OK ); std::cout << "handler_no_null"; } dllmain.cpp:
#include "stdafx.h" HINSTANCE g_hInst = NULL; BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } STDAPI DllRegisterServer(void) { return 0; } On the Internet, I did not find a detailed and understandable solution to the problem.
DllRegisterServerexported or not? What is the library bit and regsrv32? - VTT