After you have created a DLL, you can use the functions it defines in an application. The following is a simple console application that uses the myPuts function exported from Myputs.dll (see Creating a Simple Dynamic-Link Library).
Because this example calls the DLL function explicitly, the module for the application must be linked with the import library Myputs.lib. For more information about building DLLs, see the documentation included with your development tools.
#include <windows.h>
extern "C" int __cdecl myPuts(LPCWSTR); // a function from a DLL
int main(VOID)
{
int Ret = 1;
Ret = myPuts(L"Message sent to the DLL function\n");
return Ret;
}
Related topics
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
