🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7846

How to get (LPCTSTR) lpFileName for a HID handle?

#7846
From: Christian
Date: Thu, 16 Dec 2004 19:22
20 lines
1730 bytes
Eventually I've managed to talk with a HID (external power switch) but
the first parameter for CreateFile( ... ) is rather strange to get.
I have the following code:

HANDLE hdriver;
 
hdriver=CreateFile("\\\\.\\HID#Vid_0000&Pid_003f#6&267ac536&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}", 

                   GENERIC_WRITE,
                   FILE_SHARE_WRITE,
                   NULL,
                   OPEN_EXISTING,
                   FILE_ATTRIBUTE_NORMAL,
                   NULL );

which operates very well. I can switch LiisaPowerSwitch on and off.
Is there an appropriate way to get the first parameter a bit simpler 
than by cut&paste from the registry?

Christian
Technical Details
Message-ID: <41c1ee7c@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9f03b256e9f2f8c5,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 16 Dec 2004 20:22:15 +0100
From: Christian <cmonstein@swissonline.ch>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: How to get (LPCTSTR) lpFileName for a HID handle?
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 80.219.129.175
Message-ID: <41c1ee7c@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1103228540 80.219.129.175 (16 Dec 2004 12:22:20 -0800)
Lines: 21
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail