Maybe you should limit the objects lifetime to the lifetime of the thread. Currently the object is destroyed at any time by the GC in the GC thread. Try calling Marshal.ReleaseComObject before the thread ends, to guarantee a deterministic lifetime of the object.
tom englert
Posts
-
COM Component Late binding trouble -
COM Component Late binding troubleIf that works in WinForms, then you maybe have a threading problem. The main thread of WinForms runs in STA, and if your object is designed for STA too ("ThreadingModel=Apartment" in the registry) everything is fine. But if you call that code from an MTA thread, the interface for the object has to be marshaled, which I assume is not supported by your interface.
-
COM Component Late binding troubleHi, you wrote that you look at the COM component with ILDASM - but you probably examined the generated CLR-interop rather than the real COM component. Since you can't do early binding with that interop, it must have been already messed up, so I would not rely on the information provided by it. To see what's really provided by the COM object you could have a look at the type library, using e.g. OLE-COM Object Viewer (OleView.exe) from Windows SDK.
-
Infinite Scrolling in CanvasHi, I think the key to solve your problem could be the IScrollInfo interface. Your canvas implementation would override MeasureOverride() to calculate min and max values, ArrangeOverride() to position the items considering the scroll offsets, and implement IScrollInfo to sync the scroll offsets and constraints with the ScrollViewer. Hope that helps.