Thread: Evil dll's

  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,708
    Did you try making the function private?
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  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,829
    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, 05: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