![]() |
|
|
![]()
|
|
| Kobalt |
|
|||
|
Unregistered |
Господа пишу прогу на С++ но зашёл в тупик. На компьютере XP SP2, сеть, права Администратора
при запуске программы выдается странная ошибка код 50. перебрал все варианты подскажите где я ошибся? #pragma hdrstop #include <windows.h> #include <lmcons.h> // constants needed for other lm*.h includes #include <lmserver.h> // for NerServerEnum #include <lmshare.h> // for NetEnumShares #include <lmerr.h> // for error constants #include <lmremutl.h> // for RemoteTOD #include <lmapibuf.h> // for NetApiBufferFree #include <lmmsg.h> // for NetMessageNameEnum #include <lmrepl.h> // for NetReplExportDirEnum #include <lmat.h> // for NetScheduleJobEnum #include <lmstats.h> // for NetStatisticsGet #include <rassapi.h> // for RasAdminPortEnum #include <iostream.h> //--------------------------------------------------------------------------- const char *StrError(DWORD err) { static char retbuff[1024]; if (err == 0) strcpy(retbuff, "\n"); else FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, retbuff, 1024, NULL); if (strlen(retbuff) == 0) strcpy(retbuff, "\n"); return retbuff; } DWORD DoNetStatisticsGet(LPWSTR RemoteName, LPWSTR ServiceName, DWORD Level ) { NET_API_STATUS netapistatus; LPBYTE ptb; printf("NetStatisticsGet(%S) Level %u:\n", ServiceName, Level); netapistatus = NetStatisticsGet(0, (wchar_t *)ServiceName, Level, 0, &ptb); if (netapistatus != NERR_Success || ptb == NULL) { printf("Error %d getting statistics: %s", netapistatus, "" ); MessageBoxA(0, StrError(netapistatus), "Bad!!!", MB_OK); } else { if (wcscmp(ServiceName, L"SERVER") == 0) { STAT_SERVER_0 *pstatserver0 = (STAT_SERVER_0 *)ptb; } else if (wcscmp(ServiceName, L"WORKSTATION") == 0) { STAT_WORKSTATION_0 *pstatworkstation0 = (STAT_WORKSTATION_0 *)ptb; } puts("Not yet implemented"); NetApiBufferFree(ptb); } return netapistatus; } #pragma argsused int main(int argc, char* argv[]) { DoNetStatisticsGet(L"192.168.0.77", L"WORKSTATION", 0); return 0; } |
|||
|
||||
![]()
|
| Правила форума "С++ Builder" | |
|
|
Запрещается! 1. Публиковать ссылки на вскрытые компоненты 2. Обсуждать взлом компонентов и делиться вскрытыми компонентами
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Rrader. |
| 0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
| 0 Пользователей: | |
| « Предыдущая тема | C++ Builder | Следующая тема » |
|
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |