CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    3

    Urgent Need Help (DLL & MultiThread & Dialogs)

    Hello,
    Excuse my bad english i m french!

    Here's my strange probem :
    i m writing a WSock32.dll that should be able to popup dialog when the user goes to forbiden sites
    all works fine i create a dialog resource create the dialog with Create(IDD_SHOWINFO)
    and then show the message !
    i create the dialog in WSAStartup which is called only once at the loading of the dll
    so problem is that Iexplore load the dll call the WSASartup once but when i close Iexplore it dont call the WSACleanup, destroy all the windows i created before but doesn't not unload the dll so when i relaunch
    Iexplore it calls directly the dll functions but when the dll should popup dialogs it cant because the dialog
    doesnt exist anymore!

    i decide to check wether the dialog exist and if not to ceate a new one but i makes hang the dialog box!
    i think its because Iexplore is multithreaded so it call my function 3 times at once and so i create 3 dialog
    so i use mutex and the same things apear

    but if i put a AfxMessageBox("") at the end of the creation i can see my dialog and all work fine until i click on the ok the MessageBox!


    If somebody has read all the above and can help me it would be really really great!
    Thanks in advance
    Gandalf


  2. #2
    Join Date
    May 1999
    Location
    France
    Posts
    61

    Re: Urgent Need Help (DLL & MultiThread & Dialogs)

    Hello,

    I don't know with type of DLL ( MFC ).

    But if you use VC 5 or 6 for the 4 i dont remember, you can use appwizard to create a MFC DLL ( shared not static because you may have problemes ).
    I do this with the resource located on the dll and i have no probleme.




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

Featured