Click here to Skip to main content
15,905,776 members
Home / Discussions / COM
   

COM

 
GeneralRe: complier error:...undefined class 'ATL_NO_VTABLE Pin
Abhi Lahare6-Feb-04 3:28
Abhi Lahare6-Feb-04 3:28 
QuestionHow can i get properties of com object dynamically Pin
Inam5-Feb-04 19:47
Inam5-Feb-04 19:47 
AnswerRe: How can i get properties of com object dynamically Pin
Mike Dimmick6-Feb-04 3:23
Mike Dimmick6-Feb-04 3:23 
GeneralRe: How can i get properties of com object dynamically Pin
Inam7-Feb-04 7:20
Inam7-Feb-04 7:20 
GeneralCommercial ActiveX Control - ClistCtrl/CListView Pin
Charles Roderick4-Feb-04 5:10
Charles Roderick4-Feb-04 5:10 
GeneralRe: Commercial ActiveX Control - ClistCtrl/CListView Pin
Jörgen Sigvardsson9-Feb-04 9:59
Jörgen Sigvardsson9-Feb-04 9:59 
GeneralRe: Commercial ActiveX Control - ClistCtrl/CListView Pin
Charles Roderick9-Feb-04 12:08
Charles Roderick9-Feb-04 12:08 
GeneralSHGetPathFromIDList - Problem Pin
Tristan Rhodes4-Feb-04 3:53
Tristan Rhodes4-Feb-04 3:53 
I'm trying to get a file path from a pointer to a PIDL.


This is using the following function:

BOOL SHGetPathFromIDList(
LPCITEMIDLIST pidl,
LPTSTR pszPath
);

where pidl is an IntPtr to a pidl pulled from the SHBrowseForFolder.

I am using the following lines of code to call it:

<br />
			IntPtr pidl = SHBrowseForFolder(lpbi);<br />
			string filePath = new string(' ', 200);<br />
			SHGetPathFromIDList(pidl,out filePath);<br />


via the wrapped method:

<br />
		[DllImport("shell32.dll", CharSet=CharSet.Auto)]<br />
		public static extern int SHGetPathFromIDList(<br />
			IntPtr pidl,<br />
			[Out, MarshalAs(UnmanagedType.BStr)]<br />
				out string pszPath); <br />


The problem is that while pidl has a value, the method crashes when I try and interpret a file / folder greater than 1 depth.
And if it does not crash, I get the unmodified string returned to me.

Any ideas what I'm doing wrong?

Cheers

Cata


Edit: I suppose the question is - How do I construct a buffer of size Max_Path, and then create a pointer to it?
GeneralSolved Pin
Tristan Rhodes4-Feb-04 10:55
Tristan Rhodes4-Feb-04 10:55 
GeneralRe: SHGetPathFromIDList - Problem Pin
Mike Dimmick5-Feb-04 0:58
Mike Dimmick5-Feb-04 0:58 
GeneralSHBrowseForFolder problem Pin
Tristan Rhodes4-Feb-04 1:19
Tristan Rhodes4-Feb-04 1:19 
GeneralRe: SHBrowseForFolder problem Pin
Tristan Rhodes4-Feb-04 2:01
Tristan Rhodes4-Feb-04 2:01 
GeneralPartial Solution Pin
Tristan Rhodes4-Feb-04 2:55
Tristan Rhodes4-Feb-04 2:55 
GeneralMethod overloading Pin
Anonymous3-Feb-04 4:19
Anonymous3-Feb-04 4:19 
GeneralRe: Method overloading Pin
Steve S3-Feb-04 22:55
Steve S3-Feb-04 22:55 
GeneralRe: Method overloading Pin
Anonymous4-Feb-04 0:03
Anonymous4-Feb-04 0:03 
GeneralPaste img from any application like Paint, Ms Photoeditor,etc Pin
Filomela2-Feb-04 20:47
Filomela2-Feb-04 20:47 
Questionhow to use ActiveX contrl listview and imagelist in mscomctl.ocx Pin
Dababa2-Feb-04 14:29
Dababa2-Feb-04 14:29 
GeneralParameter in ActiveX control Pin
TrungHuynh1-Feb-04 19:43
TrungHuynh1-Feb-04 19:43 
GeneralRe: Parameter in ActiveX control Pin
Steve S2-Feb-04 4:23
Steve S2-Feb-04 4:23 
GeneralRe: Parameter in ActiveX control Pin
TrungHuynh2-Feb-04 14:30
TrungHuynh2-Feb-04 14:30 
GeneralRe: Parameter in ActiveX control Pin
Steve S2-Feb-04 22:07
Steve S2-Feb-04 22:07 
GeneralRe: Parameter in ActiveX control Pin
TrungHuynh2-Feb-04 22:25
TrungHuynh2-Feb-04 22:25 
GeneralRe: Parameter in ActiveX control Pin
Steve S3-Feb-04 0:18
Steve S3-Feb-04 0:18 
GeneralRe: Parameter in ActiveX control Pin
TrungHuynh3-Feb-04 14:44
TrungHuynh3-Feb-04 14:44 

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.