MFC dll creation
-
I have created one dialog based application with MySQL database. In that database, 9 tables are used. In my dialog there are 3 butons name allocation, de-allocation and ChangeNew and each button has it own specific functions. Now I want to create a Dll for 3 functions (Allocation, De-Allocation and ChangeNew). First I tried with MFC Extension DLL and it was working fine but it could used only any MFC based application. But I want to used in non MFC based application. But I dont know how to write DLL with the classes which can be used in Non MFC based applicaion. Kinldy help me.
-
I have created one dialog based application with MySQL database. In that database, 9 tables are used. In my dialog there are 3 butons name allocation, de-allocation and ChangeNew and each button has it own specific functions. Now I want to create a Dll for 3 functions (Allocation, De-Allocation and ChangeNew). First I tried with MFC Extension DLL and it was working fine but it could used only any MFC based application. But I want to used in non MFC based application. But I dont know how to write DLL with the classes which can be used in Non MFC based applicaion. Kinldy help me.
The side effects of having the wizard do everything for you? :) Write a regular Win32 DLL. You can use
__declspec(dllexport)
to export a function from within the DLL. Again, use the wizard to choose a new project->win32->win32 DLL. There are plenty of articles that explains about DLLs here at CP. You can do a search to have a look at them.It is a crappy thing, but it's life -^ Carlo Pallini
-
I have created one dialog based application with MySQL database. In that database, 9 tables are used. In my dialog there are 3 butons name allocation, de-allocation and ChangeNew and each button has it own specific functions. Now I want to create a Dll for 3 functions (Allocation, De-Allocation and ChangeNew). First I tried with MFC Extension DLL and it was working fine but it could used only any MFC based application. But I want to used in non MFC based application. But I dont know how to write DLL with the classes which can be used in Non MFC based applicaion. Kinldy help me.
AS a side note to Rajesh's reply, you may, as well, use the wizard to obtain a
Win32 DLL
skeleton: chooseWin32 project
as the new project andDLL
as 'Application type' in the 'Application Settings' tab (at least it works on myVS2005
). :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
The side effects of having the wizard do everything for you? :) Write a regular Win32 DLL. You can use
__declspec(dllexport)
to export a function from within the DLL. Again, use the wizard to choose a new project->win32->win32 DLL. There are plenty of articles that explains about DLLs here at CP. You can do a search to have a look at them.It is a crappy thing, but it's life -^ Carlo Pallini
I need to understand, if possible, why actually there is a macro arround __declspec(dllexport), such that it can be translated into a dllexport or dllimport... I'm seeing this in many occasions but I do'nt knwo it is doing it :confused: Thanks.
Easy Profiler : a compile-time profiler for C++ www.potatosoftware.com
-
I need to understand, if possible, why actually there is a macro arround __declspec(dllexport), such that it can be translated into a dllexport or dllimport... I'm seeing this in many occasions but I do'nt knwo it is doing it :confused: Thanks.
Easy Profiler : a compile-time profiler for C++ www.potatosoftware.com
Ahmed Charfeddine wrote:
I need to understand, if possible, why actually there is a macro arround __declspec(dllexport), such that it can be translated into a dllexport or dllimport...
Such macros are usually written to avoid typing __declspec(dllexport) every time. Something like MYEXPORT would do instead. Also, the same macro would be defined as __declspec(dllimport) in the importing side, so I can be just double lazy. :) There are several good articles at CP on the DLLs section[^], I recommend you read them.
It is a crappy thing, but it's life -^ Carlo Pallini