Click here to Skip to main content
15,896,730 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hungarian Notation Pin
Rick York4-Jun-03 6:20
mveRick York4-Jun-03 6:20 
GeneralRe: Hungarian Notation Pin
Ranjan Banerji4-Jun-03 6:33
Ranjan Banerji4-Jun-03 6:33 
GeneralRe: Clickety Pin
Kant4-Jun-03 6:51
Kant4-Jun-03 6:51 
GeneralRe: Clickety Pin
Ranjan Banerji4-Jun-03 6:54
Ranjan Banerji4-Jun-03 6:54 
GeneralRe: Clickety Pin
J. Dunlap4-Jun-03 7:44
J. Dunlap4-Jun-03 7:44 
GeneralRe: Clickety Pin
Kant4-Jun-03 7:45
Kant4-Jun-03 7:45 
QuestionShowing messages when no user logged on? Pin
tyzh4-Jun-03 4:15
tyzh4-Jun-03 4:15 
GeneralConverting a pointer to a C# type Pin
Jason Henderson4-Jun-03 4:14
Jason Henderson4-Jun-03 4:14 
I'm messing around with VS Add-ins and the debugger and I have this VC7 app I'm debugging. To make a long story short, I'm trying to find the value of an Expression in the debugger. The variable is a char* and the Expression value is the pointer value of that char* converted to a string (ex. "0x#####").

So how can I take that Expression value ("0xWhatever"), convert it to an Int32 and then actually get the string value out of it and copy it to a C# string?

static unsafe string GetStringExpressionValue(Expression expr)
{
	string strValue = "";

	if (expr.IsValidValue)
	{
		if (expr.Type == "char *")
		{
			char * chrPtr = (char *)(Convert.ToInt32(expr.Value));
			// WHAT NOW???  Or am I on the wrong track?
			MessageBox.Show(expr.Name + " = " + expr.Value);
		}
		else
			MessageBox.Show(expr.Name + " is not a string variable.");
	}
	else
		MessageBox.Show("Expression was not valid");

	return strValue;
}


Jason Henderson

My articles

"The best argument against democracy is a five-minute conversation with the average voter." - Winston Churchill


GeneralRe: Converting a pointer to a C# type Pin
Ranjan Banerji4-Jun-03 6:39
Ranjan Banerji4-Jun-03 6:39 
GeneralRe: Converting a pointer to a C# type Pin
Jason Henderson4-Jun-03 9:30
Jason Henderson4-Jun-03 9:30 
GeneralRe: Converting a pointer to a C# type Pin
Ranjan Banerji4-Jun-03 9:37
Ranjan Banerji4-Jun-03 9:37 
GeneralRe: Converting a pointer to a C# type Pin
leppie4-Jun-03 16:48
leppie4-Jun-03 16:48 
GeneralRe: Converting a pointer to a C# type Pin
Jason Henderson4-Jun-03 17:08
Jason Henderson4-Jun-03 17:08 
GeneralRe: Converting a pointer to a C# type Pin
leppie4-Jun-03 17:32
leppie4-Jun-03 17:32 
GeneralRe: Converting a pointer to a C# type Pin
Jason Henderson5-Jun-03 5:17
Jason Henderson5-Jun-03 5:17 
GeneralRe: Converting a pointer to a C# type Pin
Jim Stewart5-Jun-03 4:01
Jim Stewart5-Jun-03 4:01 
GeneralSwitch Pin
Andy H4-Jun-03 2:43
Andy H4-Jun-03 2:43 
GeneralRe: Switch Pin
Philip Fitzsimons4-Jun-03 2:51
Philip Fitzsimons4-Jun-03 2:51 
GeneralRe: Switch Pin
Bernhard Brieger4-Jun-03 2:56
Bernhard Brieger4-Jun-03 2:56 
QuestionCreating an image mask? Pin
FruitBatInShades4-Jun-03 2:10
FruitBatInShades4-Jun-03 2:10 
AnswerRe: Creating an image mask? Pin
4-Jun-03 3:04
suss4-Jun-03 3:04 
GeneralRe: Creating an image mask? Pin
FruitBatInShades4-Jun-03 11:30
FruitBatInShades4-Jun-03 11:30 
GeneralRe: Creating an image mask? Pin
FruitBatInShades5-Jun-03 0:42
FruitBatInShades5-Jun-03 0:42 
GeneralRe: Creating an image mask? Pin
Valeria Bogdevich5-Jun-03 2:48
Valeria Bogdevich5-Jun-03 2:48 
GeneralUpdateUI Pin
A.Wegierski3-Jun-03 22:42
A.Wegierski3-Jun-03 22:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.