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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a DLL...

Status
Not open for further replies.

cadbilbao

Programmer
Apr 9, 2001
233
0
0
ES
Hi!

I am working with Visual C++ 6.0, and I created a program that reads an XML document and creates a txt file. I've just compiled, and I've got a .exe program running correctly.

Now I want to carry out a DLL to be included within other programs.

My questions are:
+ Wich steps must I follow to create it?
+ Could I use the same code? Must I include more things?

Regards,
 
You should create with AppWizard a new Dinamically Linked Library. John Fill
1c.bmp


ivfmd@mail.md
 
You can create two types of dll:

1. MFC AppWizard dll - is a dll, in which you can use the full features of MFC.
2. Win32 Dynamic Link Library - is a dll, in which you use the API function, (you can use MFC also if you want to).

The principal differences are:
- MFC DLL does not have a DllMain function. you handle you load-unload event in InitInstance and ExitInstance of the App class generated by the wizard
- in MFC dll - in every exported function the first line must be a call to AFX_MANAGE_STATE macro

Hope of being of some help, s-)
Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
BurtanI
You've forgotten about ATL COM object and MFC ActiveX object. Maybe here is required to put also all the DLL tutorials :)? John Fill
1c.bmp


ivfmd@mail.md
 
I've created an MFC AppWizard DLL, and there are been created:
+ Source Files
+ myproject.cpp
+ myproject.def
+ myproject.rc
+ StdAfx.cpp
+ Header Files
+ myproject.h
+ Resource.h
+ StdAfx.h

Wich of them must I insert my code in?

My piece of code was written for a Windows Console Application, so there are:
+ myexe.cpp
+ myexe.h
+ file.h

Where must I include them?

Best regards.


 
you should have some class dericed from CWinApp or some thing like it. The analog of main code, put in it's InitInstance. John Fill
1c.bmp


ivfmd@mail.md
 
I do have the same problem experiencing on creating a DLL using win32 Dynamic Link Library.
After creating the dll with the export(DLLExport) command,I cant import(DLLImport) it back to the main .cpp file.
I tried putting the dll file both in and out of the Debug folder of the project directory, where it supposed should be.
Help me out with experienced hand, as I coudn't get it from MSDN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top