06-10-2009, 02:53 AM
Hello Gintaras,
As you said i have done some out calls to debug my code, but now I have two questions about Unicode( I think I am doing something wrong with the memory or have memory leaks, because sometimes my program run, and sometimes my program closes unexplectly)
1.- What is the right way to get the cFileName with WIN32_FIND_DATAW i am using the following code:
Function get_folder_size
(Where struFind is an instance of WIN32_FIND_DATAW structure, at this time I have executed this code at first, and trueFilter is now a BSTR) is it ok??
When I tried to add struFind.CFileName directly to a BSTR with "add" method it got a number, i guess a pointer or reference and appends it as a part of the string.
2.- a BSTR does not need to be initialized is it right? like this:
Function get_folder_size
I have tried to make a chidlFolder.alloc(800), but also my program closes.
Thank you.
Regards.
As you said i have done some out calls to debug my code, but now I have two questions about Unicode( I think I am doing something wrong with the memory or have memory leaks, because sometimes my program run, and sometimes my program closes unexplectly)
1.- What is the right way to get the cFileName with WIN32_FIND_DATAW i am using the following code:
Function get_folder_size
(Where struFind is an instance of WIN32_FIND_DATAW structure, at this time I have executed this code at first, and trueFilter is now a BSTR) is it ok??
When I tried to add struFind.CFileName directly to a BSTR with "add" method it got a number, i guess a pointer or reference and appends it as a part of the string.
2.- a BSTR does not need to be initialized is it right? like this:
Function get_folder_size
,,,str s.ansi(&struFind.cFileName)
,,,BSTR childFolder=""
,,,childFolder.add(folder)
,,,childFolder.add("\")
,,,childFolder.add(s)I have tried to make a chidlFolder.alloc(800), but also my program closes.
Thank you.
Regards.
