Solved

how to store / retrieve IntPtr from registry ?

Posted on 2004-03-31
2
313 Views
Last Modified: 2006-11-17
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
Comment
Question by:Shay050799
2 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 10730238
Please show your code.
0
 
LVL 20

Accepted Solution

by:
TheAvenger earned 50 total points
ID: 10730827
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question