FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Como adiciono esta funcion a mi ejecutable
Posts: 225
Joined: Tue Feb 28, 2006 04:25 PM

Como adiciono esta funcion a mi ejecutable

Posted: Thu Nov 27, 2008 09:40 PM

Amigos necesito esta funcion como la agrego a mi aplicacion

pragma BEGINDUMP

include <hbapi.h>

include <windows.h>

CLIPPER ISEXERUNNING( PARAMS ) // ( cExeNameCaseSensitive ) --> lResult
{
HANDLE hMutex = CreateMutex( NULL, TRUE, ( LPTSTR ) _parc( 1 ) );

_retl( GetLastError() == ERROR_ALREADY_EXISTS );

ReleaseMutex( hMutex );
}

pragma ENDDUMP

hago esto pero no lo reconoce

ME INTERESA FW Y XHB POR SER OPEN SOURCE
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Como adiciono esta funcion a mi ejecutable

Posted: Thu Nov 27, 2008 10:58 PM
Vladimir,

Hazlo asi:
#pragma BEGINDUMP 

#include <hbapi.h> 
#include <windows.h> 

HB_FUNC( ISEXERUNNING ) // ( cExeNameCaseSensitive ) --> lResult 
{ 
   HANDLE hMutex = CreateMutex( NULL, TRUE, ( LPTSTR ) hb_parc( 1 ) ); 

   hb_retl( GetLastError() == ERROR_ALREADY_EXISTS ); 

   ReleaseMutex( hMutex ); 
} 

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion