PDA

Click to See Complete Forum and Search --> : MFC Dll


glotzbam
Nov 18th, 2000, 11:03 AM
I have an MFC Dll that I developed. It uses Windows Sockets to create a connection to a server, and send data. Everything works, but the OnReceive event.

The only time I can get the OnReceive event to fire is when the application that is calling the Dll is an MFC application.

I can make the connection and send and receive data when using a console app, the event just won't fire. I can manually receive data, but I need an event.

The application that I am building to interface with this is going to be in C, and I have no choice between C and C++, so I need the event to fire from a non-MFC app. Is this possible, or is there something that I am overlooking.

Thanks for any help.

parksie
Nov 18th, 2000, 11:15 AM
Try using a function callback. When you set up the MFC DLL from your console app, the DLL should store the callback function for that thread, and instead of an event, call the function with the required values.

However, the best is always to create non-MFC DLLs, because they aren't the most reliable things :(

glotzbam
Nov 18th, 2000, 12:04 PM
The problem isn't that the dll can't communicate back to the application, the problem is that the socket's OnReceive event isn't triggered. I guess I used an MFC Dll for simplicity? Should I look into another way?