Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Can't find project or library issue

Avatar of csharp_learner
csharp_learnerFlag for Singapore asked on
Visual Basic ClassicVB Script
6 Comments1 Solution801 ViewsLast Modified:
Hi,

I have this string of code to read from an ini.file but the system kept prompting an "Can't find project or library" error on the line: strBuffer = String(lBufferSize, " ")

I am using VB 6.0
Version 9971     VBA:Retail 6.4.9970     Forms3:11.0.5601

And I have attached the Reference-Project image

Hope some expert can help me resolve this issue, thank you.
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileSection Lib "kernel32" Alias "GetPrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long


Sub read(o As GwxPick)

Dim strFilePath As String
Dim strBuffer As String
Dim lBufferSize As Long
Dim ret As Long
Dim strValue As String
Dim strSection As String
Dim strKey As String
Dim InputData As String

lBufferSize = 256
strBuffer = String(lBufferSize, " ")
InputData = "CHI_MAN_01" '*******************
strFilePath = "C:\Documents and Settings\user\Desktop\testing.ini"

strSection = "Country"
strKey = Split(InputData, "_")(0)

ret = GetPrivateProfileString(strSection, strKey, "", strBuffer, lBufferSize, strFilePath)
strValue = left$(strBuffer, ret)
ThisDisplay.GetVisibleObjectFromName("title").Text = strValue

strSection = "SubTitle"
strKey = Split(InputData, "_")(1)

ret = GetPrivateProfileString(strSection, strKey, "", strBuffer, lBufferSize, strFilePath)
strValue = left$(strBuffer, ret)
ThisDisplay.GetVisibleObjectFromName("subtitle").Text = strValue

End Sub
testing.ini
pic.JPG
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)Flag of Australia image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers