Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IntPtr???

Status
Not open for further replies.

LanceDrolet

Programmer
Apr 11, 2005
3
US
I'm using a 3rd party sound api for an app I've been playing with. I found a .NET wrapper for it, and for the most part, it's great. Here's the problem: One functions has a sig similar to this in the original dll:

void getinfo(char** name, void** value);

The wrapper has this sig as:

void getinfo(ref string name, ref IntPtr value);

So I'm seeing that the IntPtr returns the address of whatever is in value. My questionis: How do I get to the string that IS value??

x = value.ToString(); obviously gives x a string representation of the address of value.... Is there a way to do this??
 
Take a look at Marshal.PtrToStringAnsi and Marshal.Ptr.ToStringUni

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top