Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to open an old VC++ 6 project in Visual Studio .NET 2003? Pin
Manfred Staiger20-Jan-05 1:21
Manfred Staiger20-Jan-05 1:21 
AnswerRe: How to open an old VC++ 6 project in Visual Studio .NET 2003? Pin
Mike Dimmick20-Jan-05 1:51
Mike Dimmick20-Jan-05 1:51 
QuestionHow to arrange toolbars side by side in row in Inplace Activation (VC++) App Pin
RajeevKANTA20-Jan-05 0:30
RajeevKANTA20-Jan-05 0:30 
Generalaccess violation on win2000 service pack 4 Pin
attias gabi19-Jan-05 21:35
attias gabi19-Jan-05 21:35 
Generalaccess violation on win2000 service pack 4 Pin
attias gabi19-Jan-05 21:35
attias gabi19-Jan-05 21:35 
GeneralRe: access violation on win2000 service pack 4 Pin
Neville Franks19-Jan-05 22:16
Neville Franks19-Jan-05 22:16 
GeneralRe: access violation on win2000 service pack 4 Pin
attias gabi20-Jan-05 11:03
attias gabi20-Jan-05 11:03 
Generalout of memory error Pin
vc-programmer-19-Jan-05 21:03
vc-programmer-19-Jan-05 21:03 
when i run this code,message box appear "out of memory error".

someone please explain me.Why?
following my code--->>

void CIPAddressDlg::OnButton1()
{
CListBox *pList = (CListBox*) GetDlgItem(IDC_LIST2);
pList->ResetContent();

PMIB_IPNETTABLE pIPNetTable = NULL;
PMIB_IPNETROW pIPNetRow;
in_addr ia;
char *szTypes[4] = {"Other", "Invalid", "Dynamic", "Static"};


GetIpNetTable((PMIB_IPNETTABLE) m_pBuffer, &m_ulSize, TRUE);
m_pBuffer = new BYTE[m_ulSize];
if (NULL != m_pBuffer)
{
pList->AddString("Start get ip net table");
m_dwResult = GetIpNetTable((PMIB_IPNETTABLE) m_pBuffer, &m_ulSize, TRUE);
if (m_dwResult == NO_ERROR)
{
pIPNetTable = (PMIB_IPNETTABLE) m_pBuffer;

for ( unsigned int x = 0; x < pIPNetTable->dwNumEntries; x++)
{
pIPNetRow = &(pIPNetTable->table[x]);

m_strText.Format(" Index: %lu\r\n", pIPNetRow->dwIndex);
pList->AddString(m_strText);

m_strText.Format("MAC address length: %lu\r\n", pIPNetRow->dwPhysAddrLen);
pList->AddString(m_strText);

m_strText.Format(" MAC address: %02x-%02x-%02x-%02x-%02x-%02x\r\n",
pIPNetRow->bPhysAddr[0],
pIPNetRow->bPhysAddr[1],
pIPNetRow->bPhysAddr[2],
pIPNetRow->bPhysAddr[3],
pIPNetRow->bPhysAddr[4],
pIPNetRow->bPhysAddr[5]);
pList->AddString(m_strText);

ia.S_un.S_addr = pIPNetRow->dwAddr;
m_strText.Format(" IP address: %s\r\n", inet_ntoa(ia));
pList->AddString(m_strText);

m_strText.Format(" Type: %s\r\n", szTypes[pIPNetRow->dwType - 1]);
pList->AddString(m_strText);

}
}
else
{
m_strText.Format("GetIpNetTable() failed.Result = %lu\r\n", m_dwResult);
pList->AddString(m_strText);
}

delete [] m_pBuffer;
}
}
GeneralRe: out of memory error Pin
Le Ridder Noir19-Jan-05 22:48
Le Ridder Noir19-Jan-05 22:48 
GeneralRe: out of memory error Pin
Mike Dimmick20-Jan-05 2:16
Mike Dimmick20-Jan-05 2:16 
GeneralGetKeyState Pin
vidhyas19-Jan-05 21:03
vidhyas19-Jan-05 21:03 
GeneralRe: GetKeyState Pin
Neville Franks19-Jan-05 22:15
Neville Franks19-Jan-05 22:15 
GeneralRe: GetKeyState Pin
vidhyas19-Jan-05 22:19
vidhyas19-Jan-05 22:19 
GeneralRe: GetKeyState Pin
Neville Franks19-Jan-05 22:26
Neville Franks19-Jan-05 22:26 
GeneralRe: GetKeyState Pin
vidhyas19-Jan-05 22:40
vidhyas19-Jan-05 22:40 
GeneralRe: GetKeyState Pin
Neville Franks20-Jan-05 0:40
Neville Franks20-Jan-05 0:40 
GeneralRe: GetKeyState Pin
Anonymous20-Jan-05 2:45
Anonymous20-Jan-05 2:45 
Generalcdhtmldialog Pin
lirik19-Jan-05 19:47
lirik19-Jan-05 19:47 
GeneralRe: cdhtmldialog Pin
Neville Franks19-Jan-05 22:33
Neville Franks19-Jan-05 22:33 
GeneralVC7 IDE - Custom Document Editors Pin
peterchen19-Jan-05 19:17
peterchen19-Jan-05 19:17 
QuestionHow to detect the activity of specified device? Pin
ErisonWu19-Jan-05 18:51
ErisonWu19-Jan-05 18:51 
Generaltitle bar Pin
Member 2996919-Jan-05 18:04
Member 2996919-Jan-05 18:04 
GeneralRe: title bar Pin
namaskaaram19-Jan-05 18:19
namaskaaram19-Jan-05 18:19 
GeneralRe: title bar Pin
Member 2996919-Jan-05 20:07
Member 2996919-Jan-05 20:07 
GeneralRe: title bar Pin
toxcct20-Jan-05 2:19
toxcct20-Jan-05 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.