SHCreateDirectory not found
Hi,
I want to use SHCreateDirectory to create a directory, line C:\D1\D2\D3, etc. but I cannot find it. The compiler gives me the undeclared indentifier (C2065) error. According to MSDN:
Quote:
Minimum DLL Version
shell32.dll version 5.0 or later
Custom Implementation
No
Header
shlobj.h
Import
library shell32.lib
Minimum operating systems
Windows 2000
My shell32.dll version is 6.0.2800.1106, I am running on WinXP, with VisualC++ 6.0, SP6, and of course I include shlobj.h. But the funny thing is that there is no SHCreateDirectory in that header. I searched all the headers on my PC and there is not such method.
What is this?
Re: SHCreateDirectory not found
I think there isn't. :) Try SHCreateDirectoryEx
Re: SHCreateDirectory not found
Download the latest Platfrom SDK from msdn.microsoft.com
Re: SHCreateDirectory not found
Quote:
Originally Posted by PadexArt
I think there isn't. :) Try SHCreateDirectoryEx
So is the case of SHCreateDirectoryEx... What did you think? :rolleyes:
I was hoping to avoid downloading from Microsoft after I saw yesterday "I, Robot". :D :eek: :D
Re: SHCreateDirectory not found
Quote:
Originally Posted by cilu
So is the case of SHCreateDirectoryEx... What did you think? :rolleyes:
True. :blush: I've just checked it and it is missing too. I've pointed it out as SHCreateDirectory doesn't even show up in MSDN Oct 2001.
Re: SHCreateDirectory not found
Quote:
Originally Posted by cilu
So is the case of SHCreateDirectoryEx... What did you think? :rolleyes:
I was hoping to avoid downloading from Microsoft after I saw yesterday "I, Robot". :D :eek: :D
Then forward declare it and use LoadLibrary(...)/GetProcAddress(...)
Re: SHCreateDirectory not found
Quote:
Originally Posted by Mick
Then forward declare it and use LoadLibrary(...)/GetProcAddress(...)
Well Mick, now you're coming with something... :D Thanks. I will do that. :thumb:
Re: SHCreateDirectory not found
(LPCWSTR)L"C:\\D1\\D2\\D3"
Re: SHCreateDirectory not found
Yeah... forgot about it... Thanks again, Mick. :thumb:
Re: SHCreateDirectory not found
I had the same issue with ERROR_BAD_PATHNAME, and this thread fixed it, but I am curious... what does the L in the following line do? Why was it so important?
Code:
(LPCWSTR)L"C:\\D1\\D2\\D3"
Re: SHCreateDirectory not found
Quote:
Originally Posted by esandegren
I had the same issue with ERROR_BAD_PATHNAME, and this thread fixed it, but I am curious... what does the L in the following line do? Why was it so important?
Code:
(LPCWSTR)L"C:\\D1\\D2\\D3"
that means that it will call the SHCreateDirectoryW api (the unicode one) and not the SHCreateDirectoryA (which is the ascii one)
Cheers
Re: SHCreateDirectory not found
Quote:
Originally Posted by
golanshahar
that means that it will call the SHCreateDirectoryW api (the unicode one) and not the SHCreateDirectoryA (which is the ascii one)
Cheers
Point of Order...
It's actually ANSI not ASCII. I know I'm late to this again.
Re: SHCreateDirectory not found
Quote:
Originally Posted by
TheMickSter
... I know I'm late to this again.
Exactly! About 17 years too late... :eek:
Re: SHCreateDirectory not found
I am getting this error when I compile my code.
I had already included the function SHGetFolderPath
sucessfully, but when I added SHCreateDirectory(NULL, p_path)
it stopped compiling. I have the following headers
#include <windows.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include "Format.h"
#include <wchar.h>
#include <stdio.h>
#include <shlwapi.h> // for SHGetFolderPath function
#include <shlobj.h> // for SHGetFolderPath and SHCreateDirectory function
//*************************************************************************************************************************
#pragma comment(lib, "shlwapi")
#pragma comment(lib, "shell32")
Any suggestions?