ayuda con api harbour

ayuda con api harbour

Postby carlos vargas » Tue Feb 18, 2020 6:47 pm

Estimados, ayuda sera agradecida:
tengo este programa en el cual quiero implementar una función api de windows
necesito verificar que los primeros dos parametros son en Wide, ver si es posible usar el conocido hb_parc, lo otro es ver si funciona, no se como seria sacar la info, me parece que lo mejor es crear un array, pero no he sacado ni un valor aun.

gracias
carlos

Code: Select all  Expand view
procedure main()
   ?NetGroupGetUsers( NIL, "Usuarios" )
return

#pragma BEGINDUMP

#include <windows.h>
#include <lmaccess.h>

#include "hbapi.h"
#include "hbvm.h"
#include "hbapiitm.h"

void DimeC( char *szText )
{
   MessageBox( NULL, szText, "Debug", MB_ICONINFORMATION|MB_SYSTEMMODAL );
}

void DimeN( LONG lNum )
{
   char szBuffer[ 80 ];
   wsprintf( szBuffer, "%ld", lNum );

   DimeC( szBuffer );
}

/*

NET_API_STATUS NET_API_FUNCTION NetGroupGetUsers(
  LPCWSTR    servername,
  LPCWSTR    groupname,
  DWORD      level,
  LPBYTE     *bufptr,
  DWORD      prefmaxlen,
  LPDWORD    entriesread,
  LPDWORD    totalentries,
  PDWORD_PTR ResumeHandle );

typedef struct _GROUP_USERS_INFO_0 {
  LPWSTR grui0_name;
} GROUP_USERS_INFO_0, *PGROUP_USERS_INFO_0, *LPGROUP_USERS_INFO_0;

typedef struct _GROUP_USERS_INFO_1 {
  LPWSTR grui1_name;
  DWORD  grui1_attributes;
} GROUP_USERS_INFO_1, *PGROUP_USERS_INFO_1, *LPGROUP_USERS_INFO_1;

*/


//Use: NetGroupGetUser( cServerName, cGlobalUsersName )
//     cServerName      -> DNS or NetBIOS name of the remote server on which the function is to execute.
//                         If this parameter is NIL, the local computer is used.
//     cGlobalUsersName -> String that specifies the name of the global group whose members are to be listed.

HB_FUNC( NETGROUPGETUSERS )
{
  LPCWSTR szServer = (LPCWSTR) hb_parc( 1 );
  LPCWSTR szGroup  = (LPCWSTR) hb_parc( 2 );
  DWORD dwLevel = 0;
  BYTE *pBuffer = NULL;
  DWORD dwEntriesRead = 0, dwTotalEntries = 0;
  NET_API_STATUS stat;

  stat = NetGroupGetUsers( szServer,
                           szGroup,
                           dwLevel,
                           &pBuffer,
                           MAX_PREFERRED_LENGTH,
                           &dwEntriesRead,
                           &dwTotalEntries,
                           NULL );

  DimeN( (LONG) stat );
  DimeN( (LONG) dwEntriesRead );
  DimeN( (LONG) dwTotalEntries );
 
  hb_retc( "POR HACER" );
}

#pragma ENDDUMP
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1707
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: ayuda con api harbour

Postby Antonio Linares » Wed Feb 19, 2020 10:28 am

Carlos,

Revisa source\winapi\icons.c y busca fw_parWide( 1 );
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41715
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ayuda con api harbour

Postby carlos vargas » Wed Feb 19, 2020 4:46 pm

Gracias antonio con eso tengo para continuar.
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1707
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 92 guests