Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. class '...all MFC classes...' needs to have dll-interface to be used by clients of class 'ErrDlg'

class '...all MFC classes...' needs to have dll-interface to be used by clients of class 'ErrDlg'

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiotutorialquestion
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 1354
    wrote on last edited by
    #1

    i:\eldis3\bib_source\eurodialoge\errdlg.h(47) : warning C4251: 'm_text' : class 'CString' needs to have dll-interface to be used by clients of class 'ErrDlg' c:\programme\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' Since I use a lot of lib's (dll's) I get this warning for nearly everything I am exporting. I can't see any problems with this warning (There are (I hope so) no problems at runtime) but I want to get rid of these endless warnings at compile time. Does anyone know from where these warnings are coming? Does anyone know how to get rid of these warnings? Thank you...

    B B 2 Replies Last reply
    0
    • U User 1354

      i:\eldis3\bib_source\eurodialoge\errdlg.h(47) : warning C4251: 'm_text' : class 'CString' needs to have dll-interface to be used by clients of class 'ErrDlg' c:\programme\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' Since I use a lot of lib's (dll's) I get this warning for nearly everything I am exporting. I can't see any problems with this warning (There are (I hope so) no problems at runtime) but I want to get rid of these endless warnings at compile time. Does anyone know from where these warnings are coming? Does anyone know how to get rid of these warnings? Thank you...

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      Well, you could use #pragma warning(disable:4251) But I think this is a warning based upon some other problem you are not diagnosing. My suspicion is that you might have some of your DLL statically linked to MFC and some are dynamically linked. Good luck! I was just at a location where they had mixed and matched them with VC 5.0, and wow! did things really go crazy when the VC 6.0 was first used. Had to go through all modules of all related projects and settle on one type or another.

      1 Reply Last reply
      0
      • U User 1354

        i:\eldis3\bib_source\eurodialoge\errdlg.h(47) : warning C4251: 'm_text' : class 'CString' needs to have dll-interface to be used by clients of class 'ErrDlg' c:\programme\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' Since I use a lot of lib's (dll's) I get this warning for nearly everything I am exporting. I can't see any problems with this warning (There are (I hope so) no problems at runtime) but I want to get rid of these endless warnings at compile time. Does anyone know from where these warnings are coming? Does anyone know how to get rid of these warnings? Thank you...

        B Offline
        B Offline
        Brian Hart
        wrote on last edited by
        #3

        In the header file for each class in your DLL, specify AFX_EXT_CLASS just before the name of the class and then the whole class will be exported. ie. class AFX_EXT_CLASS CErrorDialog : public CDialog { //.. }; and then remove any and all export stuff you have anywhere else for that class. Brian

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups