Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #1205
| From | "Karl-Heinz" <invalid@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: Help needed with ListBox:ListFiles() |
| Date | 2011-05-26 21:45 +0200 |
| Message-ID | <947p0sFv6dU1@mid.individual.net> (permalink) |
| References | <8ce28643-8da4-4ada-8d3c-bd61c6ed8cbd@a26g2000vbo.googlegroups.com> <3dbfe8b2-1981-4ed4-a7f7-0a2db69a38d4@f11g2000vbx.googlegroups.com> |
marc310
> well i'm using VO 2.6 and it did not work in datawindows. I did not
> change anything in my code just put it on a dialogwindow and the issue
> was solved... maybe it is a bug though... but look at the first
> parameter of the windows API function
There´s indeed a problem. When the ListBox is used on a DataWindow it
doens´t work. I´ve added a IF statement to check which handle is required.
Try the new "MyListFiles()" method below. It should now work on DataWindows
and Datadialogs.
NOTE: The sources are based on the 2.8 SDK. Maybe the 2.6 sources are
slightly different. But the important part ist to feed the DlgDirList()-API
call with the correct handle.
.
METHOD MyListFiles(sStartDir, oFixedText, FileTypes) CLASS ListBox
LOCAL pPath AS PSZ
LOCAL i,iRet AS INT
LOCAL dwFileTypes AS DWORD
LOCAL w AS DWORD
Default(@sStartDir, "*.*")
pPath := StringAlloc(sStartDir)
pPath := MemRealloc(pPath, 261)
IF !IsNil(FileTypes)
dwFileTypes := FileTypes
ELSE
dwFileTypes := _OR(DDL_DIRECTORY, DDL_DRIVES)
ENDIF
IF !IsNil(oFixedText)
w := oFixedText:ControlID
ENDIF
// <----------
IF IsInstanceOf ( oParent , #DataWindow )
iRet := DlgDirList(oParent:__GetFormSurface():handle(), pPath,
INT(wID), INT(w), dwFileTypes )
ELSE
//iRet := call(fpListFiles, oParent:Handle(), pPath, wID, w,
dwFileTyp
iRet := DlgDirList(oParent:handle(), pPath, INT(wID), INT(w),
dwFileTypes )
ENDIF
// <--------------
MemFree(pPath)
iRet := SUPER:ItemCount
//RvdH 050602, Bug [12898] Now fill aRetValues and aDisplayValues
arra
aRetValues := ArrayNew(iRet)
aDisplayValues := ArrayNew(iRet)
FOR i := 1 TO iRet
aRetValues[i] := SELF:GetItem(i)
aDisplayValues[i] := aRetValues[i]
NEXT
RETURN (iRet != 0)
regards
Karl-Heinz
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Help needed with ListBox:ListFiles() marc3l0 <mmarloch@gmail.com> - 2011-05-25 13:52 -0700
Re: Help needed with ListBox:ListFiles() Karl Faller <k.faller_withoutthat_@onlinehome.de> - 2011-05-25 23:39 +0200
Re: Help needed with ListBox:ListFiles() marc3l0 <mmarloch@gmail.com> - 2011-05-25 14:50 -0700
Re: Help needed with ListBox:ListFiles() "Geoff Schaller" <geoffx@softwarexobjectives.com.au> - 2011-05-26 00:18 +0000
Re: Help needed with ListBox:ListFiles() marc3l0 <mmarloch@gmail.com> - 2011-05-26 09:43 -0700
Re: Help needed with ListBox:ListFiles() "Karl-Heinz" <invalid@invalid.invalid> - 2011-05-26 21:45 +0200
Re: Help needed with ListBox:ListFiles() "Geoff Schaller" <geoffx@softwarexobjectives.com.au> - 2011-05-26 22:09 +0000
Re: Help needed with ListBox:ListFiles() marc3l0 <mmarloch@gmail.com> - 2011-05-27 14:35 -0700
csiph-web