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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Code-Generation Setting

Code-Generation Setting

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++sysadminwindows-adminai-coding
10 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
    gothic_coder
    wrote on last edited by
    #1

    Hello All, I made an API Hook using mHook Library and successfully hooking NtSetInformationFile , I then made an DLL which loads the DLL into the process using CreateRemoteThread, It's working fine in my PC, But when checked on windows server 2003(32 bit) the application won't start and gives me the message that "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem." . Now i googled about the error and found so many answers, One of them was to check the "Code generation" setting under C/C++ property, if it is Multi-Threaded DLL (/MD) then change to Multi-Threaded (/MT) , Changing the setting works in windows server 2003, But now the problem is when i recompile my code with (/MT) the anti virus won't let me build the exe and delete the exe, I can only build and run the exe after i uninstall or stop the anti-virus. Could anyone throw some light on this problem. Thanks

    S 1 Reply Last reply
    0
    • G gothic_coder

      Hello All, I made an API Hook using mHook Library and successfully hooking NtSetInformationFile , I then made an DLL which loads the DLL into the process using CreateRemoteThread, It's working fine in my PC, But when checked on windows server 2003(32 bit) the application won't start and gives me the message that "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem." . Now i googled about the error and found so many answers, One of them was to check the "Code generation" setting under C/C++ property, if it is Multi-Threaded DLL (/MD) then change to Multi-Threaded (/MT) , Changing the setting works in windows server 2003, But now the problem is when i recompile my code with (/MT) the anti virus won't let me build the exe and delete the exe, I can only build and run the exe after i uninstall or stop the anti-virus. Could anyone throw some light on this problem. Thanks

      S Offline
      S Offline
      ShilpiP
      wrote on last edited by
      #2

      Do not change the property to multithreaded. Please follow the steps: 1) Go to Project Menu -> Properties 2) Select Configuration Properties ->general There are two properties Use of MFC :if you have "Use MFC in a Shared DLL" than change this property to "Use MFC in a Static Library". Use of ATL :if you have "Dynamic Link to ATL" than change this property to "Static Link to ATL". than check. :)

      Yes U Can ...If U Can ,Dream it , U can do it ...ICAN

      G R 2 Replies Last reply
      0
      • S ShilpiP

        Do not change the property to multithreaded. Please follow the steps: 1) Go to Project Menu -> Properties 2) Select Configuration Properties ->general There are two properties Use of MFC :if you have "Use MFC in a Shared DLL" than change this property to "Use MFC in a Static Library". Use of ATL :if you have "Dynamic Link to ATL" than change this property to "Static Link to ATL". than check. :)

        Yes U Can ...If U Can ,Dream it , U can do it ...ICAN

        G Offline
        G Offline
        gothic_coder
        wrote on last edited by
        #3

        The value under "Use of ATL" is "Not Using ATL"

        S 1 Reply Last reply
        0
        • G gothic_coder

          The value under "Use of ATL" is "Not Using ATL"

          S Offline
          S Offline
          ShilpiP
          wrote on last edited by
          #4

          If your setting is "Not using ATL" than dont change the setting if your setting is "Dynamic Link to ATL" than change it to "Static link to ATL" and what about MFC setting.

          Yes U Can ...If U Can ,Dream it , U can do it ...ICAN

          G 1 Reply Last reply
          0
          • S ShilpiP

            If your setting is "Not using ATL" than dont change the setting if your setting is "Dynamic Link to ATL" than change it to "Static link to ATL" and what about MFC setting.

            Yes U Can ...If U Can ,Dream it , U can do it ...ICAN

            G Offline
            G Offline
            gothic_coder
            wrote on last edited by
            #5

            MFC Setting is "Use Standard Windows Libraries"

            S 1 Reply Last reply
            0
            • G gothic_coder

              MFC Setting is "Use Standard Windows Libraries"

              S Offline
              S Offline
              ShilpiP
              wrote on last edited by
              #6

              I am not sure please change the settings of "Use Standard Windows Library" to "Use MFC in a Static Library" and compile. if u receive any error of start up than update the setting of Linker Entry point and than check if it is working fine.

              Yes U Can ...If U Can ,Dream it , U can do it ...ICAN

              G 1 Reply Last reply
              0
              • S ShilpiP

                I am not sure please change the settings of "Use Standard Windows Library" to "Use MFC in a Static Library" and compile. if u receive any error of start up than update the setting of Linker Entry point and than check if it is working fine.

                Yes U Can ...If U Can ,Dream it , U can do it ...ICAN

                G Offline
                G Offline
                gothic_coder
                wrote on last edited by
                #7

                I added msvcrt.lib and it's working :)

                S 1 Reply Last reply
                0
                • G gothic_coder

                  I added msvcrt.lib and it's working :)

                  S Offline
                  S Offline
                  ShilpiP
                  wrote on last edited by
                  #8

                  Thats Gr8 :)

                  Yes U Can ...If U Can ,Dream it , U can do it ...ICAN

                  1 Reply Last reply
                  0
                  • S ShilpiP

                    Do not change the property to multithreaded. Please follow the steps: 1) Go to Project Menu -> Properties 2) Select Configuration Properties ->general There are two properties Use of MFC :if you have "Use MFC in a Shared DLL" than change this property to "Use MFC in a Static Library". Use of ATL :if you have "Dynamic Link to ATL" than change this property to "Static Link to ATL". than check. :)

                    Yes U Can ...If U Can ,Dream it , U can do it ...ICAN

                    R Offline
                    R Offline
                    Rick York
                    wrote on last edited by
                    #9

                    You, sir, are tied for having the world's lamest signature.

                    G 1 Reply Last reply
                    0
                    • R Rick York

                      You, sir, are tied for having the world's lamest signature.

                      G Offline
                      G Offline
                      gothic_coder
                      wrote on last edited by
                      #10

                      Who me??

                      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