Sure, I can give you a few hints. Let me start by saying though that this will be several orders of magnitude harder to program that what you are used to with our wizards. Basically, how server events work are they are implemented as a separate interface where the functions are implemented in the client instead of the server. What you would have to do is manually edit the IDL file and add a event interface that is externally sourced. Below you can see an example of the declaration for externally sourced interface _INIDSCtlEvents from DataSocket
coclass CWDataSocket {
[default] interface INIDSCtl;
[default, source] dispinterface _INIDSCtlEvents;
};
Then, the normal way to implement client registration of event handling woul
d be through the IConnectionPoint interface in the SDK. This will take quite a bit of work to implement though and you would probably want different connection points for each event. Alternately, if you are the only one using the server (it doesn't have to be COM standard), you could implement another function in one of your other interfaces that would take in a IUnknown interface pointer from the client and be able to cast and call it.
I don't know how much COM you have done, so my information may not make a lot of sense. If it doesn't, this is going to be quite an arduous process for you since it will require a good COM understanding. I would start by reading about the IConnectionPoint and IEvent interfaces and looking at type libraries of servers that have events to see how they are implemented in the IDL. Also, find a good COM book that covers events.
Another thing to realize is once you've manually edited the IDL and implementation files generated from our server wizard
, regenerating the files from the wizard will remove those edits. So, have a separate copy where you are making the changes.
Best Regards,
Chris Matthews
National Instruments