Click here to Skip to main content
15,917,795 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNewbie help, API Pin
bob_0003-Apr-03 1:26
bob_0003-Apr-03 1:26 
GeneralRe: Newbie help, API Pin
Mike Upton3-Apr-03 4:53
Mike Upton3-Apr-03 4:53 
GeneralImage attributes (eps and cgm) Pin
vandaley3-Apr-03 0:44
vandaley3-Apr-03 0:44 
QuestionHow can I find a win32 version of lex? Pin
xiaochnegwx3-Apr-03 0:24
xiaochnegwx3-Apr-03 0:24 
AnswerRe: How can I find a win32 version of lex? Pin
Johnny ²3-Apr-03 0:46
Johnny ²3-Apr-03 0:46 
QuestionHow to create a directory Pin
Anonymous2-Apr-03 23:39
Anonymous2-Apr-03 23:39 
AnswerRe: How to create a directory Pin
Joan M2-Apr-03 23:56
professionalJoan M2-Apr-03 23:56 
AnswerRe: How to create a directory Pin
Philip Patrick3-Apr-03 0:14
professionalPhilip Patrick3-Apr-03 0:14 
::CreateDirectory will do the work if you already have a parent directory. If you want to create a directory "sequence" (e.g. parent doesn't have to exist), here is an example of such function:
bool CreateDirectorySeq(IN LPCTSTR lpszDirPath)
{
	TCHAR szShorterPath[MAX_PATH];
	TCHAR szDirectory[MAX_PATH];
	if(!CreateDirectory(lpszDirPath, NULL)){
		_tcscpy(szDirectory, lpszDirPath);
		if(szDirectory[_tcslen(szDirectory) - 1] == TCHAR('\\'))
			szDirectory[_tcslen(szDirectory) - 1] = TCHAR('\0');
		LPSTR lpszLastDir = _tcsrchr(szDirectory, TCHAR('\\'));
		if(lpszLastDir == NULL)
			return true;
		ZeroMemory(szShorterPath, MAX_PATH);
		_tcsncpy(szShorterPath, szDirectory, _tcslen(szDirectory) - _tcslen(lpszLastDir));
	}else
		return true;
	
	if(CreateDirectorySeq(szShorterPath))
		return (CreateDirectory(szDirectory, NULL) == TRUE);
	
	return false;
}



Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
GeneralRe: How to create a directory Pin
Mikey_E16-Jun-04 7:39
professionalMikey_E16-Jun-04 7:39 
GeneralWant to write a video/audio interaction software using VC. Pin
George22-Apr-03 23:25
George22-Apr-03 23:25 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
extremalis6-Apr-03 3:12
extremalis6-Apr-03 3:12 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
George27-Apr-03 22:00
George27-Apr-03 22:00 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
extremalis18-Apr-03 14:54
extremalis18-Apr-03 14:54 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
George218-Apr-03 18:24
George218-Apr-03 18:24 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
extremalis20-Apr-03 14:55
extremalis20-Apr-03 14:55 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
George220-Apr-03 17:51
George220-Apr-03 17:51 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
Anonymous20-Apr-03 17:14
Anonymous20-Apr-03 17:14 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
George220-Apr-03 17:50
George220-Apr-03 17:50 
QuestionGet name of process by socket ? Pin
Bash2-Apr-03 21:56
Bash2-Apr-03 21:56 
GeneralOutputDebugString... Pin
vikramlinux2-Apr-03 21:34
vikramlinux2-Apr-03 21:34 
GeneralRe: OutputDebugString... Pin
56789012342-Apr-03 21:57
56789012342-Apr-03 21:57 
GeneralRe: OutputDebugString... Pin
vikramlinux2-Apr-03 22:38
vikramlinux2-Apr-03 22:38 
GeneralRe: OutputDebugString... Pin
Philip Patrick3-Apr-03 0:08
professionalPhilip Patrick3-Apr-03 0:08 
Generaltranslate winsock errors Pin
Dudi Avramov2-Apr-03 20:40
Dudi Avramov2-Apr-03 20:40 
GeneralQuestion about WS_SYSMENU Pin
Simon.W2-Apr-03 20:29
Simon.W2-Apr-03 20:29 

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.