answersLogoWhite

0

How can you create a dll file?

Updated: 10/3/2023
User Avatar

Wiki User

12y ago

Best Answer
Steps to Create Your First DLL
  • Create a Win32 Dynamic Link Library project, adding a *.cpp and a *.h file.
  • In the *.cpp file, create a class instantiated from the CWinApp file. Collapse | Copy Code

    # include # include "SourceFile.h" class CDllApp : public CWinApp { public: CDllApp::CDllApp() { Calc(0,0); } DECLARE_MESSAGE_MAP() }; BEGIN_MESSAGE_MAP(CDllApp,CWinApp) END_MESSAGE_MAP() CDllApp DllObject;

  • In the *.h file (here it is SourceFile.h), define the functions to be used. Also specify the dllexport value for the _declspec function. Collapse | Copy Code

    extern "C" _declspec(dllexport) int Calc(char no1,char no2) { char result; result = no1 + no2; return result; }

  • Then compile the DLL.
  • Create a normal Win32 Application with a *.cppfile and a *.h file.
  • In the *.h file, (here it is AppHeader.h ), declare the function with the dllimport value of _declspec. Collapse | Copy Code

    extern "C" _declspec(dllimport) Calc(int FirstValue, int SecondValue);

  • In the *.cpp file, use the function. Collapse | Copy Code

    # include "AFXWIN.H" # include "AppHeader.h" class MainFrame : public CFrameWnd { public: MainFrame() { Create(0,"Trial"); } void OnLButtonDown(UINT nFlags,CPoint point) { int res; char str[5]; res = Calc(998,226); sprintf(str,"%d",res); MessageBox(str); } DECLARE_MESSAGE_MAP() };

  • In the Link tab of the "Project->Settings" dialog, go to the text box labeled "Object / Library Modules" and specify the path of the DLL file. Then copy the compiled DLL file to your current appliation path directory and run the program.
User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

you can follows this step :

click on Start and then click on Run.

you will input in the Run field a command that tells your computer to register the DLL file. You will need to input specific information including the path and the file name. The following is a template for the command: regsvr32 "\FileName.dll"

It is important to note that path is the actually location or directory of where the file is located. File name is obviously the name of the DLL file you will be registering. Below is a sample command: Regsvr32 "C:\Windows\System32\example.dll"

Once the command is input into the Run field correctly, press Enter.

Once the DLL has been registered, you should receive a confirmation in the form of a pop up box. This message will list your newly registered DLL file and confirm that is was successfully registered into the registry

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you create a dll file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you create dll file?

type nul > c:\my.dll


How do you register a dll file in dos mode?

To register a file, type regsvr32 .dll. Or type regsvr32 \.dll, where is the path to the file, and is the name of the file.


Where can you find karasX2 dll?

You can find karasX2.dll file in Windows System32 file.


Where does a win32 application look for a dll?

You can file dll file in C:\WINDOWS\system32.


Will cleaning your computer fix your dll problem?

Yes and no. The dll file may be just misplaced, then yes. A defrag your hdd and that should fix it. If a dll file is corrupt, then no. You will have to find or repair the dll file yourself.


How do you launch a dll file?

You do not launch a DLL. It's used by something else and will start up when needed. Read up on DLL file.


What can open dll files?

A DLL (dynamic link library) file is a file used by a specific application to communicate with devices inside or attached to the computer. DLL files aren't meant to be opened separately from the program they belong to. When you load the program the DLL file belongs to, that program will automatically load the DLL file if it needs it.


How do you make a dll file go back to its original or default form if it was opened with a text editor by accident?

Overwrite the file with the original dll file.


How do you convert a dll file into a mib file?

Right mouse click on dll file, click convert to, click options, click mib, click apply.


How do you re-install windows rootsystem32hal dll?

Hal dll file locates in C:\WINDOWS\system32. You can install in on this program file.


What is a dll file like when you open it?

i want to know what a .dll file looks like when u click on it. give me a pic plaease


How can you get rid of Wsock32 dll?

wsock32.dll error is one of the toughest PC errors and is originated with kernel.dll file. wsock32.dll file plays a crucial role in the Microsoft Windows and OS/2 operating systems. You need to replace the old one with a compatible version of wsock32.dll file.