Página 1 de 1

Warning W8080:'PtrToPtr64' is declared but never

Enviado: 13 Dez 2023 12:35
por deividdjs
Boa tarde amigos .. alguem já passou por esse erro ?? o sistema até complica ...até porque não é exatamente um erro .. é um pedido de "ATENÇÃO".. porem apresenta essa mensagem quando compilo com este codigo abaixo ..

Código: Selecionar todos

FUNCTION MsgYesNo( cText )

   LOCAL lValue

   lValue := wapi_MessageBox( wvgSetAppWindow():hWnd, cText, "Confirma?", MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2 ) == IDYES

   RETURN lValue
  
FUNCTION MsgExclamation( cText )

   wapi_MessageBox( wvgSetAppWindow():hWnd, cText, "Atenci¢n!", MB_ICONASTERISK )

   RETURN NIL

FUNCTION MsgWarning( cText )

   wapi_MessageBox( wvgSetAppWindow():hWnd, cText, "Atenci¢n!", MB_ICONEXCLAMATION )

   RETURN NIL

FUNCTION MsgStop( cText )

   wapi_MessageBox( wvgSetAppWindow():hWnd, cText, "Atenci¢n!", MB_ICONHAND )

   RETURN NIL

FUNCTION MSGINFO( cText, cTitle )
RETURN WAPI_MESSAGEBOX( 0, cText, cTitle, MB_ICONQUESTION )

Procedure MsgInfoTimeout( nTimeout )
Local nFlag, nMilliSeconds, nRet

   nFlag := MB_OK + MB_SETFOREGROUND + MB_SYSTEMMODAL + MB_ICONINFORMATION
   nMilliSeconds := nTimeout * 1000
   nRet := MessageBoxTimeout ("Test a timeout of " + hb_ntos (nTimeout) + " seconds.", "MsgInfo Timeout", nFlag, nMilliSeconds)

DO CASE
   CASE nRet == IDOK
        MsgInfo ( "OK" , "Result" )
   CASE nRet == MB_TIMEDOUT
        MsgInfo ( "TimeOut in " + hb_ntos (nTimeout) + " seconds." , "Result" )
   OTHERWISE
        MsgInfo ( "TimeOut --> nRet = " + hb_ntos (nRet) , "Result" )
ENDCASE

Return


Procedure MsgYesNoTimeout( nTimeout )
Local nFlag, nMilliSeconds, nRet

   nFlag := MB_YESNO + MB_SETFOREGROUND + MB_SYSTEMMODAL + MB_ICONQUESTION
   nMilliSeconds := nTimeout * 1000
   nRet := MessageBoxTimeout ("Test a timeout of " + hb_ntos (nTimeout) + " seconds.", "MsgYesNo Timeout", nFlag, nMilliSeconds)

DO CASE
   CASE nRet == IDYES
        MsgInfo ( "YES" , "Result" )
   CASE nRet == IDNO
        MsgInfo ( "NO" , "Result" )
   CASE nRet == MB_TIMEDOUT
        MsgInfo ( "TimeOut in " + hb_ntos (nTimeout) + " seconds." , "Result" )
   OTHERWISE
        MsgInfo ( "TimeOut --> nRet = " + hb_ntos (nRet) , "Result" )
ENDCASE

Return


Procedure MsgOkCancelTimeout( nTimeout )
Local nFlag, nMilliSeconds, nRet

   nFlag := MB_OKCANCEL + MB_SETFOREGROUND + MB_SYSTEMMODAL + MB_ICONQUESTION
   nMilliSeconds := nTimeout * 1000
   nRet := MessageBoxTimeout ("Test a timeout of " + hb_ntos (nTimeout) + " seconds.", "MsgOkCancel Timeout", nFlag, nMilliSeconds)

DO CASE
   CASE nRet == IDOK
        MsgInfo ( "OK" , "Result" )
   CASE nRet == IDCANCEL
        MsgInfo ( "CANCEL" , "Result" )
   CASE nRet == MB_TIMEDOUT
        MsgInfo ( "TimeOut in " + hb_ntos (nTimeout) + " seconds." , "Result" )
   OTHERWISE
        MsgInfo ( "TimeOut --> nRet = " + hb_ntos (nRet) , "Result" )
ENDCASE

Return


#pragma BEGINDUMP 

#ifdef __POCC__
#define _WIN32_WINNT  0x0500
#else
#define _WIN32_WINNT  0x0400
#endif

#include <windows.h>

#include "hbapi.h"
/*
#ifdef __XHARBOUR__
#include "hbverbld.h"
#if defined( HB_VER_CVSID ) && ( HB_VER_CVSID < 9639 )
#define HB_ISCHAR( n )  ISCHAR( n )
#endif
#if defined( HB_VER_CVSID ) && ( HB_VER_CVSID < 9798 )
#define HB_ISNIL( n )   ISNIL( n )
#endif
#endif
*/
// JK HMG 1.2 Experimental Build 16g
// MessageBoxIndirect( [hWnd], cText, [cCaption], [nStyle], [xIcon], [hInst], [nHelpId], [nProc], [nLang] )
// Contributed by Andy Wos <andywos@unwired.com.au>



HB_FUNC( MESSAGEBOXINDIRECT )
{
   MSGBOXPARAMS mbp;

   mbp.cbSize             = sizeof( MSGBOXPARAMS );
   mbp.hwndOwner          = HB_ISNIL( 1 ) ? GetActiveWindow() : ( HWND ) hb_parnl( 1 );
   mbp.hInstance          = HB_ISNIL( 6 ) ? GetModuleHandle( NULL ) : ( HINSTANCE ) hb_parnl( 6 );
   mbp.lpszText           = HB_ISCHAR( 2 ) ? hb_parc( 2 ) : ( HB_ISNIL( 2 ) ? NULL : MAKEINTRESOURCE( hb_parni( 2 ) ) );
   mbp.lpszCaption        = HB_ISCHAR( 3 ) ? hb_parc( 3 ) : ( HB_ISNIL( 3 ) ? "" : MAKEINTRESOURCE( hb_parni( 3 ) ) );
   mbp.dwStyle            = ( DWORD ) hb_parni( 4 );
   mbp.lpszIcon           = HB_ISCHAR( 5 ) ? hb_parc( 5 ) : ( HB_ISNIL( 5 ) ? NULL : MAKEINTRESOURCE( hb_parni( 5 ) ) );
   mbp.dwContextHelpId    = HB_ISNIL( 7 ) ? 0 : ( DWORD ) hb_parni( 7 );
   mbp.lpfnMsgBoxCallback = HB_ISNIL( 8 ) ? NULL : ( MSGBOXCALLBACK ) hb_parnl( 8 );
   mbp.dwLanguageId       = HB_ISNIL( 9 ) ? MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) : ( DWORD ) hb_parni( 9 );

   hb_retni( ( int ) MessageBoxIndirect( &mbp ) );
}

typedef int ( WINAPI * PMessageBoxTimeout )( HWND, LPCSTR, LPCSTR, UINT, WORD, DWORD );
static PMessageBoxTimeout pMessageBoxTimeout = NULL;

int WINAPI MessageBoxTimeout( HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType, WORD wLanguageId, DWORD dwMilliseconds )
{
   if( pMessageBoxTimeout == NULL )
   {
      HMODULE hLib = LoadLibrary( "User32.dll" );

      pMessageBoxTimeout = ( PMessageBoxTimeout ) GetProcAddress( hLib, "MessageBoxTimeoutA" );
   }

   if( pMessageBoxTimeout == NULL )
      return FALSE;

   return pMessageBoxTimeout( hWnd, lpText, lpCaption, uType, wLanguageId, dwMilliseconds );
}

//       HMG_MessageBoxTimeout (Text, Caption, nTypeButton, nMilliseconds) ---> Return iRetButton
HB_FUNC( MESSAGEBOXTIMEOUT )
{
   HWND         hWnd           = GetActiveWindow();
   const char * lpText         = ( const char * ) hb_parc( 1 );
   const char * lpCaption      = ( const char * ) hb_parc( 2 );
   UINT         uType          = HB_ISNIL( 3 ) ? MB_OK : ( UINT ) hb_parnl( 3 );
   WORD         wLanguageId    = MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL );
   DWORD        dwMilliseconds = HB_ISNIL( 4 ) ? ( DWORD ) 0xFFFFFFFF : ( DWORD ) hb_parnl( 4 );

   int iRet = MessageBoxTimeout( hWnd, lpText, lpCaption, uType, wLanguageId, dwMilliseconds );

   hb_retni( iRet );
}

#pragma ENDDUMP

Warning W8080:'PtrToPtr64' is declared but never

Enviado: 13 Dez 2023 14:36
por JoséQuintas
Quando dá erro na compilação mostra em qual linha ocorreu, parece desnecessário mostrar tanto fonte, que parece nem ter a ver com o erro.
O erro é sobre declarar variável e não usar pra nada - talvez - porque a mensagem de erro parece incompleta

"'PtrToPtr64' is declared but never"

Warning W8080:'PtrToPtr64' is declared but never

Enviado: 14 Dez 2023 06:32
por deividdjs
pois é Zé .. se eu soubesse o lugar exato onde fosse o erro eu postaria somente essa parte kkkkk, porém é quando eu compilo essa parte no meu sistema q apresenta a mensagem .. e ja procurei em toda parte e não encontrei ..

mesmo assim obrigado pela ajuda ... vc sempre é um cara muito prestativo ... Abraço! fique com Deus ...

Warning W8080:'PtrToPtr64' is declared but never

Enviado: 14 Dez 2023 07:47
por JoséQuintas
faça o find in files, e procure pelo nome, incluindo PRG, CH e H.
Também pode evitar fonte C e tentar implementar de outra forma.

Nota: pelo nome da variável, alguma conversão de pointer 32 bits pra 64 bits.

Warning W8080:'PtrToPtr64' is declared but never

Enviado: 14 Dez 2023 07:58
por marcosgambeta
Este 'warning' é inofensivo, podendo ser simplesmente ignorado. Mas se quer eliminar o aviso, veja se dá certo assim:

Código: Selecionar todos

HB_SYMBOL_UNUSED(PtrToPtr64);
#pragma ENDDUMP
Note que a linha deve ser inserida antes do #pragma ENDDUMP.

Experimente, por favor, e informe o resultado.

Warning W8080:'PtrToPtr64' is declared but never

Enviado: 14 Dez 2023 08:15
por marcosgambeta
Caso o HB_SYMBOL_UNUSED não funcione, experimente também esta outra (possível) solução:

Código: Selecionar todos

#ifdef PtrToPtr64
#undef PtrToPtr64
#endif
Se estiver usando o BCC 5.8, então se trataria desta macro definida no arquivo basetsd.h do compilador:

Código: Selecionar todos

#define PtrToPtr64( p )         ((void * POINTER_64) p)

Warning W8080:'PtrToPtr64' is declared but never

Enviado: 14 Dez 2023 09:18
por marco.prodata
JoséQuintas escreveu:faça o find in files, e procure pelo nome, incluindo PRG, CH e H.
Também pode evitar fonte C e tentar implementar de outra forma.

Nota: pelo nome da variável, alguma conversão de pointer 32 bits pra 64 bits.
Por curiosidade fiz o findstr em todo o código do harbour (*.prg, *.c, *.ch, *.h), e não achei nenhuma menção a ptrtopr, estranho.

Warning W8080:'PtrToPtr64' is declared but never

Enviado: 15 Dez 2023 12:11
por deividdjs
marcosgambeta escreveu:Caso o HB_SYMBOL_UNUSED não funcione, experimente também esta outra (possível) solução:

Código: Selecionar todos

#ifdef PtrToPtr64
#undef PtrToPtr64
#endif
Se estiver usando o BCC 5.8, então se trataria desta macro definida no arquivo basetsd.h do compilador:

Código: Selecionar todos

#define PtrToPtr64( p )         ((void * POINTER_64) p)
Exatamente Marcos .. uso BCC 5.8 e o find que fiz deu justamente neste arquivo basetsd.h // e as duas soluçoes que vc apresentou tbm não funcionaram .. deu este erro na imagem em anexo .

mesmo assim obrigado pela disposição !

Abraço irmão ...