LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

from path to ITEMIDLIST

hello,

I have no idea to convert that code to labview, could someone help me.
Is it possible only by code library function.
I like to use only shell32.dll

the shparse is hopefully correct and attached
LPSHELLFOLDER pShellFolder = NULL;
HRESULT hr;
ULONG chUsed;
// Get desktop IShellFolder interface
if (SHGetDesktopFolder (&pShellFolder) != NOERROR)
return FALSE; // failed



// convert the path to an ITEMIDLIST
hr = pShellFolder->ParseDisplayName (
NULL, // owner window
NULL, // reserved (must be NULL)
lpszPath, // folder name
&chUsed, // number of chars parsed
lpItemIdList, // ITEMIDLIST
NULL // attributes (can be NULL)
);

Best regards   Hepman
0 Kudos
Message 1 of 4
(4,172 Views)
You have the right way in Labview with including this with call library function node.
 
We have no direct support for that but you can find your answer in the msdn from Microsoft
 
For the rest you must look in http://msdn2.microsoft.com/
 
 
SHGetDesktopFolder Function

Retrieves the IShellFolder interface for the desktop folder, which is the root of the Shell's namespace.

Syntax

HRESULT SHGetDesktopFolder(          IShellFolder **ppshf
);

Parameters

ppshf
Address that receives an IShellFolder interface pointer for the desktop folder. The calling application is responsible for eventually freeing the interface by calling its IUnknown::Release method.

Return Value

Returns NOERROR if successful, or an OLE-defined error result otherwise.


 

0 Kudos
Message 2 of 4
(4,144 Views)
Search in www.google.de for SHGetDesktopFolder example
 
 
#include <shlobj.h>
#include <shlwapi.h>


main()
{
IShellFolder *psfDeskTop = NULL;
IShellFolder *psfDocFiles = NULL;
IMalloc *pMalloc = NULL;
LPITEMIDLIST pidlDocFiles = NULL;
LPITEMIDLIST pidlItems = NULL;
IEnumIDList *ppenum = NULL;
SHFILEOPSTRUCT sfo;
STRRET strDispName;
TCHAR szParseName[MAX_PATH];
TCHAR szSourceFiles[256];
int i;
int iBufPos = 0;
ULONG chEaten;
ULONG celtFetched;
HRESULT hr;

szSourceFiles[0] = '\0';
hr = SHGetMalloc(&pMalloc);
hr = SHGetDesktopFolder(&psfDeskTop);

hr = psfDeskTop->ParseDisplayName(NULL, NULL, L"c:\\My_Docs",
&chEaten, &pidlDocFiles, NULL);
hr = psfDeskTop->BindToObject(pidlDocFiles, NULL, IID_IShellFolder,
(LPVOID *) &psfDocFiles);
hr = psfDeskTop->Release();

hr = psfDocFiles->EnumObjects(NULL,SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
&ppenum);

while( (hr = ppenum->Next(1,&pidlItems, &celtFetched)) == S_OK
&& (celtFetched) == 1)
{
psfDocFiles->GetDisplayNameOf(pidlItems, SHGDN_FORPARSING,
&strDispName);
StrRetToBuf(&strDispName, pidlItems, szParseName, MAX_PATH);
for(i=0;i<=lstrlen(szParseName); i++)
{
szSourceFiles[iBufPos++] = szParseName[i];
}
pMalloc->Free(pidlItems);
}
ppenum->Release();

szSourceFiles[iBufPos] = '\0';

sfo.hwnd = NULL;
sfo.wFunc = FO_COPY;
sfo.pFrom = szSourceFiles;
sfo.pTo = "c:\\My_Docs2\0";
sfo.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR;

hr = SHFileOperation(&sfo);

SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH, (LPCVOID) "c:\\My_Docs2", 0);

pMalloc->Free(pidlDocFiles);
psfDocFiles->Release();

return 0;
}
0 Kudos
Message 3 of 4
(4,143 Views)
So you can use Code Interface Node or Create C file in Call Library Node and use a *.c file from the Internet...
0 Kudos
Message 4 of 4
(4,141 Views)