Hi,
I've tried your solution (code follows), but it doesn't work.
Is there a BUG in my module ? I don't find. Can you have a glance to it. THANKS.
Option Explicit
Type usrInFile
NumPost As String * 1
IdPs As String * 9
NumSce As String * 1
FileI As String * 40
FileO As String * 40
End Type
Private zInfile As usrInFile
Declare Sub CopyStringToUsr Lib "Kernel32" Alias "RtlMoveMemory" (pDest As Any, ByVal StrSrc As String, ByVal byteLen As Long)
Declare Sub CopyUsrToString Lib "Kernel32" Alias "RtlMoveMemory" (ByVal StrDest As String, pSrc As Any, ByVal byteLen As Long)
Function UsrToStr(Usr)
Dim Dest As String
Call CopyUsrToString(Dest, Usr, LenB(Usr))
UsrToStr = StrPtr(Dest)
End Function
Sub DispStrfromUDT()
Dim stri As String
Dim NumFile As Integer
NumFile = FreeFile
Open App.Path & "\In" For Binary As #NumFile
Get #NumFile, , zInfile
Close NumFile
stri = UsrToStr(VarPtr(zInfile))
MsgBox stri
End Sub
Sub main()
DispStrfromUDT
End Sub