Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a dll which has some functions.
i should also create a project which reads the data from a file and store those values in a class and those values works wrt the functions present in dll.

later i need to convert that project into dll so that i could use it in windows form.

can anyone tell me this is a good method to work and also the possibility to convert that project to dll so that i can use it in different windows form application

What I have tried:

i have a doubt that main.cpp could be included in the dll.
Posted
Updated 4-Dec-17 20:19pm

No main.cpp should not get included, that is only for an executable. If you do not understand how to create a DLL then take a look at Walkthrough: Creating and Using a Dynamic Link Library (C++)[^].

[edit]
Go to the link I gave you above and work through it. You need to understand the differences between what happens at:
- the compile stage: define the class and method names for export, and create the actual code that the DLL provides.
- the link stage: links the objects of the DLL into a loadable library.

You then need to understand how to use the DLL. Your executable will need:
- the header file associated with the DLL containing the exported names. The compiler will use those to create external references in the compiled objects.
- the .LIB file that is used to resolve the external references at link time.
- the DLL itself that the loader will access at execution time.
[/edit]
 
Share this answer
 
v2
can you tell me how to link the library and the .h and .cpp file and convert into dll.
is it possible through cmake target link library.
 
Share this answer
 
Comments
Richard MacCutchan 5-Dec-17 3:15am    
See my edit above. Please do not post supplementary questions as Solutions, use the "Have a Question or Comment?" or "Reply" links below other messages.
Member 13475664 5-Dec-17 3:49am    
thank you so much i would go through and try to implement

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900