473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to do I get a String from an IntPtr? (it's COM related)

I have a structure returned from GetDisplayNameOf (function on IShellFolder
interface), how can I get the String out of the pOleStr IntPtr?
Function GetDisplayNameOf(ByVal pidl As IntPtr, ByVal uFlags As Integer,
ByRef pName As ShellApi.STRRET) As Int32

<StructLayout(LayoutKind.Explicit)> _
Public Structure STRRET
<FieldOffset(0)> Public uType As UInt32 ' One of the STRRET_* values
<FieldOffset(4)> Public pOleStr As IntPtr ' must be freed by caller of
GetDisplayNameOf
<FieldOffset(4)> Public pStr As IntPtr ' NOT USED
<FieldOffset(4)> Public uOffset As UInt32 ' Offset into SHITEMID
<FieldOffset(4)> Public [cStr] As IntPtr ' Buffer to fill in (ANSI)
End Structure 'STRRET
Nov 20 '05 #1
0 808

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Dave Bailey | last post by:
I need to store an encrypted connection string in the web.config file. I have found several examples on the Net but nothing specific as to how to accomplish task. Thanks in advance, Dave
1
by: Jeffrey B. Holtz | last post by:
I'm trying to get the Name of the USB device pluged in from the RegisterDeviceNotification that I've used P/Invoke to marshal. I have seen a similar posting on the VisualBasic newgroups but I do...
1
by: Qingdong Z. | last post by:
How to copy from IntPtr to IntPtr in .NET? Marshal.Copy can't. I don't want to convert one of the IntPtr to managed byte array, because my application is live video related. It is CPU and Memory...
2
by: Bob Dankert | last post by:
I need to use functions through PInvoke which accept and return pointers to strings. What is the best way to get string pointers (IntPtr I am guessing?) to pass into these functions, and the best...
1
by: Vinoth Kumar | last post by:
Hi I am writing a wrapper class for a unmanaged c++ class, which has the method signature, Method(wchar_t** ppszValue) Anyone please tell me, how to convert the string _gc* _gc* to...
7
by: brian_harris | last post by:
I have a string object that I need to convert into an unmanged char * to be used by several unmnaged 3rd party functions. I have tried to use: (Marshal::StringToHGlobalAuto (Profname)) This would...
24
by: Marcus Kwok | last post by:
Hello, I am working on cleaning up some code that I inherited and was wondering if there is anything wrong with my function. I am fairly proficient in standard C++ but I am pretty new to the .NET...
3
by: Delfim Da Costa | last post by:
Hi, I have some problems to use GetPrinterData Win32 API. in fact my problem is : how can get the in a string a buffer known by it's ptr ? Can anybody help me ? Thanks, Delfim.
2
by: Mayur | last post by:
I tried followinf but working fine fo int but how to do it for string using user custome message in c# public static extern int FindWindow(string strClassName,string strWindowName);
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.