Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #2883

Re: Select a drive - best method

From Massimo Bighelli <info@arcasistemi.it>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Select a drive - best method
Date 2012-01-31 19:43 +0100
Organization ARCA Sistemi S.r.l.
Message-ID <jg9coh$643$1@speranza.aioe.org> (permalink)
References <U6VVq.1314$cl.401@newsfe21.ams2>

Show all headers | View raw


This is the Postinit() of my Dialog showing PC's drivers
(Loading combobox or listview)
HTH

Massimo Bighelli


METHOD PostInit(oParent,uExtra) CLASS DriversDLG

LOCAL nLen AS DWORD
LOCAL P, pszBuffer AS PSZ
LOCAL cBuffer, s AS STRING
LOCAL aDisk AS ARRAY

pszBuffer :=PSZ( MemAlloc( 256 ))      // Alloc mem for buffer
nLen := GetLogicalDriveStrings(256, pszBuffer)
cBuffer := Psz2String( pszBuffer )   // Convert to string to get it returned

aDisk := ArrayCreate(0)

// FISSI
//------
P := pszBuffer
WHILE ! Empty(s:=Psz2String(P))
   IF GetDriveType(PSZ( s) ) ==DRIVE_FIXED //.OR. GetDriveType(PSZ( s) 
)==DRIVE_REMOTE
    AAdd(aDisk,s)
   ENDIF
   p :=p+SLen(S)+1
ENDDO
SELF:oDcListaDriveF:fillusing(aDisk)
aDisk := {}

// RETE
//------
P := pszBuffer
WHILE ! Empty(s:=Psz2String(P))
   IF GetDriveType(PSZ( s) ) == DRIVE_REMOTE
    AAdd(aDisk,s)
   ENDIF
   P :=P+SLen(s)+1
ENDDO
SELF:oDcListaDriveN:fillusing(aDisk)
aDisk := {}

// REMOVIBILI
//-----------
P := pszBuffer
WHILE ! Empty(s:=Psz2String(P))
   IF GetDriveType(PSZ( s) ) == DRIVE_REMOVABLE
    AAdd(aDisk,s)
   ENDIF
   P :=P+SLen(s)+1
ENDDO
SELF:oDcListaDriveR:fillusing(aDisk)
aDisk := {}

// CD-ROM
//-------
P := pszBuffer
WHILE ! Empty(s:=Psz2String(P))
   IF GetDriveType(PSZ( s) ) == DRIVE_CDROM
    AAdd(aDisk,s)
   ENDIF
   P :=P+SLen(s)+1
ENDDO
SELF:oDcListaDriveC:fillusing(aDisk)
aDisk := {}

// RAM
//----
P := pszBuffer
WHILE ! Empty(s:=Psz2String(P))
   IF GetDriveType(PSZ( s) ) == DRIVE_RAMDISK
    AAdd(aDisk,s)
   ENDIF
   P :=P+SLen(s)+1
ENDDO
SELF:oDcListaDriveN:fillusing(aDisk)
aDisk := {}

MemFree(pszBuffer)
aDisk :=NULL_ARRAY

RETURN NIL





Il 31/01/2012 18:00, Martin ha scritto:
> OK I have been caught out and need to write a select the drive screen,
> for reading archived data off a CD.
>
> Only 1 site use this and they have just asked us to do it. (Went Clipper
> to VO in December).
>
> Used to be a simple GET with 1 character for the drive letter then ':\'
> added on.
>
> What dialogue is best to use for this in VO?
>
> Thanks
>
> Martin

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Select a drive - best method Martin <spam@spam.spam> - 2012-01-31 17:00 +0000
  Re: Select a drive - best method John Martens <adsl672100@tiscali.nl> - 2012-01-31 18:43 +0100
  Re: Select a drive - best method Massimo Bighelli <info@arcasistemi.it> - 2012-01-31 19:43 +0100
    Re: Select a drive - best method Martin <spam@spam.spam> - 2012-02-01 11:02 +0000
  Re: Select a drive - best method "Jamal" <vodotnet_nospam@yahoo.com> - 2012-01-31 14:14 -0500
  Re: Select a drive - best method Mathias <mathias.hakansson@consultec.se> - 2012-02-01 00:13 -0800

csiph-web