CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2004
    Posts
    1,361

    Use of MFC : Use Standard Windows Libraries What does this do?

    I have a basic MFC dialog based app. I see in the compiler options, one of the configuration options is the use of MFC. I see an option for static, shared DLL and Use Standard Windows libraries. What exactly does this last option do opposed to the other two types?

    I figured since I was using MFC and then selecting the Use Standard Windows Libraries that it might not link or run, but it seems to run just fine. Am I no longer dependent upon various MFC Dlls using this option?

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Use of MFC : Use Standard Windows Libraries What does this do?

    From the Visual Studio help when you're in the properties dialog...
    "Non-MFC projects can select Use Standard Windows Libraries to link to various Win32 libraries that are included when you use MFC"

  3. #3
    Join Date
    Sep 2004
    Posts
    1,361

    Re: Use of MFC : Use Standard Windows Libraries What does this do?

    Yeah, I read that, and it doesn't really tell me anything. Logically if I had an MFC project then selecting that option would cause my program to not link or run because the MFC libraries are not there, right? Yet I can build and run an MFC application using those settings.

    So, I want to know why this is and what is really going on, if anyone knows.

  4. #4
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Use of MFC : Use Standard Windows Libraries What does this do?

    You probably have made some other changes that make the project build regardless of that setting.

    I made a fresh MFC MDI application in VC2005 and changed to use 'Use Standard Windows Libraries' and got:
    .../afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
    Defining _AFXDLL made it build and run for MBCS but fail in linking for UNICODE.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  5. #5
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Use of MFC : Use Standard Windows Libraries What does this do?

    Defining _AFXDLL made it build and run for MBCS but fail in linking for UNICODE.
    To link for UNICODE you need to define entry point explicitly: /entry:wWinMainCRTStartup
    Best regards,
    Igor

  6. #6
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Use of MFC : Use Standard Windows Libraries What does this do?

    I didn't bother why it failed in UNICODE since I felt that the MBSC solution was probably enough to explain why DeepT's project built successfully.

    Anyway, thanks Igor! It's always nice to get new knowledge. I didn't know that. Probably because I always use the project settings dialog.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

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