I've had this before, and I've been able to fix it by putting the type
definition physically before the API Declaration in the code. I guess then
the compiler finds the type before it gets to the declaration.
The code looks like this: form:
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias
"SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Private Type BROWSEINFO
hwndOwner As Long
PidlRoot As Long
PszDisplayName As String
LpszTitle As String
UlFlags As Long
Lpfn As Long
lParam As Long
IImage As Long
and the part of subroutine looks like that:
Dim Info As BROWSEINFO
Dim PID As Long, Path As String, Tmp As String
Dim localpath As String
localpath = txtRecStore.Text
Info.hwndOwner = Me.hwnd
Info.PidlRoot = &H0
Info.LpszTitle = "Select folder to store recordings:"
Info.UlFlags = &H1
PID = SHBrowseForFolder(Info)
is highlighted when the error appears
Sometimes, when creating executable, the compilier complains about that Info
"Compile error: User-defined type not defined"
It usually happens after I execute code (several times) and then try to
compile program to the executable.
However, when I close vbasic and restart it again and try to compile code
there is NOT that error.
Your comments please,