Click here to Skip to main content
15,919,931 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Hard Drive, BIOS and CPU serial number in VC++ 6.0? Pin
Milton Karimbekallil12-Apr-04 1:57
Milton Karimbekallil12-Apr-04 1:57 
AnswerRe: Hard Drive, BIOS and CPU serial number in VC++ 6.0? Pin
David Crow12-Apr-04 4:12
David Crow12-Apr-04 4:12 
AnswerRe: Hard Drive, BIOS and CPU serial number in VC++ 6.0? Pin
Darshan Jani12-Apr-04 7:47
Darshan Jani12-Apr-04 7:47 
GeneralTrouble with _variant_t Pin
yanuart12-Apr-04 1:08
yanuart12-Apr-04 1:08 
GeneralRe: Trouble with _variant_t Pin
Milton Karimbekallil12-Apr-04 1:48
Milton Karimbekallil12-Apr-04 1:48 
QuestionAre there somewhere good articles about MTS ? Pin
vgrigor12-Apr-04 0:53
vgrigor12-Apr-04 0:53 
Generalunsigned chars Pin
packetlos12-Apr-04 0:10
packetlos12-Apr-04 0:10 
GeneralRe: unsigned chars Pin
John R. Shaw12-Apr-04 0:37
John R. Shaw12-Apr-04 0:37 
This "unsigned char pkt_data[];" should not pass the compiler. Insted the stucture should look something like this:
typedef struct DATAGRAM{
	UINT packetID;			// Sequence Number
	ip_header ipHeader;		// IP header
	pcap_pkthdr wpHeader;	        // Winpcap header
	unsigned char pkt_data[1];	// Packet data ???
} DATAGRAM;


Then if you know if you know the nuber of bytes you will be receiving you can allocate the need memory like so:

DATAGRAM* pDatat = (DATAGRAM*)malloc(sizeof(DATAGRAM) + nDataSize) or the C++ equivalent to allocate the need memory and then copy the data into pData->pkt_data as you see fit. If you do not know the data size ahead of time things get a lot more complicated and you may want to use one of the STL templates or if programming using MFC you could replace "unsigned char pkt_data[1];" with "CByteArray pkt_data;". CByteArray stores unsigned chars, because that is what a byte is.

Good Luck1

INTP
GeneralRe: unsigned chars Pin
packetlos12-Apr-04 1:21
packetlos12-Apr-04 1:21 
GeneralRe: unsigned chars Pin
packetlos12-Apr-04 5:38
packetlos12-Apr-04 5:38 
Generaldouble and float variables Pin
deniz79s12-Apr-04 0:04
deniz79s12-Apr-04 0:04 
GeneralRe: double and float variables Pin
John R. Shaw12-Apr-04 0:46
John R. Shaw12-Apr-04 0:46 
QuestionWhich DLLs do I have to distribute AND which DLLs can I expect to be already installed on a standard XP installation? Pin
Tony Westminster12-Apr-04 0:04
Tony Westminster12-Apr-04 0:04 
AnswerRe: Which DLLs do I have to distribute AND which DLLs can I expect to be already installed on a standard XP installation? Pin
Abin12-Apr-04 3:01
Abin12-Apr-04 3:01 
GeneralRe: Which DLLs do I have to distribute AND which DLLs can I expect to be already installed on a standard XP installation? Pin
Tony Westminster12-Apr-04 4:10
Tony Westminster12-Apr-04 4:10 
GeneralADO Calls and Socket Pin
Sitaram Sukumar11-Apr-04 23:43
Sitaram Sukumar11-Apr-04 23:43 
GeneralRe: ADO Calls and Socket Pin
Milton Karimbekallil12-Apr-04 0:50
Milton Karimbekallil12-Apr-04 0:50 
GeneralWM_NCMOUSELEAVE Message help Pin
baskarchinnu11-Apr-04 22:10
baskarchinnu11-Apr-04 22:10 
GeneralRe: WM_NCMOUSELEAVE Message help Pin
Neville Franks11-Apr-04 22:48
Neville Franks11-Apr-04 22:48 
GeneralRe: WM_NCMOUSELEAVE Message help Pin
Neville Franks12-Apr-04 1:23
Neville Franks12-Apr-04 1:23 
QuestionHow to add toolbars to IE programatically Pin
NewtonOfComputers11-Apr-04 21:38
NewtonOfComputers11-Apr-04 21:38 
AnswerRe: How to add toolbars to IE programatically Pin
Prakash Nadar11-Apr-04 22:12
Prakash Nadar11-Apr-04 22:12 
AnswerRe: How to add toolbars to IE programatically Pin
SiddharthAtw12-Apr-04 20:17
SiddharthAtw12-Apr-04 20:17 
QuestionHow to read Unicode data from Oracle in VC? Pin
regzero11-Apr-04 21:14
regzero11-Apr-04 21:14 
GeneralExe's involved Pin
SatyaDY11-Apr-04 21:13
SatyaDY11-Apr-04 21:13 

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.