By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,645 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,645 IT Pros & Developers. It's quick & easy.

Convert a project (ImageStone) to Dll

P: 6
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(dllexport)" 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!
Nov 4 '08 #1
Share this Question
Share on Google+
7 Replies


Expert 10K+
P: 11,448
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
Nov 4 '08 #2

P: 6
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!
Nov 4 '08 #3

Expert 10K+
P: 11,448
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
Nov 4 '08 #4

P: 6
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
Nov 4 '08 #5

Expert 10K+
P: 11,448
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
Nov 4 '08 #6

P: 6
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
Nov 4 '08 #7

Expert 10K+
P: 11,448
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
Nov 4 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.