Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MFC dll creation

MFC dll creation

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasemysqlhelptutorial
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gopalraja
    wrote on last edited by
    #1

    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.

    R C 2 Replies Last reply
    0
    • G gopalraja

      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.

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      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

      A 1 Reply Last reply
      0
      • G gopalraja

        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.

        C Offline
        C Offline
        CPallini
        wrote on last edited by
        #3

        AS a side note to Rajesh's reply, you may, as well, use the wizard to obtain a Win32 DLL skeleton: choose Win32 project as the new project and DLL as 'Application type' in the 'Application Settings' tab (at least it works on my VS2005). :)

        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]

        1 Reply Last reply
        0
        • R Rajesh R Subramanian

          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

          A Offline
          A Offline
          Ahmed Charfeddine
          wrote on last edited by
          #4

          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

          R 1 Reply Last reply
          0
          • A Ahmed Charfeddine

            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

            R Offline
            R Offline
            Rajesh R Subramanian
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups