Hi there,
I'm trying to load external text from my custom DLL resource file, but it's not working.
Resource file content (Test.dll, Test.rc and Test.res containing Eula.txt), the Eula.txt file is about 6Kb:
I'm using the code like this:Code:900 CUSTOM "Eula.txt"
Code:Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long Private Declare Function LoadString Lib "user32" Alias "LoadStringA" (ByVal hInstance As Long, ByVal wID As Long, ByVal lpBuffer As String, ByVal nBufferMax As Long) As Long Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As LongCalling the function like this:Code:Public Function LoadStrRes(lgResID As Long) As String On Error Resume Next Dim lgRet As Long Dim stBuff As String * 32768 Dim lgBuffPos As Long Dim stFile As String stFile = App.Path & "\Test.dll" lgRet = LoadLibrary(stFile) Call LoadString(lgRet, lgResID, stBuff, Len(stBuff)) lgBuffPos = InStr(1, stBuff, Chr$(0)) LoadStrRes = Left$(stBuff, lgBuffPos - 1) Call FreeLibrary(lgRet) Exit Function End Function
Can someone tell my why is it not working for me?Code:Dim stTxtData As String stTxtData = LoadStrRes(900) txtEula.Text = stTxtData
Regards




Reply With Quote
