Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

how to store / retrieve IntPtr from registry ?

using C#, i am storing the number as a string (i believe), when i try to read it and cast to IntPtr i get an exception.
any ideas ?
0
Shay050799
Asked:
Shay050799
1 Solution
 
AlexFMCommented:
Please show your code.
0
 
TheAvengerCommented:
You should not cast it, but first convert it to int. Like this:

string strVal = GetValueFromString();

int iVal = Int32.Parse (strVal);
IntPtr ptr = (IntPtr)iVal;
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now