Undefined Equate with PB10 and FF3 with function

Started by James Padgett, April 21, 2011, 07:56:58 AM

Previous topic - Next topic

James Padgett

I am using a function plagurized from Jose  ( many thanks )
This worked fine using PB includes and PB 9 ....
This could be something about Jose's includes since I have never used them before...
I have made the mods to .inc files for PB10 use.. ( I don't think they were required for what my app does but made them anyway )

nifile = GetSpecialFolderLocation ( HWND_FORM1, %CSIDL_APPDATA )

Which generates an Undefined Equate error..
I have selected to use Jose's include files in the project evironment settings..
If I specifically add the two includes that ref %CSIDL_APPDATA in them in the FF_AppStart
#INCLUDE "C:\PBWin10\201winapi\shFolder.INC"
#INCLUDE "C:\PBWin10\201winapi\ShlObj.inc"
I get an error 466 in ... SHLOBJ.INC  ' the name is already in use..
If I comment out the shlbj.inc I get ...  Error 519 Missing Declaration
If I comment out the shFolder.INC I get ... error 466 ' the name is already in use.
If I commnet them both out and select use PB includes I get Error 524  undefined type in ... Codegen_fsxconf_utility.inc


Function GetSpecialFolderLocation (ByVal hwndOwner As Dword, ByVal nFolder As Long) As String

   Local pidl As Dword                     ' pointer to an item identifier list (PIDL)
   Local szPath As Asciiz * %MAX_PATH      ' folder's path
   
   If SHGetSpecialFolderLocation(hwndOwner, nFolder, pidl) = %S_OK Then
      SHGetPathFromIDList ByVal pidl, szPath
      CoTaskMemFree pidl
      Function = szPath
   End If

End Function

Paul Squires

It appears that the MACRO for SHGetFolderPath is defined twice. Once in ShlObj.inc and a second time in shFolder.inc. I commented out the MACRO in ShlObj.inc and it compiled okay.

You may want to bring this to Jose's attention (if he has not already read this post).
Paul Squires
PlanetSquires Software

José Roca

They aren't intended to be included together, since if you include shlobj.inc you don't need shfolder.inc for anything (it is a subset of shlobj.inc). Anyway, I will add additional #IF/ENDIFs to both files to avoid conflicts if they are included together.

James Padgett

I guess I wonder if I should add them at all...  I haven't used your includes before so I'm kind of in the dark about them..

The function worked as is with PB9 and PB's includes... 


José Roca


James Padgett

OK I only include shlobj.inc  but still get:

Error 466 in shlobj.inc: name is already in use
Line 1429: MACRO SHGetPathFromIDList = SHGetPathFromIDListA

A likely conflict is in ...\CODEGEN_FSXCONF_MAIN.bas
Line 66: Declare Function SHGetPathFromIDList Lib "Shell32.D....

I have had to comment out the following MACRO's..  is this OK or will it break something else in the future?
'   MACRO SHBrowseForFolder
'   MACRO BROWSEINFO
'   MACRO SHGetPathFromIDList

José Roca

No, it isn't ok.  It is the Declare Function SHGetPathFromIDList Lib "Shell32.D... in ...\CODEGEN_FSXCONF_MAIN.bas which should be removed. If your code has duplicate declares, you shouldn't use it with my headers.


James Padgett

It is the Declare Function SHGetPathFromIDList Lib "Shell32.D... in ...\CODEGEN_FSXCONF_MAIN.bas which should be removed.

So how do I keep FireFly from declaring this?