Thread: DLL class member functions

  1. #1
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003

    DLL class member functions


    I have a group of functions that are part of a class. The class is called CONNECTION and the three functions (SendBinary, SendText and SendCGI) are all member functions that may be updated as I think if better ways to do what they do.

    I am trying to decide whether I should put them in a DLL or not, and even if it is possible to have member functions of a class (I'll keep the class in the main source form for now) in a DLL.

    If it is possible, could anyone point out any differences there might be from loading a regular function?

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    regular exported functions are __stdcall functions roughly meaning right to left calling convention and no name mangling. member functions are __thiscall which means that a "this" pointer is added as a parameter. Plus, name mangling can and does happen.

    I don't export classes directly. I use pointers to interfaces. I model this after COM roughly. You need a single exported DLL function to do this. GetNewObject() or something. There is a lot to getting this right. You should look at an explanation of COM.

    I haven't read this but it seems good:
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 11-17-2008, 01:00 PM
  2. Static functions.... why?
    By patricio2626 in forum C++ Programming
    Replies: 4
    Last Post: 04-02-2007, 08:06 PM
  3. deriving classes
    By l2u in forum C++ Programming
    Replies: 12
    Last Post: 01-15-2007, 05:01 PM
  4. DLL question
    By cboard_member in forum Game Programming
    Replies: 1
    Last Post: 04-24-2006, 02:19 AM
  5. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM