Couple of questions

hey guys, i'm currently working on a small project that tidy up some pdf files under directory. And i got a few problems.

1. CreatDirectory() & MoveFile()
I have been using this two functions in my code. Originally i did it on Dev c++. And it compiled well in such format:
eg. CreatDirectory(char_type__path, NULL);
Yet when i move on to MS VS 2010 with the same code.VS generated error 2664 and i have to convert the path from string to LPCWSTR type to make it work.
I have read MSDN and know that the standard way to use these functions is with LPCWSTR. Yet I am confused that why i can compile it as char in devc++ but not so in VS? wts the difference?
and wt is LPCWSTR btw?

2. Output to excel
Next step in my project, i have to create a excel record of the tidied pdf files. i have search for ways to output to excel file. yet most of the result recommend outputting .csv file.
I am not familiar with .csv file. can it be directly opened by excel? or is there any better way for me to output it to excel?
all i need in the output excel is as follow:
ITEM A ITEM B ITEM C .....
text1 text2 text3 .....
(yet i want the same file to be updated every time i run the program)

3. Search function
the last thing i need is a search functions that can search the tidied pdf within a directory (and sub directories under it). any recommendation?


I know this is a lot. Please teach if u know the answer of any of these questions. thx a lot!!
wts the difference?
You compiled it as Unicode.
and wt is LPCWSTR btw?
unicode uses two bytes for a single charachter. W is wide character

I am not familiar with .csv file. can it be directly opened by excel?
Yes

all i need in the output excel is as follow:
You need to separate them with semicolons

3. Search function
If you want to use win api take FindFirstFile() and following. See:

http://msdn.microsoft.com/en-us/library/aa914391.aspx
1. so dev c++ and VC compile it in different ways?
which is in unicode and wt is the another case?

2. about .csv, i tried it and it works. thx a lot.
just one little thing. every time when i open the .csv with excel the width of the column is too narrow to display all the text and I have to adjust it. I guess there is no way I can save the setting?

3. is there any function that can search the file down one sub level?
eg. search every sub directories under C:\...\Directory\Sub directories\file
that means i can just input the file name and the function will search without a specified directory?

thx a lot!
so dev c++ and VC compile it in different ways?
They are different IDE's and compilers

which is in unicode and wt is the another case?
You can change it in the project settings -> Configuration Properties -> General -> Character Set (-> Not set)

http://stackoverflow.com/questions/1319461/how-do-i-turn-off-unicode-in-a-vc-project

I guess there is no way I can save the setting?
No way. This information must be stored in a file.

that means i can just input the file name and the function will search without a specified directory?
You don't need to provide a directory. But then it looks into the current directory (you may not be aware what it is). You can also use . for the current directory und .. for the previous. It's not trivial. I'd suggest making a test project to check it out.
Topic archived. No new replies allowed.