I have Visual Studio 2015. I created a Visual C++ ATL project. I named it WinHookLayer. Using Wizard I added a class and selected ATL COM+ 1.0 Component and created a class with short name HookWrapper and clicked Finish.
From class view, I added a method named SetMouseHook to HookWrapper. In HookWrapper.cpp, I see the following code generated: -
STDMETHODIMP CHookWrapper::SetMouseHook(LONG threadId, LONG* result)
{
// TODO: Add your implementation code here
return S_OK;
}
I added my code inside it, made the dll and registered it. Then I created a C# Windows Forms application. I added reference to WinHookLayer.tlb and also added using WinHookLayerLib; in the .cs file.
I wrote
HookWrapper hkWrapper = new HookWrapper();
Till now it works fine. But SetMouseHook function is not visible from hkWrapper.
I can see the methods "Equals", "GetHashCode", "GetType" and "ToString" but not the method I added.