Les Forums

Les Forums

Les forums sont fermés. Ils restent présent pour consultation et archivage.
Vous pouvez désormais poser vos questions directement dans les commentaires en bas de chaque page du site.
Alors n'hésitez pas à participer

Discuter avec plusieurs cartes réseaux de meme ip

Bonjour

J'ai besoin de pouvoir controler plusieurs cartes réseaux d'un meme pc , chaque carte étant reliée à une machine isolée ayant toujours la meme ip.

Mon problème vient du fait que je ne sais pas différencier les cartes en TCP. Comment faut il faire ?


Merci d'avance pour votre aide.
Un petit bout de code pioché dans une de mes applis pourrait *peut-etre* t'aider:
[code:1:0313e1841e]DWORD dwBufLen = sizeof(m_AdapterInfo); // Save the memory size of buffer

DWORD dwStatus = GetAdaptersInfo( // Call GetAdapterInfo
m_AdapterInfo, // [out] buffer to receive data
&dwBufLen); // [in] size of receive data buffer

PIP_ADAPTER_INFO pAdapterInfo = m_AdapterInfo; // Contains pointer to current adapter info

switch (dwStatus)
{
case NO_ERROR:
do
{
// Add NIC Adapters in ComboBox
m_AdapterList.AddString(pAdapterInfo->Description);
pAdapterInfo = pAdapterInfo->Next; // Progress through linked list
}
while(pAdapterInfo);
break;
case ERROR_BUFFER_OVERFLOW:
AfxMessageBox("Error: The buffer to hold the adapter information is not large enough.");
break;
case ERROR_INVALID_PARAMETER:
AfxMessageBox("Error: Unable to write to the memory allocated.");
break;
case ERROR_NO_DATA:
AfxMessageBox("Error: No adapter information exists for the local computer.");
break;
case ERROR_NOT_SUPPORTED:
AfxMessageBox("Error: Function not supported by the operating system running\non the local computer.");
break;
default:
AfxMessageBox("Error: Adapter information call failed.");
theApp.m_pMainWnd->PostMessage(WM_QUIT);
}[/code:1:0313e1841e]