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. managed code strange behaviour..

managed code strange behaviour..

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiocryptographyhelpquestion
3 Posts 2 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.
  • M Offline
    M Offline
    montiee
    wrote on last edited by
    #1

    I have a MFC app, within it I use SHA1CryptoServiceProvider() which is managed code. Now if I launch the app from within the IDE (via F5) it all runs nicely. However if I open up explorer and launch it through that it seems all my SHA1 calculations (computeHash()) fail. Everything else about the app works as expected except the hash checking. I'm taking a guess here but I'm almost certain it has to do with integration of unmanaged and managed code. Why is launching it from within the IDE so different than launching it outside of the IDE. What am I missing? Have I forgotten to load something (dll?) that gets automatically loaded from with the IDE. Any help much appreciated. I'm completely stumped.

    L 1 Reply Last reply
    0
    • M montiee

      I have a MFC app, within it I use SHA1CryptoServiceProvider() which is managed code. Now if I launch the app from within the IDE (via F5) it all runs nicely. However if I open up explorer and launch it through that it seems all my SHA1 calculations (computeHash()) fail. Everything else about the app works as expected except the hash checking. I'm taking a guess here but I'm almost certain it has to do with integration of unmanaged and managed code. Why is launching it from within the IDE so different than launching it outside of the IDE. What am I missing? Have I forgotten to load something (dll?) that gets automatically loaded from with the IDE. Any help much appreciated. I'm completely stumped.

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Your post is confusing

      jbem wrote:

      I use SHA1CryptoServiceProvider() which is managed code

      There are no functions that are managed code. Perhaps you can post the code and link to the MSDN documentation[^] for what you are using. That way we can be clear what you are doing.

      led mike

      M 1 Reply Last reply
      0
      • L led mike

        Your post is confusing

        jbem wrote:

        I use SHA1CryptoServiceProvider() which is managed code

        There are no functions that are managed code. Perhaps you can post the code and link to the MSDN documentation[^] for what you are using. That way we can be clear what you are doing.

        led mike

        M Offline
        M Offline
        montiee
        wrote on last edited by
        #3

        Never mind. I meant CLI integration with .net etc. In any event I ripped out the CRT requirement I imposed on myself by using MS's .net crypto services, in so doing nearly halfed my executable size and replaced the functionality with some native C++. In the end the problem wasn't what I thought. I tracked it down to one uninitialized variable. For whatever reason in the IDE it ran fine but outside it didn't. The wonders of random variable values..

        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