Click here to Skip to main content
15,911,526 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DLL link error Pin
kk_vp18-Sep-06 4:16
kk_vp18-Sep-06 4:16 
Question64 bit? Pin
Haoman1715-Sep-06 4:42
Haoman1715-Sep-06 4:42 
QuestionMFC (database) please help ! Pin
Bravoone_200615-Sep-06 2:55
Bravoone_200615-Sep-06 2:55 
AnswerRe: MFC (database) please help ! Pin
Hamid_RT15-Sep-06 3:01
Hamid_RT15-Sep-06 3:01 
AnswerRe: MFC (database) please help ! Pin
David Crow15-Sep-06 3:13
David Crow15-Sep-06 3:13 
AnswerRe: MFC (database) please help ! Pin
Maximilien15-Sep-06 3:14
Maximilien15-Sep-06 3:14 
AnswerRe: MFC (database) please help ! Pin
Vinicius Pontes15-Sep-06 10:02
Vinicius Pontes15-Sep-06 10:02 
Questionproblem with FileInformation Pin
ragnabob15-Sep-06 2:44
ragnabob15-Sep-06 2:44 
Hiya,

I'm making a program that'll copy random music directories (being cd's) onto my telephone memorycard. To test the basics, I first programmed a consoleapp that'll index all the dirs of my musicfolder. Below is the code thus far:

#include "stdafx.h"<br />
#include "windows.h"<br />
#include <iostream.h><br />
#include <string.h><br />
<br />
#define MAX_DIRECTORIES_CHECK	200<br />
<br />
typedef struct{<br />
	int index;<br />
	bool isEmpty;<br />
	char foldername[120];<br />
}foldernamestruct;<br />
<br />
foldernamestruct fns[MAX_DIRECTORIES_CHECK];<br />
<br />
int listDirectories(char* directory){<br />
	HANDLE hFile;<br />
	WIN32_FIND_DATA	FileInformation;<br />
<br />
	hFile = ::FindFirstFile(directory, &FileInformation);<br />
<br />
	if(hFile == INVALID_HANDLE_VALUE)<br />
		return 3;<br />
<br />
	strcpy(FileInformation.cFileName, fns[0].foldername);<br />
	fns[0].isEmpty = 0;<br />
	fns[0].index = 1;<br />
<br />
	printf ("First file name is %s.\n", FileInformation.cFileName);<br />
	printf(directory);<br />
	printf(FileInformation.cFileName);<br />
	printf("\n");<br />
	printf(fns[0].foldername);<br />
	printf("\n");<br />
<br />
	/*for(int i = 1; i<MAX_DIRECTORIES_CHECK;i++){<br />
		if(::FindNextFile(hFile, &FileInformation)==FALSE){<br />
			for(int j = i; j<MAX_DIRECTORIES_CHECK;j++)<br />
				fns[j].isEmpty = TRUE;<br />
			break;<br />
		}<br />
		else{<br />
			strcpy(FileInformation.cFileName, fns[i].foldername);<br />
			fns[i].isEmpty = FALSE;<br />
			fns[i].index = i+1;<br />
		}<br />
	}*/<br />
<br />
	return 1;<br />
}<br />
<br />
int main(int argc, char* argv[]){<br />
	char name[120];<br />
<br />
	for(int i = 0; i<MAX_DIRECTORIES_CHECK; i++){<br />
		fns[i].isEmpty = TRUE;<br />
		fns[i].index = -1;<br />
	}<br />
	<br />
	if(listDirectories("C:\\Documents and Settings\\User\\My documents\\My music")!=1)<br />
		return 1;<br />
<br />
	//printf("Found Handle \n\n");<br />
	/*for(i=0;i<MAX_DIRECTORIES_CHECK;i++){<br />
		strcpy(fns[i].foldername, name);<br />
		printf(name);<br />
		printf("\n");<br />
	}*/<br />
<br />
	cin >> name[4];<br />
	return 0;<br />
}


Now, I tried to test the whole by printing the foldernames using printf(), but why won't this work D'Oh! | :doh: Have I done something wrong? Can someone help me find the answer...

Thanks
QuestionRe: problem with FileInformation Pin
David Crow15-Sep-06 2:47
David Crow15-Sep-06 2:47 
AnswerRe: problem with FileInformation Pin
ragnabob15-Sep-06 2:50
ragnabob15-Sep-06 2:50 
GeneralRe: problem with FileInformation Pin
David Crow15-Sep-06 2:53
David Crow15-Sep-06 2:53 
GeneralRe: problem with FileInformation Pin
ragnabob15-Sep-06 3:15
ragnabob15-Sep-06 3:15 
AnswerRe: problem with FileInformation Pin
Stephen Hewitt15-Sep-06 3:03
Stephen Hewitt15-Sep-06 3:03 
GeneralRe: problem with FileInformation Pin
ragnabob15-Sep-06 3:14
ragnabob15-Sep-06 3:14 
GeneralRe: problem with FileInformation Pin
Stephen Hewitt16-Sep-06 1:32
Stephen Hewitt16-Sep-06 1:32 
QuestionWhat's function use for delete file and folder? Pin
Max++15-Sep-06 2:43
Max++15-Sep-06 2:43 
AnswerRe: What's function use for delete file and folder? Pin
Hamid_RT15-Sep-06 2:47
Hamid_RT15-Sep-06 2:47 
QuestionRe: What's function use for delete file and folder? Pin
David Crow15-Sep-06 2:48
David Crow15-Sep-06 2:48 
AnswerRe: What's function use for delete file and folder? Pin
Max++15-Sep-06 3:24
Max++15-Sep-06 3:24 
GeneralRe: What's function use for delete file and folder? Pin
David Crow15-Sep-06 3:32
David Crow15-Sep-06 3:32 
QuestionATL Control Pin
Demian Panello15-Sep-06 2:37
Demian Panello15-Sep-06 2:37 
QuestionHow to deny zero on CEdit Pin
virtualsamurai15-Sep-06 2:36
virtualsamurai15-Sep-06 2:36 
AnswerRe: How to deny zero on CEdit Pin
Hamid_RT15-Sep-06 2:54
Hamid_RT15-Sep-06 2:54 
GeneralRe: How to deny zero on CEdit Pin
virtualsamurai15-Sep-06 3:25
virtualsamurai15-Sep-06 3:25 
GeneralRe: How to deny zero on CEdit Pin
Zac Howland15-Sep-06 3:32
Zac Howland15-Sep-06 3:32 

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.