Well, I can step back from the base, but I would like to use the wide (Unicode) version of the API call for GetOpenFileName to return a list of several files.
Now the reason I want to do this: When selecting multiple files, the general character limit for file names depends on the version of the function.
β’ ANSI: 32k limit
β’ Unicode: no restrictions
Returning a large number of files from a directory deeply immersed in my network can quickly exceed the ANSI 32k character limit.
So what I did was take my working declared ANSI function and replace all declared string variables with lngptr . Then, when I need to assign values ββto these, I used the StrPtr() function to convert string values.
Now, when I try to call this function, when it gets to the part where it calls the function Declared lReturn = GetOpenFileNameU(OpenFile) , it actually does nothing !. There are no errors, nothing - just steps right behind this line, and nothing happens. What did I do wrong?
This is where I am now:
Option Explicit '***NOTE: _ This class object requires the following references: _ <NONE> 'Declare the windows API function for GetOpenFileNameA 'MSDN Reference: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646927(v=vs.85).aspx Public Declare PtrSafe Function GetOpenFileNameU Lib "comdlg32.dll" Alias "GetOpenFileNameW" (pOpenfilename As OPENFILENAME) As Long Public Const OFN_ALLOWMULTISELECT As Long = &H200 Public Const OFN_CREATEPROMPT As Long = &H2000 Public Const OFN_ENABLEHOOK As Long = &H20 Public Const OFN_ENABLETEMPLATE As Long = &H40 Public Const OFN_ENABLETEMPLATEHANDLE As Long = &H80 Public Const OFN_EXPLORER As Long = &H80000 Public Const OFN_EXTENSIONDIFFERENT As Long = &H400 Public Const OFN_FILEMUSTEXIST As Long = &H1000 Public Const OFN_HIDEREADONLY As Long = &H4 Public Const OFN_LONGNAMES As Long = &H200000 Public Const OFN_NOCHANGEDIR As Long = &H8 Public Const OFN_NODEREFERENCELINKS As Long = &H100000 Public Const OFN_NOLONGNAMES As Long = &H40000 Public Const OFN_NONETWORKBUTTON As Long = &H20000 Public Const OFN_NOREADONLYRETURN As Long = &H8000& '*see comments Public Const OFN_NOTESTFILECREATE As Long = &H10000 Public Const OFN_NOVALIDATE As Long = &H100 Public Const OFN_OVERWRITEPROMPT As Long = &H2 Public Const OFN_PATHMUSTEXIST As Long = &H800 Public Const OFN_READONLY As Long = &H1 Public Const OFN_SHAREAWARE As Long = &H4000 Public Const OFN_SHAREFALLTHROUGH As Long = 2 Public Const OFN_SHAREWARN As Long = 0 Public Const OFN_SHARENOWARN As Long = 1 Public Const OFN_SHOWHELP As Long = &H10 Public Const OFN_ENABLESIZING As Long = &H800000 Public Const OFS_MAXPATHNAME As Long = 260 'Create a custom type that matches the OPENFILENAME structure 'MSDN reference: http:
source share