Click here to Skip to main content
15,918,889 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to create delay. Pin
Sameer Maggon6-May-02 22:27
Sameer Maggon6-May-02 22:27 
GeneralTime Delay in rendering(DirectX) Pin
VCRamesh6-May-02 21:26
VCRamesh6-May-02 21:26 
GeneralRe: Time Delay in rendering(DirectX) Pin
Sameer Maggon7-May-02 0:06
Sameer Maggon7-May-02 0:06 
GeneralRe: Time Delay in rendering(DirectX) Pin
VCRamesh7-May-02 1:51
VCRamesh7-May-02 1:51 
Generalprinting bitmap problem Pin
BlackRider6-May-02 20:59
BlackRider6-May-02 20:59 
GeneralRe: printing bitmap problem Pin
Jonathan Craig7-May-02 5:33
Jonathan Craig7-May-02 5:33 
GeneralValidate a IP in CString Pin
Sameer Maggon6-May-02 20:08
Sameer Maggon6-May-02 20:08 
GeneralRe: Validate a IP in CString Pin
moliate7-May-02 7:50
moliate7-May-02 7:50 
Sample function for verifing that the address has format like:

XXX.XXX.XXX.XXX

where XXX is a number between 0 and 255

bool CDummyDlg::checkIP(char *ip)
{char* tmpIP = ip; // local copy of string pointer
 char* tmpNR = new char[4]; // holder for group between dots
 bool OK = true;	
 memset(tmpNR,0,4);

 int len = 0, groups = 0; // len = length of chars between dots, groups = number of groups in ip 	

 do
 {if (*tmpIP >= '0' && *tmpIP <= '9') // 1) Building number
	if(len < 4)
		tmpNR[len++] = *tmpIP;
	else
		OK = false; // number consists of more than 3 digits

  else if('.' == *tmpIP || 0 == *tmpIP)  // 2) Verify number
  {if (atoi(tmpNR) > 255)
	   OK=false; // to large number between points
   memset(tmpNR,0,4);	
   len = 0;
   groups++;
  }
  else
	  OK = false; // other character encountered
 }
 while(*tmpIP++ && OK);
 delete tmpNR;
 return OK && (4 == groups); //four groups between dots 
}


I inserted a lot of comments, hoping it would be easier to read.

/moliate

Two o'clock and walking through familiar London - Or what was familiar London before the cursor deleted certain certainties -
I watch a suit and tie man giving suck to the Psion Organizer lodged in his breast pocket
its serial interface like a cool mouth hunting his chest for sustenance, familiar feeling, and I'm watching my breath steam in the air.

Neil Gaiman - Cold Colours


GeneralCritical Sections (Semaphores etc..) Pin
Sameer Maggon6-May-02 20:04
Sameer Maggon6-May-02 20:04 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Joaquín M López Muñoz6-May-02 21:03
Joaquín M López Muñoz6-May-02 21:03 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Sameer Maggon6-May-02 21:12
Sameer Maggon6-May-02 21:12 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Joaquín M López Muñoz6-May-02 21:15
Joaquín M López Muñoz6-May-02 21:15 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Sameer Maggon6-May-02 21:30
Sameer Maggon6-May-02 21:30 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Sameer Maggon6-May-02 21:36
Sameer Maggon6-May-02 21:36 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Joaquín M López Muñoz6-May-02 22:20
Joaquín M López Muñoz6-May-02 22:20 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Jonathan Craig7-May-02 7:29
Jonathan Craig7-May-02 7:29 
GeneralGetOverlapedresult Pin
meirav6-May-02 19:24
meirav6-May-02 19:24 
GeneralDetermining Data Size For Network Send/Rec :: Winsock Pin
valikac6-May-02 18:55
valikac6-May-02 18:55 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
Niklas L6-May-02 21:24
Niklas L6-May-02 21:24 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
valikac6-May-02 21:38
valikac6-May-02 21:38 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
Rickard Andersson206-May-02 21:45
Rickard Andersson206-May-02 21:45 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
6-May-02 21:56
suss6-May-02 21:56 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
Rickard Andersson206-May-02 23:48
Rickard Andersson206-May-02 23:48 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
6-May-02 23:58
suss6-May-02 23:58 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
valikac7-May-02 4:49
valikac7-May-02 4:49 

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.