Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creat DLL File

Status
Not open for further replies.

t2hieu

Programmer
Dec 19, 2002
3
VN
How can i creat a DLL file , so other application will call some function in it?
 
Hi,

Create your project as a DLL using the File / New options of Visual Studio. Select the type of DLL you want then proceed from there.

If you have the MSDN you may want to do a search for "DLLs for Beginners" this article will tell you what you need to know and help prevent those "anomilies" associated with DLL usage.

HTH
--
William
Software Engineer
ICQ No. 56047340
 
You should also remember to export your functions from the DLL and import them into the program that uses the DLL. Generally, this is done using preprocessor definitions in the header file:

----------------------

#ifdef MYDLL_PROJECT // this symbol is defined inside the DLL's project, it won't be defined anywhere else

#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllimport)
#endif

//Now, prototype the functions.

MYDLL_API void someFunc();
MYDLL_API int someFunc(char c);

-----------------------

Include this header file in the DLL's project and in any other projects that will use the functions inside the DLL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top