Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > C/C++: Базы данных > как связать указатель со структурой


Автор: gibz 20.1.2007, 18:26
модераторам:
перенесите в соответствующую тему, просматривал не ту ветку форума, запостил не туда куда надо.
сорри.
функция
Код

DWORD MprAdminPortEnum(
  RAS_SERVER_HANDLE hRasServer,
  DWORD dwLevel,
  HANDLE hConnection,
  LPBYTE* lplpbBuffer,
  DWORD dwPrefMaxLen,
  LPDWORD lpdwEntriesRead,
  LPDWORD lpdwTotalEntries,
  LPDWORD lpdwResumeHandle
);


Parameters

hRasServer
[in] A handle to the RAS server whose ports are to be enumerated. To obtain this handle, call MprAdminServerConnect.
dwLevel
[in] A value that specifies the level of data that is returned in the enumeration. This parameter must be zero.
hConnection
[in] A handle to a connection for which the active ports are enumerated. If this parameter is INVALID_HANDLE_VALUE, all the ports in use or available for use by RRAS are enumerated. To obtain this handle, call MprAdminConnectionEnum.
lplpbBuffer
[out] A pointer to a pointer variable that, on a successful return, points to an array of RAS_PORT_0. To free this memory, call MprAdminBufferFree.
dwPrefMaxLen
[in] A value that specifies the preferred maximum length of returned data, in 8-bit bytes. If this parameter is -1, the buffer that is returned is large enough to hold all available data.
lpdwEntriesRead
[out] A pointer to a DWORD variable. This variable receives the total number of ports that are enumerated from the current resume position.
lpdwTotalEntries
[out] A pointer to a DWORD variable. This variable receives the total number of ports that could have been enumerated from the current resume position.
lpdwResumeHandle
[in] A pointer to a DWORD variable. On successful execution, this parameter specifies a handle that can be used to resume the enumeration. This parameter should be zero on the first call and left unchanged on subsequent calls. If the return code is ERROR_MORE_DATA, the call can be reissued with the handle to retrieve more data. If the handle is NULL on return, the enumeration cannot be continued. This handle is invalid for other types of error returns.


структура
Код

typedef struct _RAS_CONNECTION_0 {
  HANDLE hConnection;
  HANDLE hInterface;
  DWORD dwConnectDuration;
  ROUTER_INTERFACE_TYPE dwInterfaceType;
  DWORD dwConnectionFlags;
  WCHAR wszInterfaceName[MAX_INTERFACE_NAME_LEN + 1];
  WCHAR wszUserName[UNLEN + 1];
  WCHAR wszLogonDomain[DNLEN + 1];
  WCHAR wszRemoteComputer[NETBIOS_NAME_LEN + 1];
} RAS_CONNECTION_0, 
 *PRAS_CONNECTION_0;


пишу так
Код

RAS_CONNECTION_0* RasCon0;
MprAdminConnectionEnum(ServerHandle,0,&RasCon0,0,&EntRead,&TotEnt,&Resume);

компилятор ругается

Код

error C2664: 'MprAdminConnectionEnum' : cannot convert parameter 3 from 'struct _RAS_CONNECTION_0 ** ' to 'unsigned char ** '


Автор: nworm 20.1.2007, 20:47
Функция MprAdminConnectionEnum не описана.
http://sources.ru/qq.php?showtopic=78956 вроде есть что-то похожее на правильный вызов подобной функции

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)