Click here to Skip to main content
15,893,381 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: FindFirstFileEx() and Unicode Pin
MicroVirus5-Jun-13 7:32
MicroVirus5-Jun-13 7:32 
GeneralRe: FindFirstFileEx() and Unicode Pin
Dave Kreskowiak5-Jun-13 9:46
mveDave Kreskowiak5-Jun-13 9:46 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie5-Jun-13 16:29
treddie5-Jun-13 16:29 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie6-Jun-13 8:15
treddie6-Jun-13 8:15 
GeneralRe: FindFirstFileEx() and Unicode Pin
Dave Kreskowiak6-Jun-13 10:10
mveDave Kreskowiak6-Jun-13 10:10 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie6-Jun-13 11:16
treddie6-Jun-13 11:16 
AnswerRe: FindFirstFileEx() and Unicode Pin
Alan N6-Jun-13 13:27
Alan N6-Jun-13 13:27 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie6-Jun-13 14:13
treddie6-Jun-13 14:13 
That basically has been my conclusion, though I don't know how to fix it yet. I figured SOMETHING had to be cutting the returned string short, and I know that the input string is getting to memory correctly, because I can retrieve it just fine. So that leaves the WIN32_FIND_DATA structure as the culprit. Documentation says the following declaration is required:

VB
<VBFixedString(MAX_PATH), MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MAX_PATH)> Public cFileName As String


And for my string pointer, I used:

Dim lpFileName_IntPtr As Long = Marshal.StringToHGlobalAuto(lpFileName_str)


I experimented with changing MAX_PATH to 32767 rather than 260, but alone by itself it does nothing. And anyway, that is a max character length issue, not an ANSI vs. wide character issue. So I feel that the problem is with declaring cFileName, correctly. That was where I was at when I saw your post. I do not know how to squeeze some martialing in there to account for a wide string.

modified 6-Jun-13 20:22pm.

AnswerRe: FindFirstFileEx() and Unicode Pin
TnTinMn5-Jun-13 18:14
TnTinMn5-Jun-13 18:14 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie6-Jun-13 8:08
treddie6-Jun-13 8:08 
GeneralRe: FindFirstFileEx() and Unicode Pin
TnTinMn6-Jun-13 8:22
TnTinMn6-Jun-13 8:22 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie6-Jun-13 8:53
treddie6-Jun-13 8:53 
GeneralRe: FindFirstFileEx() and Unicode Pin
TnTinMn6-Jun-13 9:17
TnTinMn6-Jun-13 9:17 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie6-Jun-13 10:07
treddie6-Jun-13 10:07 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie6-Jun-13 14:29
treddie6-Jun-13 14:29 
GeneralRe: FindFirstFileEx() and Unicode Pin
TnTinMn6-Jun-13 15:06
TnTinMn6-Jun-13 15:06 
GeneralRe: FindFirstFileEx() and Unicode Pin
TnTinMn6-Jun-13 15:41
TnTinMn6-Jun-13 15:41 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie6-Jun-13 16:07
treddie6-Jun-13 16:07 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie6-Jun-13 18:04
treddie6-Jun-13 18:04 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie10-Jun-13 10:02
treddie10-Jun-13 10:02 
GeneralRe: FindFirstFileEx() and Unicode Pin
TnTinMn10-Jun-13 14:44
TnTinMn10-Jun-13 14:44 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie10-Jun-13 16:45
treddie10-Jun-13 16:45 
GeneralRe: FindFirstFileEx() and Unicode Pin
TnTinMn10-Jun-13 17:18
TnTinMn10-Jun-13 17:18 
GeneralRe: FindFirstFileEx() and Unicode Pin
treddie10-Jun-13 18:30
treddie10-Jun-13 18:30 
AnswerRe: FindFirstFileEx() and Unicode Pin
treddie11-Jun-13 13:22
treddie11-Jun-13 13:22 

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.