Click here to Skip to main content
15,921,113 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow do you attach a dialog resource to tab pages Pin
joshfl14-Jan-03 9:37
joshfl14-Jan-03 9:37 
AnswerRe: how do you attach a dialog resource to tab pages Pin
Nitron15-Jan-03 14:45
Nitron15-Jan-03 14:45 
QuestionHow do I draw a border around text? Pin
clintsinger14-Jan-03 9:29
clintsinger14-Jan-03 9:29 
AnswerRe: How do I draw a border around text? Pin
Chris Losinger14-Jan-03 10:15
professionalChris Losinger14-Jan-03 10:15 
GeneralRe: How do I draw a border around text? Pin
clintsinger14-Jan-03 11:27
clintsinger14-Jan-03 11:27 
GeneralRe: How do I draw a border around text? Pin
Chris Losinger14-Jan-03 12:24
professionalChris Losinger14-Jan-03 12:24 
AnswerRe: How do I draw a border around text? Pin
benjymous14-Jan-03 23:02
benjymous14-Jan-03 23:02 
GeneralSHBrowseForFolder in c code gives->'Release' : is not a member of 'IMalloc' Pin
KoftaMan14-Jan-03 9:19
KoftaMan14-Jan-03 9:19 
I'm working in C and would like to be able to use the SHBrowseForFolder to have a folder browser. I used the following code:

void FolderDialog(HWND hDlg, int msgField)
{
IMalloc * pMalloc;
if ( SHGetMalloc(&pMalloc) == NOERROR )
{
BROWSEINFO bi;
char pszBuffer[MAX_PATH];
LPITEMIDLIST pidl;
bi.hwndOwner = hDlg;
bi.pidlRoot = NULL;
bi.pszDisplayName = pszBuffer;
bi.lpszTitle = "Select Directory";
bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
bi.lParam = 0;
if ((pidl = SHBrowseForFolder(&bi)) != NULL)
{
if (SHGetPathFromIDList(pidl, pszBuffer))
{

SetDlgItemText(hDlg, msgField, pszBuffer);
}
pMalloc->Free(pidl);
}
pMalloc->Release();
}
}

I get the following two errors:

error C2039: 'Free' : is not a member of 'IMalloc'
(846) : see declaration of 'IMalloc'
error C2039: 'Release' : is not a member of 'IMalloc'
(846) : see declaration of 'IMalloc'

If I remove the Free and Release statements the program execute fine but I would rather not have that kinda leakage going on. Any suggestions would be much appreciated.
Thanks

GeneralRe: SHBrowseForFolder in c code gives->'Release' : is not a member of 'IMalloc' Pin
Stefan Pedersen14-Jan-03 9:53
Stefan Pedersen14-Jan-03 9:53 
GeneralRe: SHBrowseForFolder in c code gives->'Release' : is not a member of 'IMalloc' Pin
KoftaMan14-Jan-03 10:00
KoftaMan14-Jan-03 10:00 
GeneralRe: SHBrowseForFolder in c code gives->'Release' : is not a member of 'IMalloc' Pin
KoftaMan14-Jan-03 10:20
KoftaMan14-Jan-03 10:20 
GeneralNULL pView pointer Pin
ns14-Jan-03 8:05
ns14-Jan-03 8:05 
GeneralRe: NULL pView pointer Pin
Paul Belikian14-Jan-03 9:01
Paul Belikian14-Jan-03 9:01 
GeneralRe: NULL pView pointer Pin
ns14-Jan-03 10:09
ns14-Jan-03 10:09 
GeneralRe: NULL pView pointer Pin
ns14-Jan-03 10:11
ns14-Jan-03 10:11 
Generaltried your way but.....??? Pin
ns14-Jan-03 10:19
ns14-Jan-03 10:19 
GeneralRe: tried your way but.....??? Pin
Paul Belikian14-Jan-03 13:00
Paul Belikian14-Jan-03 13:00 
GeneralRe: tried your way but.....??? Pin
ns15-Jan-03 4:45
ns15-Jan-03 4:45 
GeneralFinding the z-order of a window Pin
Chris Sutcliffe14-Jan-03 7:23
sussChris Sutcliffe14-Jan-03 7:23 
GeneralAdding a option to start the program on boot-up.. Pin
RobJones14-Jan-03 7:02
RobJones14-Jan-03 7:02 
GeneralHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Pin
AlexO14-Jan-03 7:31
AlexO14-Jan-03 7:31 
GeneralGetting Unicode key codes into a non-Unicode (MBCS) application Pin
Rob Whapham14-Jan-03 6:46
Rob Whapham14-Jan-03 6:46 
GeneralCustom protocols for WebBrowser controls... Pin
Jamie Hale14-Jan-03 5:26
Jamie Hale14-Jan-03 5:26 
GeneralDynamically adding items to a combo box Pin
lbc14-Jan-03 5:23
lbc14-Jan-03 5:23 
GeneralRe: Dynamically adding items to a combo box Pin
valikac14-Jan-03 9:41
valikac14-Jan-03 9:41 

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.