4
« Posteado: July 09, 2020, 06:21:58 PM »
Hola buenas Alguien que me pueda ayudar ??? Me sale error al momento de compliar cuando agrego la funcion:
//agregar la función en gameserver.h
std::map<std::string,IP_ADDRESS_INFO>::iterator it;
std::map<std::string,IP_ADDRESS_INFO>::iterator buscador;
LRESULT CALLBACK IPBanned(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam) // OK
{
switch(message)
{
case WM_INITDIALOG:
hWndComboBox1 = GetDlgItem(hDlg, IDC_LIST2);
if( !hWndComboBox1 )
{
MessageBox(hDlg,
"Could not create the combo box",
"Failed Control Creation",
MB_OK);
return FALSE;
}
for ( it = gIpManager.m_IpAddressInfo.begin(); it != gIpManager.m_IpAddressInfo.end(); it++ )
{
if(it->second.IpBlocked == 1){
char fulltext[16];
wsprintf(fulltext,"%s",it->second.IpAddress);
int index = SendMessage(hWndComboBox1, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((LPCTSTR)fulltext));
SendMessage(hWndComboBox1, LB_SETITEMDATA, (WPARAM) index, (LPARAM) it->second.IpAddress);
}
}
return 1;
case WM_COMMAND:
if(LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg,LOWORD(wParam));
return 1;
}
else if(LOWORD(wParam) == IDC_DISBAND)
{
int itemIndex = (int) SendMessage(hWndComboBox1, LB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
if (itemIndex == LB_ERR)
{
return 0;
}
// Getdata
char* s = (char*) SendMessage(hWndComboBox1, LB_GETITEMDATA, itemIndex, 0);
for ( buscador = gIpManager.m_IpAddressInfo.begin(); buscador != gIpManager.m_IpAddressInfo.end(); buscador++ )
{
if(buscador->second.IpAddress == s){
buscador->second.IpBlocked = 0;
char fulltext[16];
wsprintf(fulltext,"%s",buscador->second.IpAddress);
MessageBox(hDlg, fulltext, "Confirm", MB_OK);
}
}
}
break;
}
return 0;
}