Click here to Skip to main content
15,920,217 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCComSafeArray Pin
pierre_ribery14-Jun-06 7:16
pierre_ribery14-Jun-06 7:16 
AnswerRe: CComSafeArray Pin
JonEngle14-Jun-06 9:18
JonEngle14-Jun-06 9:18 
GeneralRe: CComSafeArray Pin
pierre_ribery14-Jun-06 10:28
pierre_ribery14-Jun-06 10:28 
GeneralRe: CComSafeArray Pin
JonEngle14-Jun-06 10:59
JonEngle14-Jun-06 10:59 
GeneralRe: CComSafeArray Pin
pierre_ribery14-Jun-06 11:13
pierre_ribery14-Jun-06 11:13 
GeneralRe: CComSafeArray Pin
JonEngle14-Jun-06 11:50
JonEngle14-Jun-06 11:50 
GeneralRe: CComSafeArray Pin
pierre_ribery14-Jun-06 22:16
pierre_ribery14-Jun-06 22:16 
GeneralRe: CComSafeArray Pin
pierre_ribery3-Jul-06 1:29
pierre_ribery3-Jul-06 1:29 
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 

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.