Click here to Skip to main content
16,009,068 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Question about raw socket. Pin
Moak10-Apr-03 22:49
Moak10-Apr-03 22:49 
GeneralRe: Question about raw socket. Pin
George211-Apr-03 3:21
George211-Apr-03 3:21 
GeneralRe: Question about raw socket. Pin
geo_m10-Apr-03 22:53
geo_m10-Apr-03 22:53 
GeneralRe: Question about raw socket. Pin
George211-Apr-03 3:23
George211-Apr-03 3:23 
GeneralFormat VARIANT VT_DATE to MM/DD/YYYY fixed format Pin
Vikrant Vikrant10-Apr-03 22:03
Vikrant Vikrant10-Apr-03 22:03 
GeneralRe: Format VARIANT VT_DATE to MM/DD/YYYY fixed format Pin
Hans Ruck10-Apr-03 22:15
Hans Ruck10-Apr-03 22:15 
GeneralRe: Format VARIANT VT_DATE to MM/DD/YYYY fixed format Pin
Vikrant Vikrant10-Apr-03 22:45
Vikrant Vikrant10-Apr-03 22:45 
Generalproblem with undeclared identifire in my IP parser project Pin
Reza Shademani10-Apr-03 20:41
Reza Shademani10-Apr-03 20:41 
hi mates;
look at here at first :
//stripdec.h
#pragma once
#ifndef ipaddressing_strIPdec
#define ipaddressing_strIPdec
#include "stdafx.h"
using namespace std;
using std::string;
typedef unsigned long ulong;
// strIPDec in order to deploying A.B.C.D strandard IP address from plain
// string a.b.c.d
namespace stripdec
{
class StrIPGet
{
public :
StrIPGet();//constructor
string get();//getting input string a.b.c.d
void findindex();//finding index of each '.' in the string
void setseg();//now we have A.B.C.D which each segemnt is in digit form.
private:
string _inputstr;
short inpindex[3];
string segment[4];

};
class StrToDec
{

public:
ulong conv(string& _segstr);
};

}
//
#endif


////////////////
//stripdec.cpp

// strIPdec.cpp : Defines the entry point for the DLL application.
//

#include "stripdec.h"
#include "stdafx.h"
using namespace std;
using namespace stripdec;
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}


//start
//------------------------------------------
string StrIPGet::get()
{

int count=0;
do
{
getline(cin,_inputstr,' ');
int j = _inputstr.find('.');
// While not at the end of the string:
while(j != _inputstr.npos)
{
count++
//find the next '.'
j = _inputstr.find('.', j);
}
if (count != 3)cout<<"invalid IP address ,try again."<<"\n";
}
while (count != 3)

//input is plain a.b.c.d along with error recovery.
}
//------------------------------------------
StrIPGet::StrIPGet()
{
inputstr.clear();//init...clearing an input string
}
//------------------------------------------
void StrIPGet::findindex()
{
for(j=0;j<=2;j++)
{
inpindex[j]=_inputstr.find('.',j);
}
}
//-------------------------------------------
void StrIPGet::setseg()
{
segment[0]=_inputstr.substr(0,inpindex[0]-0);
segment[1]=_inputstr.substr(inpindex[0],inpindex[1]-inpindex[0]);
segment[2]=_inputstr.substr(inpindex[1],inpindex[2]-inpindex[1]);
segment[3]=_inputstr.substr(inpindex[2],input.end-inpindex[2]);
}
//-------------------------------------------
ulong StrToDec::conv(string& _segstr)
{
return strtoul(_segstr);
}



errors :
/////////////////////
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(25): error C2065: '_inputstr' : undeclared identifier
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(26): error C2228: left of '.find' must have class/struct/union type
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(28): error C2228: left of '.npos' must have class/struct/union type
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(19): error C2653: 'StrIPGet' : is not a class or namespace name
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(5): error C2859: e:\codes\ip_addressing_solution\april11 ,2003\stripdec\debug\vc70.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header.
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(7): error C2871: 'stripdec' : a namespace with this name does not exist
e:\codes\IP_Addressing_solution\April11 ,2003\strIPdec\stripdec.cpp(28): fatal error C1903: unable to recover from previous error(s); stopping compilation




//////


so what is the problem here;


thank u for u'r comments;
bye;
GeneralRe: problem with undeclared identifire in my IP parser project Pin
Hans Ruck10-Apr-03 22:41
Hans Ruck10-Apr-03 22:41 
Generalnetwork programming Pin
staunch10-Apr-03 20:02
staunch10-Apr-03 20:02 
GeneralRe: network programming Pin
Prudhvi Raju10-Apr-03 21:57
Prudhvi Raju10-Apr-03 21:57 
GeneralRe: network programming Pin
staunch11-Apr-03 5:48
staunch11-Apr-03 5:48 
GeneralRe: network programming Pin
IceMatrix11-Apr-03 6:47
IceMatrix11-Apr-03 6:47 
GeneralRe: network programming Pin
Prudhvi Raju11-Apr-03 15:38
Prudhvi Raju11-Apr-03 15:38 
GeneralCOLORREF Pin
Anonymous10-Apr-03 19:13
Anonymous10-Apr-03 19:13 
GeneralRe: COLORREF Pin
Rage10-Apr-03 23:13
professionalRage10-Apr-03 23:13 
GeneralRe: COLORREF Pin
imsniper11-Apr-03 0:00
imsniper11-Apr-03 0:00 
GeneralRe: COLORREF Pin
JohnnyG13-Apr-03 17:27
JohnnyG13-Apr-03 17:27 
GeneralHelp, In adding Subtitle Pin
Prudhvi Raju10-Apr-03 18:43
Prudhvi Raju10-Apr-03 18:43 
GeneralComparing values Pin
Ohaiyo10-Apr-03 17:11
Ohaiyo10-Apr-03 17:11 
GeneralRe: Comparing values Pin
Rage10-Apr-03 23:22
professionalRage10-Apr-03 23:22 
GeneralRe: Comparing values Pin
Ohaiyo11-Apr-03 15:14
Ohaiyo11-Apr-03 15:14 
GeneralRe: Comparing values Pin
Toni7811-Apr-03 22:28
Toni7811-Apr-03 22:28 
GeneralProblems with CListBox method use... Pin
Dr Soong10-Apr-03 15:32
Dr Soong10-Apr-03 15:32 
GeneralRe: Problems with CListBox method use... Pin
Kevein10-Apr-03 15:37
Kevein10-Apr-03 15:37 

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.