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. Problem in using CString in Win32 dynamic library

Problem in using CString in Win32 dynamic library

Scheduled Pinned Locked Moved C / C++ / MFC
help
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.
  • V Offline
    V Offline
    vinay_K
    wrote on last edited by
    #1

    Hi. I have created a console application which reads a file from the local disk and does certain operation on the data. where i need to specify the path of the file. Now i have to create a dll file and i have to pass the path of the file as a parameter to the dll, But if i declare CString to hold the path it gives an error : undeclared identifier / no such directory of files found. please help me asap.

    _ M 2 Replies Last reply
    0
    • V vinay_K

      Hi. I have created a console application which reads a file from the local disk and does certain operation on the data. where i need to specify the path of the file. Now i have to create a dll file and i have to pass the path of the file as a parameter to the dll, But if i declare CString to hold the path it gives an error : undeclared identifier / no such directory of files found. please help me asap.

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      did you include and by the way you shouldn't be using a CString variable to be passed as a parameter. better use BSTR Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      V 1 Reply Last reply
      0
      • _ _AnsHUMAN_

        did you include and by the way you shouldn't be using a CString variable to be passed as a parameter. better use BSTR Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

        V Offline
        V Offline
        vinay_K
        wrote on last edited by
        #3

        I tried using BSTR but it is giving error in header file. can anyone suggest the solution, its very urgent.. with regards vinay

        _ 1 Reply Last reply
        0
        • V vinay_K

          I tried using BSTR but it is giving error in header file. can anyone suggest the solution, its very urgent.. with regards vinay

          _ Offline
          _ Offline
          _AnsHUMAN_
          wrote on last edited by
          #4

          include 'comutil.h' and link to comsupp.lib to use BSTR's.

          vinaykskvs wrote:

          its very urgent..

          Should have resisted posting to this URGENT question but since I had already answered previously, had to follow this up. Who suggested that you should be using CString variable to be used as a parameter while passing it to a different dll

          Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

          N 1 Reply Last reply
          0
          • _ _AnsHUMAN_

            include 'comutil.h' and link to comsupp.lib to use BSTR's.

            vinaykskvs wrote:

            its very urgent..

            Should have resisted posting to this URGENT question but since I had already answered previously, had to follow this up. Who suggested that you should be using CString variable to be used as a parameter while passing it to a different dll

            Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

            N Offline
            N Offline
            nisha00000
            wrote on last edited by
            #5

            change the property setting give MFC shared dll .. and then add afx .h header file .. i think it ll work fine...

            1 Reply Last reply
            0
            • V vinay_K

              Hi. I have created a console application which reads a file from the local disk and does certain operation on the data. where i need to specify the path of the file. Now i have to create a dll file and i have to pass the path of the file as a parameter to the dll, But if i declare CString to hold the path it gives an error : undeclared identifier / no such directory of files found. please help me asap.

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              Are you even using MFC as others have assumed? What version of Visual Studio? CStringT has been a template class for a few versions of VC++. The appropriate header for a non-MFC CString is atlstr.h. Mark

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              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