Evil dll's

This is a discussion on Evil dll's within the Windows Programming forums, part of the Platform Specific Boards category; How would I go about making a class internal to a dll? To clarify, how do I make a class ...

  1. #1
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685

    Evil dll's

    How would I go about making a class internal to a dll? To clarify, how do I make a class that would not go into the definition file and not be part of the library file?

    Here is a simplified example of what I want:

    Code:
    class MyClass {
    public:
        MyClass();
        void *MyFunc1(int, int)
        ...
    };
    
    //assume that the class has been defined
    
    //avoid name-mangling
    extern "C" {
    //c functions that I want the dll to export
    
    void *DLLEXPORT something(int i) {
        MyClass stuff;
        return  stuff.MyFunc1(i, 7);
    }
    
    }
    In the dll I am working on I do not what any internal classes to be exported, however, they are anyway. I am using mingw 3.2.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,670
    Did you try making the function private?



    ITSA
    Socket Library!

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Here is one tutorial on basic DLL implementation.

    http://www.flipcode.com/tutorials/tut_dll01.shtml

    Kuphryn

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Well I actually figured it out a very shortly after posting this. I found using the --no-export-all-symbols option does the trick fine since it will only export functions/classes that have been explicitly been declared as a dll export. I'll look at the link anyway, who knows I may learn something.

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Remember also that a DLL can have a "main()" function, called, oddly enough, DllMain() in which you can initialise and set things up for internal use ny the .dll's public and private functions.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Protection of DLLs
    By Poche in forum C# Programming
    Replies: 5
    Last Post: 06-04-2009, 08:30 PM
  2. Some doubts on DLLs
    By BrownB in forum Windows Programming
    Replies: 1
    Last Post: 05-30-2007, 02:25 AM
  3. standart dlls
    By keeper in forum C++ Programming
    Replies: 3
    Last Post: 07-05-2006, 07:32 PM
  4. Resident Evil: The Evil Begins-Coder Needed
    By ^Tomala^ in forum Projects and Job Recruitment
    Replies: 8
    Last Post: 01-04-2005, 04:37 PM
  5. Can't load string from resource DLL's string table
    By s_k in forum Windows Programming
    Replies: 4
    Last Post: 07-15-2003, 06:43 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21