W
Wazza
HI all, Hope this day is going well.
If someone would care to add there $0.02 too a problem I am facing I
would be very happy.
My problem; I have a class, (lets call it) FooBar, and because it does
a lot of funny interopts with various com instances it is esential
that all calls made in my class to these com instances hapen on the
same thread that created the comm instance.
Unfortunatly for me my aplication is heavily multi threaded and I have
several classes like foobar.
I would like to create a class that inherits foobar, CooBarMk2 that
adds an execution thread that is static to the class; This execution
thread would handle creating the com object and calls to the object.
I would then like to have all calls to the CooBarMk2 class
autotmaticaly be hijacked and pumped to the execution thread to;
I want to do this hijacking (hooking/thunking) because it is not to
feasable to write inherited versions of every member in foobar, as
foobar changes often. From a software maintenece prespecttive, in my
situation, it will cause problems.
The idea is I have a few classes like foobar that change often and I
want a drop in dynamicly created wrappers that will transform them to
my owner threaded needs.
I have done similar things in c++, and it wasn't pretty. But Im not
savy with all the CLR stuff and dynamic code generation features.
Well any thoughts appreciated,
-Wazza
If someone would care to add there $0.02 too a problem I am facing I
would be very happy.
My problem; I have a class, (lets call it) FooBar, and because it does
a lot of funny interopts with various com instances it is esential
that all calls made in my class to these com instances hapen on the
same thread that created the comm instance.
Unfortunatly for me my aplication is heavily multi threaded and I have
several classes like foobar.
I would like to create a class that inherits foobar, CooBarMk2 that
adds an execution thread that is static to the class; This execution
thread would handle creating the com object and calls to the object.
I would then like to have all calls to the CooBarMk2 class
autotmaticaly be hijacked and pumped to the execution thread to;
I want to do this hijacking (hooking/thunking) because it is not to
feasable to write inherited versions of every member in foobar, as
foobar changes often. From a software maintenece prespecttive, in my
situation, it will cause problems.
The idea is I have a few classes like foobar that change often and I
want a drop in dynamicly created wrappers that will transform them to
my owner threaded needs.
I have done similar things in c++, and it wasn't pretty. But Im not
savy with all the CLR stuff and dynamic code generation features.
Well any thoughts appreciated,
-Wazza