Results 1 to 3 of 3

Thread: MFC Dll

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2000
    Posts
    32
    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.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2000
    Posts
    32
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width