Click here to Skip to main content
15,922,007 members
Home / Discussions / Mobile
   

Mobile

 
GeneralRe: Controlling PC with mobile phone Pin
vikas amin5-Nov-05 4:00
vikas amin5-Nov-05 4:00 
Questioninterfacing MMC card with rabbit core module RCM 3100 Pin
amitgh21-Sep-05 20:26
amitgh21-Sep-05 20:26 
Questionconnecting my WindowsCE project to a Windows2000 desktop PC via ActiveSync Pin
mark.thornhill21-Sep-05 0:18
mark.thornhill21-Sep-05 0:18 
QuestionGetIfTable return error ERROR_INVALID_PARAMETER Pin
GiuseppeZarbo19-Sep-05 1:58
GiuseppeZarbo19-Sep-05 1:58 
I'm developing a pocket pc application that monitoring the gprs traffic,
to do this I found this article:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iphlp/iphlp/getiftable.asp

This is my code:
// Declare and initialize variables
PMIB_IFTABLE ifTable;
PMIB_IFROW pMibIfRow;

DWORD dwSize = 0;
DWORD dwRetVal = 0;

// Allocate memory for our pointers
ifTable = (MIB_IFTABLE*) malloc(sizeof(MIB_IFTABLE));
pMibIfRow = (MIB_IFROW*) malloc(sizeof(MIB_IFROW));


// Make an initial call to GetIfTable to get the
// necessary size into the dwSize variable
if (GetIfTable(ifTable, &dwSize, 0) == ERROR_INSUFFICIENT_BUFFER){
GlobalFree(ifTable);
ifTable = (MIB_IFTABLE *) malloc (dwSize);
}

// Make a second call to GetIfTable to get the
// actual data we want
if ((dwRetVal = GetIfTable(ifTable, &dwSize, 0)) == NO_ERROR) {

if (ifTable->dwNumEntries > 0){
for(DWORD i=0; i< ifTable->dwNumEntries; i++){
MIB_IFROW mir = ifTable->table[i];
if(mir.dwType == MIB_IF_TYPE_PPP){
DWORD dwTotal = mir.dwInOctets + mir.dwOutOctets;
return dwTotal;
}
}
}
}
else{

STLOG_WRITE("Errore in GetIfTable %d",dwRetVal);

}
GlobalFree(ifTable);
return 0;

This code work good for about 3 hours, but for an unknow reason the function GetIfTable return ERROR_INVALID_PARAMETER, and I don't understand why.

Can someone help me?

Thanks

Giuseppe
Questionbluetooth printing Pin
Fer Simoes16-Sep-05 11:40
professionalFer Simoes16-Sep-05 11:40 
Questionports Pin
_tasleem15-Sep-05 22:48
_tasleem15-Sep-05 22:48 
AnswerRe: ports Pin
Fer Simoes16-Sep-05 11:43
professionalFer Simoes16-Sep-05 11:43 
GeneralRe: ports Pin
_tasleem16-Sep-05 19:35
_tasleem16-Sep-05 19:35 
Questionupdating Compact Framework Pin
David Menéndez Cisterna14-Sep-05 12:41
David Menéndez Cisterna14-Sep-05 12:41 
QuestionListBox Control key press event Pin
Sachin Xavier13-Sep-05 23:20
Sachin Xavier13-Sep-05 23:20 
QuestionMultiple checks of files during Debug Pin
Jim Berg13-Sep-05 9:49
Jim Berg13-Sep-05 9:49 
QuestionCompact Framework strange Exception Pin
David Menéndez Cisterna13-Sep-05 2:20
David Menéndez Cisterna13-Sep-05 2:20 
QuestionFAX from Pocket PC ? Pin
mcdok12-Sep-05 4:37
mcdok12-Sep-05 4:37 
QuestionHelp me!!!!! Detecting change in data streams Pin
bulgaa12-Sep-05 3:06
bulgaa12-Sep-05 3:06 
QuestionMultiple Tables in a Dataset from multiple XML Files? Pin
maf66611-Sep-05 22:34
maf66611-Sep-05 22:34 
AnswerRe: Multiple Tables in a Dataset from multiple XML Files? Pin
cyberexel7-Dec-10 16:50
cyberexel7-Dec-10 16:50 
QuestionScreen Rotation Pin
George Papadopoulos11-Sep-05 22:07
George Papadopoulos11-Sep-05 22:07 
Questionactivate BT via code? Pin
Roger Alsing11-Sep-05 21:26
Roger Alsing11-Sep-05 21:26 
QuestionRe: activate BT via code? Pin
Jumba666623-Mar-06 9:49
Jumba666623-Mar-06 9:49 
AnswerRe: activate BT via code? Pin
Roger Alsing23-Mar-06 23:34
Roger Alsing23-Mar-06 23:34 
QuestionStartbar Pin
CSharpDavid9-Sep-05 6:42
CSharpDavid9-Sep-05 6:42 
QuestionOverload CompareItem to sort a ListBox Pin
Member 105720787-Sep-05 12:13
Member 105720787-Sep-05 12:13 
Questionset focus to next edit box Pin
sandem7-Sep-05 8:57
sandem7-Sep-05 8:57 
AnswerRe: set focus to next edit box Pin
João Paulo Figueira7-Sep-05 22:45
professionalJoão Paulo Figueira7-Sep-05 22:45 
GeneralRe: set focus to next edit box Pin
sandem8-Sep-05 2:04
sandem8-Sep-05 2:04 

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.