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. How to use CString class in my dll?

How to use CString class in my dll?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorialquestion
6 Posts 4 Posters 0 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.
  • M Offline
    M Offline
    MohammadAmiry
    wrote on last edited by
    #1

    Hi. I have made a dll project in VC6. When I add #include<afx.h> the following error occurs. I tried to remove #include<windows.h> from stdafx.h but that didn't help either. ..\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

    C N P 3 Replies Last reply
    0
    • M MohammadAmiry

      Hi. I have made a dll project in VC6. When I add #include<afx.h> the following error occurs. I tried to remove #include<windows.h> from stdafx.h but that didn't help either. ..\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You could try using std::string. But, I'm sure there are ways to get CString included. Why don't you work out the header it's in, and just include that ?

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      1 Reply Last reply
      0
      • M MohammadAmiry

        Hi. I have made a dll project in VC6. When I add #include<afx.h> the following error occurs. I tried to remove #include<windows.h> from stdafx.h but that didn't help either. ..\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

        N Offline
        N Offline
        Nibu babu thomas
        wrote on last edited by
        #3

        MohammadAmiry wrote:

        When I add #include the following error occurs.

        Include afxwin.h and remove afx.h and windows.h.


        Nibu thomas A Developer Programming tips[^]  My site[^]

        M 1 Reply Last reply
        0
        • M MohammadAmiry

          Hi. I have made a dll project in VC6. When I add #include<afx.h> the following error occurs. I tried to remove #include<windows.h> from stdafx.h but that didn't help either. ..\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

          P Offline
          P Offline
          Paresh Chitte
          wrote on last edited by
          #4

          Please refer this[^] Regards, Paresh.

          1 Reply Last reply
          0
          • N Nibu babu thomas

            MohammadAmiry wrote:

            When I add #include the following error occurs.

            Include afxwin.h and remove afx.h and windows.h.


            Nibu thomas A Developer Programming tips[^]  My site[^]

            M Offline
            M Offline
            MohammadAmiry
            wrote on last edited by
            #5

            now the following errors occur: Compiling... StdAfx.cpp Compiling... Macro2.cpp Linking... nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in Macro2.obj nafxcwd.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in Macro2.obj; second definition ignored Creating library Debug/Macro2.lib and object Debug/Macro2.exp Debug/Macro2.dll : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. Creating browse info file... Macro2.dll - 2 error(s), 1 warning(s)

            N 1 Reply Last reply
            0
            • M MohammadAmiry

              now the following errors occur: Compiling... StdAfx.cpp Compiling... Macro2.cpp Linking... nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in Macro2.obj nafxcwd.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in Macro2.obj; second definition ignored Creating library Debug/Macro2.lib and object Debug/Macro2.exp Debug/Macro2.dll : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. Creating browse info file... Macro2.dll - 2 error(s), 1 warning(s)

              N Offline
              N Offline
              Nibu babu thomas
              wrote on last edited by
              #6

              Look here[^]


              Nibu thomas A Developer Programming tips[^]  My site[^]

              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