Click here to Skip to main content
15,888,113 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralDigital Logic Circuit Pin
popo8428-Mar-05 19:55
popo8428-Mar-05 19:55 
GeneralRe: Digital Logic Circuit Pin
Christian Graus30-Mar-05 12:01
protectorChristian Graus30-Mar-05 12:01 
GeneralRe: Digital Logic Circuit Pin
popo8431-Mar-05 16:22
popo8431-Mar-05 16:22 
GeneralRe: Digital Logic Circuit Pin
Christian Graus31-Mar-05 20:30
protectorChristian Graus31-Mar-05 20:30 
QuestionHow to dock a form? Pin
User 91483328-Mar-05 11:35
User 91483328-Mar-05 11:35 
AnswerRe: How to dock a form? Pin
Christian Graus30-Mar-05 12:02
protectorChristian Graus30-Mar-05 12:02 
GeneralDisk Imaging Pin
msiravian28-Mar-05 1:50
msiravian28-Mar-05 1:50 
Generalerror C2451 confusion Pin
Anonymous27-Mar-05 17:14
Anonymous27-Mar-05 17:14 
Hello,
I keep getting a
error C2451: conditional expression of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' is illegal
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

at the spot marked below. I'm so confused... it looks like it should do what I want. Anyone confronted this before?


from main():
...
packetCount = fillPackets(inputString);
cout << "Filled " << packetCount << " packets." << endl;
...


int fillPackets(string inputString) {
	string aPacket;
	int packetCount = 0;
	int x = 0;

	cout << "Filling packets...";
	
	while (aPacket = getNextPacket(inputString)) { <code><-- ERROR!</code>
		packets[x++] = new packet(aPacket);
		packetCount++;
	}
		
	cout << "done." << endl;
	return packetCount;
}


string getNextPacket(string packetString) {
	string aPacket;
	static string::const_iterator theIterator = packetString.begin();
	int start = 0, end = 0;

	// search for the pattern \x00\x00\x00\x??\x00\x00\x00
	// - end of ethernet preamble
	while (theIterator != packetString.end() &&
		*theIterator != (char) 0 &&
		*(theIterator + 1) != (char) 0 &&
		*(theIterator + 2) != (char) 0 &&
		*(theIterator + 3) == (char) 0 &&
		*(theIterator + 4) != (char) 0 &&
		*(theIterator + 5) != (char) 0 &&
		*(theIterator + 6) != (char) 0) {

		++theIterator;
		start++;
	}

	if (theIterator == packetString.end())
		return NULL;
			
	theIterator += 7;
	start += 7;

	// search for the pattern \x00\x00\x00\x??\x00\x00\x00
	// - end of ethernet preamble
	while (theIterator != packetString.end() &&
		*theIterator != (char) 0 &&
		*(theIterator + 1) != (char) 0 &&
		*(theIterator + 2) != (char) 0 &&
		*(theIterator + 3) == (char) 0 &&
		*(theIterator + 4) != (char) 0 &&
		*(theIterator + 5) != (char) 0 &&
		*(theIterator + 6) != (char) 0) {	
			
		++theIterator;
		end++;
	}

	if (theIterator == packetString.end())
		return NULL;

	aPacket = packetString.substr(start, end);
	return aPacket;
}

GeneralIMAGES TO MOVIE file Pin
Emiliano27-Mar-05 14:15
Emiliano27-Mar-05 14:15 
GeneralRe: IMAGES TO MOVIE file Pin
Christian Graus30-Mar-05 12:04
protectorChristian Graus30-Mar-05 12:04 
GeneralRe: IMAGES TO MOVIE file Pin
Emiliano30-Mar-05 12:40
Emiliano30-Mar-05 12:40 
GeneralRe: IMAGES TO MOVIE file Pin
Christian Graus30-Mar-05 12:47
protectorChristian Graus30-Mar-05 12:47 
QuestionUDP Socket sample code is needed??? Pin
Kimdave23-Mar-05 22:13
Kimdave23-Mar-05 22:13 
AnswerRe: UDP Socket sample code is needed??? Pin
eli1502197926-Mar-05 20:54
eli1502197926-Mar-05 20:54 
QuestionHow do you call COM from a C++ web service? Pin
Chris Disdero22-Mar-05 16:10
Chris Disdero22-Mar-05 16:10 
GeneralCorrupt output from WideCharToMultiByte. Pin
zen0n21-Mar-05 1:31
zen0n21-Mar-05 1:31 
GeneralRe: Corrupt output from WideCharToMultiByte. Pin
zen0n21-Mar-05 20:23
zen0n21-Mar-05 20:23 
GeneralC++ Windows Socket Problem. Pin
Anonymous20-Mar-05 9:06
Anonymous20-Mar-05 9:06 
GeneralRe: C++ Windows Socket Problem. Pin
Christian Graus20-Mar-05 13:44
protectorChristian Graus20-Mar-05 13:44 
GeneralRe: C++ Windows Socket Problem. Pin
toxcct22-Mar-05 4:10
toxcct22-Mar-05 4:10 
Generalplllzzz help me out:producer- consumer program urgently needed Pin
pradeep reddy19-Mar-05 20:26
pradeep reddy19-Mar-05 20:26 
GeneralRe: plllzzz help me out:producer- consumer program urgently needed Pin
Christian Graus20-Mar-05 13:43
protectorChristian Graus20-Mar-05 13:43 
GeneralRe: plllzzz help me out:producer- consumer program urgently needed Pin
skonopa23-Mar-05 3:50
skonopa23-Mar-05 3:50 
GeneralRe: plllzzz help me out:producer- consumer program urgently needed Pin
Christian Graus23-Mar-05 11:12
protectorChristian Graus23-Mar-05 11:12 
QuestionControlling ActiveChild form from MDI Parent - How? Pin
Francis TA19-Mar-05 5:18
sussFrancis TA19-Mar-05 5:18 

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.