Problem with a lib file importet to a DLL. 
Author Message
 Problem with a lib file importet to a DLL.

Hi every one

I wonder if some one can help me with this problem. The problem only accures
when I import a lib file into a Windows DLL not into an EXE program.

I have a lib file created by a third party developper named THOMSON
multimedia. I need to make some hacker protection so I use the srand and
rand function for this. I have tested my hacker protection as a unit and it
works fine. When I include the lib file the hacker protection works fine as
long as I'm nnot calling any function in the library included. Sine I call
srand with parameter value 1 srand should set reset the random geteration.

The random function generates the same numbers over and over again but the
function in the library doesn't work. I can't even write debug information
to any file using an ostream.

This is my random function

double __cdecl local_random( DWORD Seed )
    DWORD n=2;

    //  Reset the random generator so we get the same
    //  number every time.
        n = rand();
     while  ( n<1 );
     n = n & 0xFF;

     return n;


I would be greateful any one could help me explain why I get this error.

Lars Rosenberg

Sun, 07 Dec 2003 10:02:05 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Differentiate LIB file for static library and LIB file for DLL

2. Linking problem: missing .lib file from dll project

3. Problems w/LIB.EXE and link .LIB files...

4. importing a c++ class from a dll without linking with the dll's lib file

5. Dump Entry Points In .LIB files or .DLL Files

6. Linking dll files to LIB files

7. Creation of lib file from dll file

8. Using a DLL file that comes without a LIB file

9. Making a static LIB files instead of DLL files

10. Looking for info on LIB and DLL files

11. Converting DLL into a LIB file

12. Lib file for dll contains underscore in front of names


Powered by phpBB® Forum Software