HB_FUNC( DRAGQUERYFILES ) 32 Bit -> 64 Bit

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

HB_FUNC( DRAGQUERYFILES ) 32 Bit -> 64 Bit

Post by AUGE_OHR »

hi,

now i have use COMPILE_HMG_UNICODE and reduce it to this Warnings
hbmk2: Compiling...
HB_FUNC.PRG: In function 'HB_FUN_DRAGQUERYFILES':
HB_FUNC.PRG:132:32: warning: passing argument 3 of 'DragQueryFileW' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from c:/hmg.3.4.4/mingw-64/x86_64-w64-mingw32/include/windows.h:89:0,
from HB_FUNC.PRG:7:
c:/hmg.3.4.4/mingw-64/x86_64-w64-mingw32/include/shellapi.h:71:19: note: expected 'LPWSTR {aka short unsigned int *}' but argument is of type 'char *'
SHSTDAPI_(UINT) DragQueryFileW (HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch);
^

Code: Select all

HB_FUNC( DRAGQUERYFILES )
{
   HDROP hDrop;

   hDrop  = (HDROP) HMG_parnl( 1 )  ;
   int   iFiles = DragQueryFile( hDrop, 0xFFFFFFFF, 0, 0 );
   int   i;
   char  bBuffer[ 250 ];

   hb_reta( iFiles );

   for( i = 0; i < iFiles; i++ )
   {
      DragQueryFile( hDrop, i, ( char * ) bBuffer, 249 );
      hb_storvc( ( char * ) bBuffer, -1, i + 1 );
   }
}
need help to create a 64 Bit Unicode Version for HMG ( MiniGUI does have own )
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: HB_FUNC( DRAGQUERYFILES ) 32 Bit -> 64 Bit

Post by AUGE_OHR »

hi,

as soon as i use

Code: Select all

#define COMPILE_HMG_UNICODE
#include "HMG_UNICODE.h"
i got that Warning ...

normal i only use

Code: Select all

#include "HMG_UNICODE.h"
which i use for "A"nsi / "W"ide C-Code

Code: Select all

#IFDEF UNICODE
   "W"
#ELSE
   "A"
#ENDIF
COMPILE_HMG_UNICODE seems to be use in "normal" *.PRG Files which belong to HMG \SOURCE of LIB

so i try this

Code: Select all

#define COMPILE_HMG_UNICODE

#pragma BEGINDUMP
#include "HMG_UNICODE.h"
and now i got no Warnings :D

but still not understand what is going on. who can give me a light :idea:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: HB_FUNC( DRAGQUERYFILES ) 32 Bit -> 64 Bit

Post by AUGE_OHR »

hi,

got it for HMG

Code: Select all

#pragma BEGINDUMP
#define COMPILE_HMG_UNICODE
#include "HMG_UNICODE.h"

HB_FUNC( DRAGACCEPTFILES )
{
   DragAcceptFiles( ( HWND ) HMG_parnl( 1 ), hb_parl( 2 ) );
}

HB_FUNC( DRAGQUERYFILES )
{
   HDROP hDrop  = ( HDROP ) HMG_parnl( 1 );
   int   iFiles = DragQueryFile( hDrop, 0xFFFFFFFF, 0, 0 );
   int   i;
   TCHAR bBuffer[ 250 ];

   hb_reta( iFiles );

   for( i = 0; i < iFiles; i++ )
   {
      DragQueryFile( hDrop, i, ( TCHAR * ) bBuffer, 249 );
      HMG_storvc( ( TCHAR * ) bBuffer, -1, i + 1 );
   }
}

HB_FUNC( DRAGFINISH )
{
   DragFinish( ( HDROP ) HMG_parnl( 1 ) );
}

HB_FUNC( DRAGQUERYPOINT ) // ( hDrop, aPoint ) --> lInClient
{
   POINT pt;
   hb_retl( DragQueryPoint( ( HDROP ) HMG_parnl( 1 ), &pt ) );
   hb_storvni( pt.x, 2, 1 );
   hb_storvni( pt.y, 2, 2 );
}
i have to use "TCHAR" instead of "char" and Warning disappear :)

... but in MiniGUI i "saw" that there is "more" for UNICODE ... hm

p.s. still not work to (OLE ?) "Drop" Email from Outlook
have fun
Jimmy
Post Reply