Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. problem when using (detours lib) SetDll.exe to Add a dll to an exe file.

problem when using (detours lib) SetDll.exe to Add a dll to an exe file.

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gogosai
    wrote on last edited by
    #1

    I use MFC to build a win32 Dynimic-link library. Then I get a bb.dll.I use SetDll.exe to add bb.dll to gogosai.exe.When I choose A simple DLL project to build the dll,It does not work.When I choose A dll is exports some symbols project to build,It works. Why???

    N 2 Replies Last reply
    0
    • G gogosai

      I use MFC to build a win32 Dynimic-link library. Then I get a bb.dll.I use SetDll.exe to add bb.dll to gogosai.exe.When I choose A simple DLL project to build the dll,It does not work.When I choose A dll is exports some symbols project to build,It works. Why???

      N Offline
      N Offline
      Nitheesh George
      wrote on last edited by
      #2

      Hi, From your posting it is not clear what you want to achieve. Please be specific and state clearly your actual problem. Nitheesh George http://www.simpletools.co.in

      1 Reply Last reply
      0
      • G gogosai

        I use MFC to build a win32 Dynimic-link library. Then I get a bb.dll.I use SetDll.exe to add bb.dll to gogosai.exe.When I choose A simple DLL project to build the dll,It does not work.When I choose A dll is exports some symbols project to build,It works. Why???

        N Offline
        N Offline
        Nitheesh George
        wrote on last edited by
        #3

        Hi, After reading your posting 3 times, i think that you wanted to a dll reference to another project, right?. If so, when you create a dll project with some export functions the IDE adds the exporting function as like extern "C" __declspec(dllexport) void myFunc() { } This tells the C++ complier not to use name mangling. So you can use LoadLbrary to get a pointer to this function in this dll like HMODULE hMod = LoadLibrary("MyDlLL.dll"); GetProcAddress(hMod, "MyFunc"); this works well you specify extern "C"(Please see MSDN to know more about this). For a dll that doesn't exports any functions/class don't allow accessing the its functions or classes. If you don't wish to use the loadLibrary u can do the following steps to add a reference to a dll. 1. Mark the class as exported (__declspec(dllexport) class classA) 1. add the header file of the dll you want to refer. 2. Add the lib file of the dll to the linker options(Additional dependencies) of your project. 3. Make sure that you specify the path to lib correctly. 3. compile. Hopes this helps. Nitheesh George http://www.simpletools.co.in

        G A 2 Replies Last reply
        0
        • N Nitheesh George

          Hi, After reading your posting 3 times, i think that you wanted to a dll reference to another project, right?. If so, when you create a dll project with some export functions the IDE adds the exporting function as like extern "C" __declspec(dllexport) void myFunc() { } This tells the C++ complier not to use name mangling. So you can use LoadLbrary to get a pointer to this function in this dll like HMODULE hMod = LoadLibrary("MyDlLL.dll"); GetProcAddress(hMod, "MyFunc"); this works well you specify extern "C"(Please see MSDN to know more about this). For a dll that doesn't exports any functions/class don't allow accessing the its functions or classes. If you don't wish to use the loadLibrary u can do the following steps to add a reference to a dll. 1. Mark the class as exported (__declspec(dllexport) class classA) 1. add the header file of the dll you want to refer. 2. Add the lib file of the dll to the linker options(Additional dependencies) of your project. 3. Make sure that you specify the path to lib correctly. 3. compile. Hopes this helps. Nitheesh George http://www.simpletools.co.in

          G Offline
          G Offline
          gogosai
          wrote on last edited by
          #4

          Thanks.

          1 Reply Last reply
          0
          • N Nitheesh George

            Hi, After reading your posting 3 times, i think that you wanted to a dll reference to another project, right?. If so, when you create a dll project with some export functions the IDE adds the exporting function as like extern "C" __declspec(dllexport) void myFunc() { } This tells the C++ complier not to use name mangling. So you can use LoadLbrary to get a pointer to this function in this dll like HMODULE hMod = LoadLibrary("MyDlLL.dll"); GetProcAddress(hMod, "MyFunc"); this works well you specify extern "C"(Please see MSDN to know more about this). For a dll that doesn't exports any functions/class don't allow accessing the its functions or classes. If you don't wish to use the loadLibrary u can do the following steps to add a reference to a dll. 1. Mark the class as exported (__declspec(dllexport) class classA) 1. add the header file of the dll you want to refer. 2. Add the lib file of the dll to the linker options(Additional dependencies) of your project. 3. Make sure that you specify the path to lib correctly. 3. compile. Hopes this helps. Nitheesh George http://www.simpletools.co.in

            A Offline
            A Offline
            Albert Holguin
            wrote on last edited by
            #5

            i'm surprised you read it that many times! ...i give up on the first try...if i can't read it, i won't try to answer it...lol ...you're a lot kinder... :thumbsup:

            N 1 Reply Last reply
            0
            • A Albert Holguin

              i'm surprised you read it that many times! ...i give up on the first try...if i can't read it, i won't try to answer it...lol ...you're a lot kinder... :thumbsup:

              N Offline
              N Offline
              Nitheesh George
              wrote on last edited by
              #6

              Thank you Albert :) Nitheesh George http://www.simpletools.co.in

              A 1 Reply Last reply
              0
              • N Nitheesh George

                Thank you Albert :) Nitheesh George http://www.simpletools.co.in

                A Offline
                A Offline
                Albert Holguin
                wrote on last edited by
                #7

                you get my 5 just for trying that hard to help someone! :)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups