[Quickfix-developers] "Cannot pass a GCHandle across AppDomains"
Brought to you by:
orenmnero
From: Scott K. <sc...@la...> - 2010-06-21 17:55:36
|
So here's the issue: I'm trying to create a COM object for use in Excel, and I'm using the quickfix .NET wrapper API from version 1.13.3. I'm compiling the quickfix library from source, but I have not made any changes to it. Most the time everything works fine, but when I do an "initiator.start()", at some point subsequently the Log class gets invoked to send out "Connecting to x on port x", and I receive a "Cannot pass a GCHandle across AppDomains" exception that occurs when the onEvent method of the Log class is (attempted to be) accessed. If this is what it looks like, then the solution is very complicated and uses delegates, and possibly a total rewrite of the .NET wrapper: http://lambert.geek.nz/2007/05/29/unmanaged-appdomain-callback/ This appears to be a long standing problem with Quickfix. I've found a number of people receiving this exception. For example, here: http://article.gmane.org/gmane.comp.finance.quickfix.user/1362 (2009, has workaround) or here: http://osdir.com/ml/finance.quickfix.user/2006-10/msg00019.html (from 2006, says he contacted another user wit the same problem who had to develop his own fix implementation) Right now I can't directly search the mailing list (any search I do returns no results), so I guess my questions are this: Is this still a known problem with Quickfix and appdomains? Is the only real workaround to ensure that all of quickfix runs in one appdomain? If so, I'll have to look into doing that, or considering whether this project should be abandoned. It's not clear to me if it's possible to always ensure something is running in one appdomain, and I'd rather not invest a lot of time into this and have it run buggy. Scott |