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. Is it possible to convert part of source code to library?

Is it possible to convert part of source code to library?

Scheduled Pinned Locked Moved C / C++ / MFC
jsonquestion
4 Posts 3 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.
  • S Offline
    S Offline
    sunny_vc
    wrote on last edited by
    #1

    Hi All, im working on a dialog based application in vc6.0. My project consists of 15 files in which i need to convert 4 files in to a library. Is it really possible to convert only part of code in to a library, by keeping rest of the code as it is?? Or do i need to remove those 4 files and built them in to a separate work space as library and add it to the complete project? If I can do it, please give me the steps to do it.

    Regards, Sunil Kumar

    G S 2 Replies Last reply
    0
    • S sunny_vc

      Hi All, im working on a dialog based application in vc6.0. My project consists of 15 files in which i need to convert 4 files in to a library. Is it really possible to convert only part of code in to a library, by keeping rest of the code as it is?? Or do i need to remove those 4 files and built them in to a separate work space as library and add it to the complete project? If I can do it, please give me the steps to do it.

      Regards, Sunil Kumar

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      2 words : design, architecture given you've told us diddly squat about what your dialog app is doing, its a bit hard - but the answer could be 'yes' 15 files ? it really depends on the functionality - whats in the '4' files that makes them special ? If its a data processing/reformatting app for example, you may be able to seperate out the number crunching or string reformatting into a library/dll. You could even put your MFC stuff in an MFC Extension ... But likely you are going to need to do some 'refactoring' so

      sunilkumar.d wrote:

      Or do i need to remove those 4 files and built them in to a separate work space as library and add it to the complete project?

      is also going to have to happen So, suggestions ... Isolate your functions ? in 4 files into a seperate project, build a dll build a test harness for the dll and test it then IN A COPY of your dialog app, graft in the dll test test test next time, think about the design a bit harder .. thats still going to be a bit of work, but if for example you will want to use those functions again/elsewhere, you've done the hard bits ... 'g'

      S 1 Reply Last reply
      0
      • G Garth J Lancaster

        2 words : design, architecture given you've told us diddly squat about what your dialog app is doing, its a bit hard - but the answer could be 'yes' 15 files ? it really depends on the functionality - whats in the '4' files that makes them special ? If its a data processing/reformatting app for example, you may be able to seperate out the number crunching or string reformatting into a library/dll. You could even put your MFC stuff in an MFC Extension ... But likely you are going to need to do some 'refactoring' so

        sunilkumar.d wrote:

        Or do i need to remove those 4 files and built them in to a separate work space as library and add it to the complete project?

        is also going to have to happen So, suggestions ... Isolate your functions ? in 4 files into a seperate project, build a dll build a test harness for the dll and test it then IN A COPY of your dialog app, graft in the dll test test test next time, think about the design a bit harder .. thats still going to be a bit of work, but if for example you will want to use those functions again/elsewhere, you've done the hard bits ... 'g'

        S Offline
        S Offline
        sunny_vc
        wrote on last edited by
        #3

        Thanks Garth for your valuable suggestions. Actually I need to hide those files when I am giving the source code to client. Thats why I need to make them in to library. Anyway I think i need to redesign my Code for this to happen.

        Regards, Sunil Kumar

        1 Reply Last reply
        0
        • S sunny_vc

          Hi All, im working on a dialog based application in vc6.0. My project consists of 15 files in which i need to convert 4 files in to a library. Is it really possible to convert only part of code in to a library, by keeping rest of the code as it is?? Or do i need to remove those 4 files and built them in to a separate work space as library and add it to the complete project? If I can do it, please give me the steps to do it.

          Regards, Sunil Kumar

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          sunilkumar.d wrote:

          My project consists of 15 files in which i need to convert 4 files in to a library.

          That should be doable. So long as the files are in separate source files, you should be able to put them in a static library that you link into the application (it's not particularly different from just linking in the object files directly).

          sunilkumar.d wrote:

          Or do i need to remove those 4 files and built them in to a separate work space as library and add it to the complete project?

          I'd remove those source files from the original project, add a new static library project to the solution and add the source files to that. Remember that you'll still need to ship the header files that declare the items defined in the source files.

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

          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