EndNote Interprocess Communication Tutorial

I’ve discovered that UseSynchronizationContext is only really useful with Windows Forms and Windows Presentation Foundation. Since we are using neither, we need to implement SynchronizationContext and then manually specify it. I’ve updated the tutorial and have verified that it does indeed run in the correct thread now.

If you need to see what thread something is running in for debugging purposes, you can use the following:

OutputDebugString(L"second test!");
char threadID[20];
DWORD dwThreadID = GetCurrentThreadId();
_itoa(dwThreadID, threadID, 10);
OutputDebugString(L"In thread: ");
OutputDebugStringA(threadID);
OutputDebugString(L"\n");