English
Source / code snippets

List com Comports lists Ports

 
- Page 1 -


Related: WMI code Creator [...] 

iF (11.12.2009)
QueryDosDevice [...] 
CompileMarkSeparation
declare lpTargetPath#
cls
dim lpTargetPath#,65536
var nmChars&=external("kernel32.dll","QueryDosDeviceA",0,lpTargetPath#,65536)

if nmChars&

    print char$(lpTargetPath#,0,nmChars&)

endif

dispose lpTargetPath#
waitinput
03/14/10  
 



« this Posting watts as Solution marked. »

- Page 2 -


there now on one computer by me weder a yet The others Solution functions what about me but the Number and Ports needed these fixe Solution:
CompileMarkSeparation
without Präkompi...
CompileMarkSeparation
cls
var comports&=createAvailableCOMPortsList()
print "Anzahl:",getCount(comports&)

whileLoop 0,getCount(comports&)-1

    print getString$(comports&,&loop)

wend

destroyWindow(comports&)
waitInput
end

proc createAvailableCOMPortsList

    var lst&=create("list",0)
    var h&=0

    whileLoop 256

        h&=openCom("COM"+st$(&loop),0,0)
        case h&>0 : addString(lst&,"COM"+st$(&loop))
        CloseCom(h&)

    wend

    return lst&

endProc



12 kB
Hochgeladen:12/17/10
Downloadcounter229
Download
 
12/17/10  
 



 
- Page 1 -


If you to if nmChars& time print nmChars& write, what becomes displayed?
 
03/16/10  
 




Rolf
Koch
by me becomes code displayed, whatever it To mean has
 
03/16/10  
 



by me too, I had but yet none computer, with the obiges quite no Chars showed - thatswhy interestingly what there with Pedro go is.
 
03/16/10  
 




Matthias
Arlt
by me appear ditto only one leeres Window.
(and print nmChars& gives 0 back)
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
03/16/10  
 




GDL
Hi,

by me too leeres Window.

Hello
Georg
 
Windows7 Xprofan 8,9,10 [...]  [...] 
03/16/10  
 



Test something GetLastError zurückgibt, How z.B. 122 for error_insufficient_buffer.
CompileMarkSeparation
print external("kernel32.dll","GetLastError")
//od.m.xpse
print GetLastError()re>
 
03/16/10  
 




GDL
it'll 2time zero zurückgegeben.
 
Windows7 Xprofan 8,9,10 [...]  [...] 
03/16/10  
 



understand, have unfortunately no idea.
 
03/16/10  
 




GDL
apparently gehn The functions not.
If the function fails, the return value is zero.
 
Windows7 Xprofan 8,9,10 [...]  [...] 
03/16/10  
 



 
- Page 2 -



Uwe
''Pascal''
Niemeier
Hi people!

with the WideChar-Variante shining it To klappen:
CompileMarkSeparation
window %maxX,%maxY
declare lpTargetPath#,Temp$
dim lpTargetPath#,65536
var nmChars&=external("kernel32.dll","QueryDosDeviceW",0,lpTargetPath#,65536)
var Pos&=0

if nmChars&

    while 1

        Temp$=stringw$(lpTargetPath#,Pos&)
        print Temp$
        Pos&=Pos&+len(Temp$)*2+1
        case Pos&>=nmChars&*2:break
        sleep 200

    endwhile

endif

dispose lpTargetPath#
waitinput

really schlau I will from the Result but not

BTW: what serial COM-Ports XP concerns:
HKEY_LOCAL_MACHINEHARDWAREDEVICEMAPSERIALCOMM

SeeYou
Pascal
 
03/18/10  
 



with the Ansivariante get one well one String(aray) with z as Separator - at least sustain one so The "aktiven"/ mom. verfügb. COM-Ports with number. with Wide is vlt. zz the Sep..
 
03/18/10  
 



there now on one computer by me weder a yet The others Solution functions what about me but the Number and Ports needed these fixe Solution:
CompileMarkSeparation
without Präkompi...
CompileMarkSeparation
cls
var comports&=createAvailableCOMPortsList()
print "Anzahl:",getCount(comports&)

whileLoop 0,getCount(comports&)-1

    print getString$(comports&,&loop)

wend

destroyWindow(comports&)
waitInput
end

proc createAvailableCOMPortsList

    var lst&=create("list",0)
    var h&=0

    whileLoop 256

        h&=openCom("COM"+st$(&loop),0,0)
        case h&>0 : addString(lst&,"COM"+st$(&loop))
        CloseCom(h&)

    wend

    return lst&

endProc



12 kB
Hochgeladen:12/17/10
Downloadcounter229
Download
 
12/17/10  
 




Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

26.815 Views

Untitledvor 0 min.
H.Brill05/21/23
Normann Strübli01/30/23
RudiB.01/15/22
p.specht12/13/21
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie