|
Check the Raw IP Networking FAQ at http://www.whitefang.com/rin/
PS: Perhaps consider reusing one of the common IP "wrappers" TCP or UDP, while TCP is great for reliability, maybe you could like UDPs approach? However, TCP and UDP provide a lot... I recommend reading 'Effective TCP/IP Programming' from Jon Snader.
|
|
|
|
|
Thanks, Moak buddie!
I think your suggestions are reasonable. And I think
I can use TCP plus RAW socket to resolve my trouble.
Now I meet a new trouble. I have found many sample
codes about how to send raw socket from client. But
I have not found how to write a server that can receive
raw socket from client and write back raw socket. Can
you tell me where can I find the sample codes?
regards,
George
|
|
|
|
|
Hmm, I think there are some ways, but I have to ask - Why to do it with so complicated way?
At first, you will be limited to W2K+ (and of course un*xes), at second the app will must run under the administrative account...
I don't see the benefit of developing a completelly new transfer protocol. I'm also afraid that the amount of code required to achieve that goal will be much higher than the whole rest of the application (client + server).
If you need fast transfers, but don't need to have it reliable - use UDP, if you need that all your data will be delivered and delivered in order, here TCP does it's job.
If you need just attach some your data to the packet use the Options part of the UDP/TCP headers...
But maybe there are benefits I do not see, then pls, try to explain it shortly.
|
|
|
|
|
Thanks, geo_m buddie!
I think your suggestions are reasonable. And I think
I can use TCP plus RAW socket to resolve my trouble.
Now I meet a new trouble. I have found many sample
codes about how to send raw socket from client. But
I have not found how to write a server that can receive
raw socket from client and write back raw socket. Can
you tell me where can I find the sample codes?
regards,
George
|
|
|
|
|
Hey Friends
Can Someone Suggest How To Format VARIANT VT_DATE to MM/DD/YYYY fixed format independent of System Settings ,without Using MFC.
|
|
|
|
|
Must be something like this:
SYSTEMTIME st;
VariantTimeToSystemTime(v.date, &st);
TCHAR szDate[12];
wsprintf(szDate, _T("%02d/%02d/%d"), st.wMonth, st.wDay, st.wYear);
rechi
|
|
|
|
|
Thanks
I was Looking Exactly For The Same
Thanks Again
|
|
|
|
|
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;
|
|
|
|
|
Probably in strIPdec.cpp you should have
#include "stdafx.h"
#include "stripdec.h"
rechi
|
|
|
|
|
hey do anyone know how to sniff outgoing packets in a system, and do anyone have dnsapi.lib . if so i would be pleased
|
|
|
|
|
In Windows DDK , Packet32 driver is provided. using that you can catch all the outgoing and incomming packets. And you can also catch all the packets in the lan which r comming from/ going to other systems (if using HUB). have Fun......
|
|
|
|
|
what is windows DDK, tell me exactly how do i use packet32 in my vc programs, do u have any experience in using them please tell me yaar
|
|
|
|
|
the windows ddk is the device driver kit!
you have to order it at http://www.microsoft.com/ddk/ (its free i think).
i don't know the packet32 driver, but you will have to control it via DeviceIoControl, CreateFile, ReadFile, WriteFile like most other drivers.
|
|
|
|
|
I used the packet32 driver which is provided in Windows DDK 2 years back in my VC++ application for capturing packets in Win NT. Present situation i dont know, wether it is there in the latest version of DDK or not. check it out. If it is there inform me, i will tell you how to use it. It is very simple to use it.
|
|
|
|
|
hi,
i am getting COLORREF value.i want to get its equivalent color name..pls help me.
|
|
|
|
|
Anonymous wrote:
its equivalent color name
What do you mean exactely by "color name" ? Like in HTML ?
~RaGE();
|
|
|
|
|
Well .. COLORREF can handle 16 million colors i dont think that there are names for each one of them...
What you could do is to have a small array or string resource that you can map to the default colors (white, black,green,yellow,blue....) you know ..the basic ones.
|
|
|
|
|
Check out this article: http://www.codeproject.com/bitmap/ccolor.asp?target=ccolor[^] I've used this class before and whenever I need a color I just look up its name in the header file for this class. The article also has a display chart of all the colors it has pre-defined. Best of all the class is COLORREF compatible.
|
|
|
|
|
How to add Caption (Subtitle) to video in Win CE. Is there any filter is available for doing this. Please Help.
Thanking You
|
|
|
|
|
Gd day,
i want to like for example when this titleId 10 i selected, i dont know whether the popularity is updated or not. So this ID 10 has it own usagecount then it compare with usagecount of other titleID. Then the popularity will increase or remain same.
For That i had create the button "update popularity but how the function will be like--?? really thanks
|
|
|
|
|
Ohaiyo wrote:
titleId
What is that ?
Ohaiyo wrote:
the popularity
popularity of what ?
~RaGE();
|
|
|
|
|
This TitleID , Popularity are a set of IDs from my microsoft access database
Each set of IDs has it own usagecount and popularity.
For example, if the usagecount for this titleID 50 is 5, the old value of the popularity will be increment by 5.
Perhap how should i do this function.... /?? thanks much appreciated. i think this is rephrase better
The IDs are from the microsoft access database is link through ADO.
|
|
|
|
|
I am sorry Ohaiyo but I am having a hard time understanding what you're asking. No offense but my best guess is that you have field (TitleID) in your database and you have two more fields UsageCount and Popularity, perhaps on a different table, I really don't know because you haven't provided that kind of information.
First you have to go to the recordset that has the titleID that you are looking for. Perhaps by setting a filter or running a search.
To search you use:
public void find(String criteria, int SkipRecords, int searchDirection)
To filter you use:
public void setFilter(Object filter)
There could be other alternatives as well.
Once you have a pointer to the recordset you can update its fields by using:
_variant_t vField;
vField.SetString( (LPCTSTR) strField );
m_pRs->Update( vField, _variant_t( (long)lSomeData ) );
I hope that helps.
none
|
|
|
|
|
I'm trying to use the method GetSelItems from CListBox and I get a user error on a system that has an older vs of conctrl32.dll on it. What is the best way to update this dll to get this method to work properly when I install it on systems with the older dll?
|
|
|
|
|
How about just copy the newer version with your program?
I guess usually the program first look at its current folder for the files
before it looks for the window's folder.
I am not sure. But you can have a simple try of it.
|
|
|
|