Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

pass interface pointer to exe server

pearmanpearman Member Posts: 1
Hi!
I am a beginner for ATL/COM programmer. I want to write a Com
client and server(local server). I want to do something like Callback mechanism.Client pass interface pointer to server as method parameters. This interface is implemented by Client. Server gets this interface pointer. Now server can call client method. But when client send the interfejs pointer I always get error: (ole32.dll) Access Violation 0xc0000005. I try to type library and standard marshaling, but always is the same. When I do:

IClientInterface* p_ IClientInterface = NULL;
p_Server->Connect(p_ IClientInterface);

All is OK, and server method is properly called. But when I try:

// global
Csink mysink; // the class implement IclientInterface;

int main()
{
...
p_Server->Connect((IClientInterface*)&mysink);
...
}
When I wrote DLL server, all was OK, only for EXE server I get this error:(
I understand this is marshal problem?
How can I resolve this issue?
Thank for your help in advance.

Sign In or Register to comment.