FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour can i make a HB_FUNC() of it ?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
can i make a HB_FUNC() of it ?
Posted: Sat Feb 18, 2023 10:23 PM
hi,

i´m still struggle with this CODE
Code (fw): Select all Collapse
BOOL PreventRemovalOfVolume(HANDLE hVolume,  BOOL fPreventRemoval)
{
   DWORD dwBytesReturned;
   PREVENT_MEDIA_REMOVAL PMRBuffer;
   PMRBuffer.PreventMediaRemoval = (BOOL) fPreventRemoval;
   return DeviceIoControl( hVolume, IOCTL_STORAGE_MEDIA_REMOVAL,
                           &PMRBuffer, sizeof(PREVENT_MEDIA_REMOVAL),
                           NULL, 0, &dwBytesReturned, NULL );
}
HB_FUNC.PRG(148): warning C4244: "=": Konvertierung von "BOOL" in "BOOLEAN", möglicher Datenverlust
HB_FUNC.PRG(156): warning C4431: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C nicht mehr unterstützt.
now i "think" to use a HB_FUNC() instead
Code (fw): Select all Collapse
HB_FUNC( PROV ) //PreventRemovalOfVolume
{
   HANDLE hVolume = ( HWND ) hb_parnl( 1 ) ;
   BOOL fPreventRemoval = ( BOOL) hb_parl(2) ;
   ...
   hb_retl( DeviceIoControl( ..) ) ;
}
is something like that possible :?:

---

if Yes :
what Type is "HANDLE hVolume" -> HWND :?:
does it need to check for 64 Bit
greeting,

Jimmy
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: can i make a HB_FUNC() of it ?
Posted: Sun Feb 19, 2023 05:21 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: can i make a HB_FUNC() of it ?
Posted: Mon Feb 20, 2023 01:02 AM
hi,

thx for Answer

i do have working Version under Xbase++ and HMG using DLL Call
but as i had Problem under Fivewin i have to use HB_FUNC()

my CODE look like Github Sample but that are not HB_FUNC() which i like to have

---

my Question is if i can change those "internal" API Function to single HB_FUNC()
Code (fw): Select all Collapse
BOOL PreventRemovalOfVolume(HANDLE hVolume, BOOL fPreventRemoval)
goes to
Code (fw): Select all Collapse
HB_FUNC(PreventRemovalOfVolume)
   HANDLE hVolume = (HWND) hb_parnl(1) ;
   BOOL fPreventRemoval = (BOOL) hb_parl(2) ;
...
hb_retl( DeviceIoControl( ... ) ) ;
greeting,

Jimmy

Continue the discussion