Thread: dll question

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    71

    dll question

    Hi

    In my programm I use an external dll (OpenSSL).
    In the property pages under Configuration Properties-Linker-Input I put ssleay32.lib and libeay32.lib in the Additional Dependencies. And in my programm I use some include lines to include the header files I need from the Open SSL.

    In my programm the user has an option to choose between "use SSL" or "don't use SSL".

    My problem is now lets say the user hasen't got these OpenSSL dlls, then my programm should work without SSL. But if these dlls are not in the system32 directory the programm don't start. No error message nothing it just didn't start. Is there a possibility to start my programm even if these dlls are not available (then without SSL support). I know from some programms that it must be possible but I don't know how.


    And the second thing is I use another dll to decrypt some strings in my programm (Cryptlib project). This is a dll too like the SSL dlls but when I run my programm you don't need this dll. It seems that all functions of the Cryptlib dll get inserted to my programm, but the SSL functions I use are just linked to the dll?

    It would be great when the SSL stuff get inserted in my programm like the Cryptlib things, or if that isn't possible that my programm run nevertheless even if the SSL dlls are not available.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    you can load the dll dymanically with LoadLibrary and then find the function you need with GetProcAddress.
    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
    Feb 2006
    Posts
    71
    Quote Originally Posted by Sebastiani
    you can load the dll dymanically with LoadLibrary and then find the function you need with GetProcAddress.
    Hmm why the programm work without the Cryptlib dll and offers the user the functions, but don't even start when the SSL dlls are not available?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. Dll Injection Question
    By zenox in forum C Programming
    Replies: 13
    Last Post: 03-15-2008, 10:54 AM
  3. dll and classes question
    By Rune Hunter in forum C++ Programming
    Replies: 2
    Last Post: 12-17-2005, 09:26 PM
  4. C++ .NET - "inconsistent dll linkage" - What's that?
    By BrianK in forum Windows Programming
    Replies: 2
    Last Post: 03-16-2004, 10:16 AM
  5. Calling a VB DLL w/ forms from C++ DLL
    By UW_COOP in forum C++ Programming
    Replies: 8
    Last Post: 06-30-2003, 08:04 AM