Events don’t get raised when working with COM registered library

  autocad, c++, com, events, windows

Currently I am developing a plugin for AutoCAD/BricksCad. I am using a third party DLL which I have registered in Windows COM with regsvr32.
This library does some optimization, and after it is done it should raise some event.
The problem is, that the event is not fired every time. On some computers it works, but for some, it doesn’t. (i.e. just the events don’t get fired, everything else works fine)

My code (just to ensure correct event-handling):

optimizer.OnProgress += new _ICut2DXEvents_OnProgressEventHandler(() => pm.MeterProgress()); // update progresbar
optimizer.OnFinish += new _ICut2DXEvents_OnFinishEventHandler(() => ConstructPattern()); // draw something

optimizer.StartOptimization();

As I mentioned, this is a "plugin". I am compiling this to a .dll and it is called by AutoCAD.

I know this is rather little information to work with, but if anybody had similar problems I would be grateful for every suggestion.
Thanks in advance.

Source: Windows Questions

LEAVE A COMMENT