Click here to Skip to main content
16,011,608 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPlease help with memory leak Pin
Craig Miller12-Sep-01 8:53
Craig Miller12-Sep-01 8:53 
GeneralRe: Please help with memory leak Pin
Tim Deveaux12-Sep-01 9:26
Tim Deveaux12-Sep-01 9:26 
GeneralRe: Please help with memory leak Pin
Craig Miller12-Sep-01 10:30
Craig Miller12-Sep-01 10:30 
GeneralRe: Please help with memory leak Pin
Tim Deveaux12-Sep-01 11:05
Tim Deveaux12-Sep-01 11:05 
QuestionHow can i register a .dll or .ocx file in my program similar register it using regsvr32.exe? Pin
12-Sep-01 4:37
suss12-Sep-01 4:37 
AnswerRe: How can i register a .dll or .ocx file in my program similar register it using regsvr32.exe? Pin
12-Sep-01 4:41
suss12-Sep-01 4:41 
AnswerRe: How can i register a .dll or .ocx file in my program similar register it using regsvr32.exe? Pin
Ben M. Stokland12-Sep-01 4:56
Ben M. Stokland12-Sep-01 4:56 
GeneralSHGetSpecialFolderLocation error !!! Pin
Fredb4512-Sep-01 4:09
Fredb4512-Sep-01 4:09 
I want to retrieve icon like "my documents" in explorer but ...

My init function:


CShellUtil::CShellUtil()
{
SHFILEINFO shFinfo;
HIMAGELIST hImgList = NULL;
LPITEMIDLIST itemlist = 0;

bError=FALSE;
if (SHGetSpecialFolderLocation(0,
SIDL_DESKTOP , &itemlist) == NOERROR)
{
hImgList = (HIMAGELIST)SHGetFileInfo((LPCTSTR)
itemlist, 0, &shFinfo,
sizeof(shFinfo ),
SHGFI_SYSICONINDEX |
SHGFI_PIDL |
SHGFI_SMALLICON );

if(!hImgList)
{
bError=TRUE;
return;
}
m_SysImgList.m_hImageList=hImgList;
}
else
{
bError=TRUE;
return;
}


Function to display icon into Tree

HTREEITEM CShellUtil::AddSpecialItem(HTREEITEM hParent, int nFolder)
{
SHFILEINFO shFinfo;
int iIcon;
BOOL bIsCDROM=FALSE;
HTREEITEM hItem;
LPITEMIDLIST pIDL;
LPMALLOC pMem;

if(SHGetSpecialFolderLocation(NULL, nFolder, &pIDL) == NOERROR)
{
if(SHGetFileInfo((LPCTSTR)pIDL, 0, &shFinfo, sizeof(shFinfo),
SHGFI_DISPLAYNAME | SHGFI_PIDL |
SHGFI_ICON | SHGFI_SMALLICON))
{
if(SHGetMalloc(&pMem)==NOERROR)
{
pMem->Free(pIDL);
pMem->Release();
}
}
}

Icon = shFinfo.iIcon;
hItem=m_TreeCtrl.InsertItem(_T("Test"), iIcon, iIcon, hParent);

return hItem;
}

When i call 'AddSpecialItem', it's OK to insert special folder
from "CSIDL_DESKTOP" to "CSIDL_STARTMENU" and
from "CSIDL_DESKTOPDIRECTORY" to "CSIDL_LOCAL_APPDATA"-> DislplayName and Icon are OK

But there is a problem from "CSIDL_MYDOCUMENTS" to "CSIDL_MYVIDEO"
No icon and no display name and SHGetSpecialFolderLocation(..) return an error
I try with

if(SHGetFolderLocation(NULL, nFolder, NULL, 0, &pIDL) == S_OK)

but no success (return E_INVALIDARG)


I use lib from microsoft SDK august 2001 on win2000 Sp2 plateform with visual sp5

Please help
GeneralWrite some short options into EXE Pin
12-Sep-01 3:57
suss12-Sep-01 3:57 
GeneralRe: Write some short options into EXE Pin
Derek Waters12-Sep-01 14:03
Derek Waters12-Sep-01 14:03 
GeneralRe: Write some short options into EXE Pin
12-Sep-01 18:05
suss12-Sep-01 18:05 
QuestionHow to access Access Base in VC++6.0 Pin
12-Sep-01 3:27
suss12-Sep-01 3:27 
AnswerRe: How to access Access Base in VC++6.0 Pin
Martin Ziacek12-Sep-01 3:46
Martin Ziacek12-Sep-01 3:46 
AnswerRe: How to access Access Base in VC++6.0 Pin
Carlos Antollini12-Sep-01 3:49
Carlos Antollini12-Sep-01 3:49 
Generalunknow output debbug message Pin
12-Sep-01 3:17
suss12-Sep-01 3:17 
GeneralRe: unknow output debbug message Pin
Tomasz Sowinski12-Sep-01 3:26
Tomasz Sowinski12-Sep-01 3:26 
GeneralRe: unknow output debbug message Pin
Carlos Antollini12-Sep-01 3:43
Carlos Antollini12-Sep-01 3:43 
GeneralRe: unknow output debbug message Pin
Rashid Thadha12-Sep-01 5:36
Rashid Thadha12-Sep-01 5:36 
GeneralRe: unknow output debbug message Pin
12-Sep-01 6:15
suss12-Sep-01 6:15 
GeneralCreateWindow Pin
Nick Armstrong12-Sep-01 3:12
Nick Armstrong12-Sep-01 3:12 
GeneralRe: CreateWindow Pin
12-Sep-01 3:20
suss12-Sep-01 3:20 
GeneralRe: CreateWindow Pin
Nick Armstrong12-Sep-01 3:38
Nick Armstrong12-Sep-01 3:38 
GeneralRe: CreateWindow Pin
Steen Krogsgaard12-Sep-01 4:19
Steen Krogsgaard12-Sep-01 4:19 
GeneralRe: CreateWindow Pin
Nick Armstrong12-Sep-01 5:01
Nick Armstrong12-Sep-01 5:01 
GeneralRe: CreateWindow Pin
Carlos Antollini12-Sep-01 3:34
Carlos Antollini12-Sep-01 3:34 

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.