Click here to Skip to main content
15,904,024 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDirectShow BITMAP Pin
TBA_SST14-Jun-06 7:05
TBA_SST14-Jun-06 7:05 
AnswerRe: DirectShow BITMAP Pin
James R. Twine14-Jun-06 7:11
James R. Twine14-Jun-06 7:11 
AnswerRe: DirectShow BITMAP Pin
Justin Tay14-Jun-06 8:31
Justin Tay14-Jun-06 8:31 
QuestionSend xy plot by email Pin
BambooMoon14-Jun-06 6:30
BambooMoon14-Jun-06 6:30 
AnswerRe: Send xy plot by email Pin
Chris Losinger14-Jun-06 6:58
professionalChris Losinger14-Jun-06 6:58 
AnswerRe: Send xy plot by email Pin
James R. Twine14-Jun-06 7:07
James R. Twine14-Jun-06 7:07 
QuestionRe: Send xy plot by email Pin
Jun Du14-Jun-06 7:41
Jun Du14-Jun-06 7:41 
QuestionWriteConsole() pointer problem Pin
CoffeeAddict1914-Jun-06 6:27
CoffeeAddict1914-Jun-06 6:27 
My old post is somewhere on page 20 and I couldn't bump it by replying. As you can see in the code (as a comment) I tried putting "Hello World" right into the function and it worked fine. I'm trying to use the Win32 WriteConsole() function but it prints out random characters (but it is a number of random characters equal to the length of the string I used in each case). I think it is a problem with the pointers I'm using but I'm not getting any warnings or errors. Please take a look:

Client code:
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
	MainConsole.SwitchBuffers(1);<br />
	MainConsole.WriteStreamToBuffer(1, "Hi");<br />
	MainConsole.SetBufferCursorPos(2, 20, 20);<br />
	MainConsole.WriteStreamToBuffer(2, "John!");<br />
	MainConsole.SwitchBuffers(2);<br />
	cin.get();<br />
<br />
	return 0;<br />
}<br />


Class function being called:
<br />
void MainWindowSpecs::WriteBuffer(string TextToWrite)<br />
{<br />
	DWORD NumCharsWritten;<br />
	string *TextPtr = &TextToWrite;<br />
	<br />
	//WriteConsole(StandardHandles.hOut, "Hello World", 11, &NumCharsWritten, NULL);<br />
	//^this worked fine<br />
	WriteConsole(StandardHandles.hOut, &TextPtr, TextToWrite.length(), &NumCharsWritten, NULL);<br />
	if(TextToWrite.length() != NumCharsWritten)<br />
		cerr<<"All characters were not written."<<endl;<br />
}<br />

QuestionRe: WriteConsole() pointer problem Pin
David Crow14-Jun-06 6:41
David Crow14-Jun-06 6:41 
AnswerRe: WriteConsole() pointer problem [modified] Pin
James R. Twine14-Jun-06 7:03
James R. Twine14-Jun-06 7:03 
GeneralRe: WriteConsole() pointer problem Pin
CoffeeAddict1914-Jun-06 9:25
CoffeeAddict1914-Jun-06 9:25 
Questionparent dialog accessing from a child dialog Pin
erfi14-Jun-06 6:14
erfi14-Jun-06 6:14 
AnswerRe: parent dialog accessing from a child dialog Pin
Milton Karimbekallil14-Jun-06 6:27
Milton Karimbekallil14-Jun-06 6:27 
GeneralRe: parent dialog accessing from a child dialog Pin
erfi14-Jun-06 6:58
erfi14-Jun-06 6:58 
QuestionRe: parent dialog accessing from a child dialog Pin
David Crow14-Jun-06 6:40
David Crow14-Jun-06 6:40 
AnswerRe: parent dialog accessing from a child dialog Pin
erfi14-Jun-06 6:52
erfi14-Jun-06 6:52 
QuestionWhat does "(Something)SomeProcedure" mean Pin
Max++14-Jun-06 4:59
Max++14-Jun-06 4:59 
AnswerRe: What does "(Something)SomeProcedure" mean Pin
toxcct14-Jun-06 5:03
toxcct14-Jun-06 5:03 
AnswerRe: What does "(Something)SomeProcedure" mean Pin
Viorel.14-Jun-06 5:08
Viorel.14-Jun-06 5:08 
AnswerRe: What does "(Something)SomeProcedure" mean Pin
James R. Twine14-Jun-06 6:19
James R. Twine14-Jun-06 6:19 
GeneralRe: using the MessageBox:: function Pin
toxcct14-Jun-06 5:08
toxcct14-Jun-06 5:08 
GeneralRe: using the MessageBox:: function Pin
kitty514-Jun-06 5:10
kitty514-Jun-06 5:10 
Questionget background color Pin
ns14-Jun-06 4:27
ns14-Jun-06 4:27 
AnswerRe: get background color Pin
Viorel.14-Jun-06 4:37
Viorel.14-Jun-06 4:37 
GeneralRe: get background color Pin
Michael Dunn14-Jun-06 18:39
sitebuilderMichael Dunn14-Jun-06 18:39 

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.