Convert a project (ImageStone) to Dll

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 97612
    New Member
    • Nov 2008
    • 6

    Convert a project (ImageStone) to Dll

    Purpose: Convet the project " ImageStone "(with source code) to a DLL

    Platform: Visual Studio 2005 on Windows Vista

    What I've done:
    1. Create a empty DLL project and add all the source codes of ImageStone in the Header Files of the project(because ImageStone project has only header files)

    2. Add "__declspec(dll export)" in all the functions of .h file in the Header Files of project

    3. Add a ImageStone.cpp file to the Source Files
    #include "ImageStone .h"

    int main()
    {
    return 0;
    }

    4. Build the project and got the ImageStone.dll

    5. Create another new project to this solution

    6. Copy the "example01" which also provided by ImageStone project to the Source Files of the project that step 5 created

    7. Setup the Reference, Additional Include Directories, and Environment of the project of step 5 created

    8. Build the solution and got the expample01.exe

    Question: I want to prove the correctness of the DLL that just maked. I remove the DLL and run the example01.exe, and example01.exe still work!!! It means I failed. The ImageStone is still build with example01.exe as a static library.

    How can I do to achieve my purpose? Thanks for your answers!
    Last edited by 97612; Nov 4 '08, 08:14 AM. Reason: update
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    If #include-ing "ImageStone .h" is enough to incorporate all the source code, you
    don't need any compiled code (in a .dll) to generate your application. That's also
    what happened with your other project; i.e. it didn't need any compiled code.

    kind regards,

    Jos

    Comment

    • 97612
      New Member
      • Nov 2008
      • 6

      #3
      Originally posted by JosAH
      If #include-ing "ImageStone .h" is enough to incorporate all the source code, you
      don't need any compiled code (in a .dll) to generate your application. That's also
      what happened with your other project; i.e. it didn't need any compiled code.

      kind regards,

      Jos
      Sorry, I can't get what you mean. Did you mean that I can only use ImageStone as static library rather than a .dll?

      Can you explain more detail or tell me what should I do next for build ImageStone as .dll?!

      Thanks a lot!

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by 97612
        Sorry, I can't get what you mean. Did you mean that I can only use ImageStone as static library rather than a .dll?

        Can you explain more detail or tell me what should I do next for build ImageStone as .dll?!

        Thanks a lot!
        Your previous remark: ImagStone consists of .h files only and you're supposed
        to use it by #include-ing "imagestone .h". So just that incorporates its source
        code in your code. There is no need for compiled code in a library, whether
        static or dynamic.

        kind regards,

        Jos

        Comment

        • 97612
          New Member
          • Nov 2008
          • 6

          #5
          Originally posted by JosAH
          Your previous remark: ImagStone consists of .h files only and you're supposed
          to use it by #include-ing "imagestone .h". So just that incorporates its source
          code in your code. There is no need for compiled code in a library, whether
          static or dynamic.

          kind regards,

          Jos
          Is that I need to separate the codes that implement ImageStone from the .h files if I still want to build ImageStone as a .dll? Did I misunderstand what you mean?

          Best Regards

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by 97612
            Is that I need to separate the codes that implement ImageStone from the .h files if I still want to build ImageStone as a .dll? Did I misunderstand what you mean?
            You understood it correctly and my guess is that it'll be a hell of a job to separate
            the code from the declarations in those .h files.

            kind regards,

            Jos

            Comment

            • 97612
              New Member
              • Nov 2008
              • 6

              #7
              Originally posted by JosAH
              You understood it correctly and my guess is that it'll be a hell of a job to separate
              the code from the declarations in those .h files.

              kind regards,

              Jos
              OK. Thank you very much! I really appreciate your patience for my questions.

              Best Regards

              97612

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #8
                Originally posted by 97612
                OK. Thank you very much! I really appreciate your patience for my questions.
                You're welcome of course and to tell you the truth: your question was one of the
                more sane questions posted in the forum lately ;-) Best of luck with your project.

                kind regards,

                Jos

                Comment

                Working...