Skip to main content
GameDev.net gamedev.net
🔒 Locked

COM Question

Started by slyterence Apr 4, 2005 at 6:17 AM 0 replies 350+ views
Original Post
slyterence
slyterence
Hi, I've written a couple of classes to take advantage of the COM+ Event system. I've implemented an event class in C++, and a subscriber to go with it. So far, all is well, and I can create the subscriber and receive events from a C# publisher. However, I need to pass these events on to my server application (C++). At first, I tried using a function pointer, but that didn't work so well. It works fine from a C++ publisher, but causes the C# publisher to display the "This program has crashed and needs to close" dialog box, (the one with the option of reporting the crash to M$). Despite this dialog, the program doesn't actually crash, it just throws an exception which I catch and handle, and then runs normally again. However, due to that dialog, I've had to find a different solution. (Also, if this system has to run on a distributed architecture I don't think I can go passing simple function pointers around the network). I decided to try to implement a second interface on my C++ publisher. The idea is that the publisher will store all the events coming in through the event interface in a list, which can be accessed by the server through the second interface. However, when I call CoCreateInstanceEx() with the two IID's, I get an error back: Not all the requested interfaces were available. The second interface is returning E_NOINTERFACE, and I can't work out why. In the component services manager tool I've successfully installed my object, and both interfaces are visible there. I've used a number of the CLSCTX constants, with either the same result, or the "Class not registered" error for constants like CLSCTX_REMOTE_SERVER. Can anybody please shed some light on any possible reason why I'm getting E_NOINTERFACE? Or, alternatively, suggest a better design to pass COM+ events to a standard (NON COM) application. Thanks In Advance Terence
We scratch our eternal itchA twentieth century bitchWe are grateful forOur Iron Lung

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.