Click here to Skip to main content
15,889,909 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to implement WndProc callback method in a windows service ? Pin
Kushagra Tiwari21-Oct-09 22:08
Kushagra Tiwari21-Oct-09 22:08 
GeneralRe: How to implement WndProc callback method in a windows service ? Pin
Adam Roderick J21-Oct-09 23:32
Adam Roderick J21-Oct-09 23:32 
GeneralRe: How to implement WndProc callback method in a windows service ? Pin
Iain Clarke, Warrior Programmer21-Oct-09 23:34
Iain Clarke, Warrior Programmer21-Oct-09 23:34 
GeneralRe: How to implement WndProc callback method in a windows service ? Pin
Kushagra Tiwari22-Oct-09 0:35
Kushagra Tiwari22-Oct-09 0:35 
Questioncan i store output from readdir() function in an array Pin
WindowsVsLinux21-Oct-09 21:23
WindowsVsLinux21-Oct-09 21:23 
AnswerRe: can i store output from readdir() function in an array Pin
«_Superman_»21-Oct-09 21:30
professional«_Superman_»21-Oct-09 21:30 
GeneralRe: can i store output from readdir() function in an array Pin
WindowsVsLinux21-Oct-09 21:43
WindowsVsLinux21-Oct-09 21:43 
GeneralRe: can i store output from readdir() function in an array Pin
Cedric Moonen21-Oct-09 21:57
Cedric Moonen21-Oct-09 21:57 
ravi 12 wrote:
will it works?


No, you are writing all your strings into one string, so you will keep only the last one. The problem you have is that you don't know upfront how many directories you will get, so you don't know how large you have to make your array. You could choose the brute force and use an array which is large enough (e.g. char array[1024][1024]: max 1024 directories of max 1024 characters). And then in your while loop you keep an index of where to store the current directory name (simply increment it each time).

Is it a C or C++ project ? Because if it is C++, I strongly suggest you to use stl containers (std::list for instance) and std::string, this will avoid to create an array with a fixed size upfront.

Cédric Moonen
Software developer

Charting control [v2.0]
OpenGL game tutorial in C++

GeneralRe: can i store output from readdir() function in an array Pin
WindowsVsLinux21-Oct-09 22:05
WindowsVsLinux21-Oct-09 22:05 
GeneralRe: can i store output from readdir() function in an array Pin
Cedric Moonen21-Oct-09 22:14
Cedric Moonen21-Oct-09 22:14 
GeneralRe: can i store output from readdir() function in an array Pin
WindowsVsLinux21-Oct-09 22:18
WindowsVsLinux21-Oct-09 22:18 
GeneralRe: can i store output from readdir() function in an array Pin
Michael Schubert21-Oct-09 22:56
Michael Schubert21-Oct-09 22:56 
GeneralRe: can i store output from readdir() function in an array Pin
David Crow22-Oct-09 3:21
David Crow22-Oct-09 3:21 
QuestionType Promotion in C Pin
__yash__21-Oct-09 20:36
professional__yash__21-Oct-09 20:36 
AnswerRe: Type Promotion in C Pin
«_Superman_»21-Oct-09 21:28
professional«_Superman_»21-Oct-09 21:28 
GeneralRe: Type Promotion in C Pin
__yash__21-Oct-09 21:36
professional__yash__21-Oct-09 21:36 
QuestionRe: Type Promotion in C Pin
CPallini21-Oct-09 21:39
mveCPallini21-Oct-09 21:39 
AnswerRe: Type Promotion in C Pin
__yash__21-Oct-09 21:50
professional__yash__21-Oct-09 21:50 
AnswerRe: Type Promotion in C Pin
__yash__21-Oct-09 21:59
professional__yash__21-Oct-09 21:59 
GeneralRe: Type Promotion in C [modified] Pin
CPallini21-Oct-09 22:01
mveCPallini21-Oct-09 22:01 
GeneralRe: Type Promotion in C [modified] Pin
__yash__21-Oct-09 22:25
professional__yash__21-Oct-09 22:25 
GeneralRe: Type Promotion in C Pin
CPallini21-Oct-09 22:52
mveCPallini21-Oct-09 22:52 
GeneralRe: Type Promotion in C Pin
CPallini21-Oct-09 22:59
mveCPallini21-Oct-09 22:59 
GeneralRe: Type Promotion in C Pin
__yash__21-Oct-09 23:12
professional__yash__21-Oct-09 23:12 
GeneralRe: Type Promotion in C Pin
«_Superman_»22-Oct-09 9:31
professional«_Superman_»22-Oct-09 9:31 

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.