Click here to Skip to main content
16,010,334 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Urgent help needed. enquire within Pin
Christian Graus15-Apr-02 22:55
protectorChristian Graus15-Apr-02 22:55 
GeneralRe: Urgent help needed. enquire within Pin
15-Apr-02 23:37
suss15-Apr-02 23:37 
GeneralRe: Urgent help needed. enquire within Pin
Christian Graus16-Apr-02 1:51
protectorChristian Graus16-Apr-02 1:51 
Generallink to raw binary. Pin
Hyien15-Apr-02 5:51
Hyien15-Apr-02 5:51 
GeneralRe: link to raw binary. Pin
Mike Nordell15-Apr-02 5:54
Mike Nordell15-Apr-02 5:54 
QuestionHow to run UNIX command from VC++? Pin
Ravi Shankar15-Apr-02 5:02
Ravi Shankar15-Apr-02 5:02 
AnswerRe: How to run UNIX command from VC++? Pin
Tim Deveaux15-Apr-02 5:56
Tim Deveaux15-Apr-02 5:56 
GeneralDispay Lines in Window Pin
15-Apr-02 4:43
suss15-Apr-02 4:43 
I am trying to put messages out to the scren such that each line is under the next, causing a scrolling action in the window. I get the messages, but they are to the right of each other, even though I have CR/LF included, as well as WORDBREAK. In reading the function description, I thought the WORDBREAK and the \r\n would cause the output I desire. Can anyone please tell me where I am going wrong?

void CChildView::OnPaint()
{
CPaintDC dc(this); // device context for painting

// TODO: Add your message handler code here

// Do not call CWnd::OnPaint() for painting messages

CRect rect;

char* data = " Dialing xxxxxx\r\n";
CWnd *wnd = dc.GetWindow();
::GetClientRect(wnd->m_hWnd, &rect);
dc.DrawText(data, strlen(data), &rect, DT_WORDBREAK);
dc.SetTextAlign(TA_RIGHT);

// Dialing the Host
pcAny.awConnect("xxxxxx");
rc = pcAny.GetError();

data = " \r\nConnection = ";
dc.DrawText(data, strlen(data), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);
dc.DrawText(rc, rc.GetLength(), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);

// Getting Status of Connection
rc2 = pcAny.ConnectionStatus();

data = " \r\nConnection Status = ";
dc.DrawText(data, strlen(data), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);
itoa(rc2, data, 10);
dc.DrawText(data, strlen(data), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);

// Sending the Order(s)
data = " \r\nSending Orders\r\n";
dc.DrawText(data, strlen(data), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);
pcAny.FileXferToHost("TESTFILE.TXT","TESTFILE.TXT");
rc = pcAny.GetError();
data = " \r\nSending = ";
dc.DrawText(data, strlen(data), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);
dc.DrawText(rc, rc.GetLength(), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);

// Getting the New Catalog
data = " \r\nUpdating Catalog\r\n";
dc.DrawText(data, strlen(data), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);
pcAny.FileXferFromHost("CATALOG.TXT","CATALOG.TXT");
rc = pcAny.GetError();
data = " \r\nUpdating = ";
dc.DrawText(data, strlen(data), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);
dc.DrawText(rc, rc.GetLength(), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);

// Host Disconnect
data = " \r\nDisconnecting from Host\r\n";
dc.DrawText(data, strlen(data), &rect, DT_RIGHT|DT_WORDBREAK);
dc.SetTextAlign(TA_UPDATECP);
pcAny.awDisconnect();
delete pcAny;
}



GeneralRe: Dispay Lines in Window Pin
Niklas L15-Apr-02 4:57
Niklas L15-Apr-02 4:57 
GeneralRe: Dispay Lines in Window Pin
15-Apr-02 7:00
suss15-Apr-02 7:00 
GeneralRe: Dispay Lines in Window Pin
Niklas L16-Apr-02 3:55
Niklas L16-Apr-02 3:55 
GeneralDisable property page switching Pin
15-Apr-02 4:40
suss15-Apr-02 4:40 
GeneralProblem with maximizing and minimizing window Pin
Leodsk15-Apr-02 3:57
Leodsk15-Apr-02 3:57 
GeneralRe: Problem with maximizing and minimizing window Pin
Niklas L15-Apr-02 4:17
Niklas L15-Apr-02 4:17 
GeneralRe: Problem with maximizing and minimizing window Pin
Paul M Watt15-Apr-02 4:20
mentorPaul M Watt15-Apr-02 4:20 
GeneralUpgrading VC6 Apps To VC7 Pin
Li Mu Bai15-Apr-02 3:04
Li Mu Bai15-Apr-02 3:04 
GeneralCryptography - Get private key from certificate Pin
15-Apr-02 1:56
suss15-Apr-02 1:56 
GeneralRe: Cryptography - Get private key from certificate Pin
Paul M Watt15-Apr-02 5:23
mentorPaul M Watt15-Apr-02 5:23 
GeneralMaking new windows Pin
Dor15-Apr-02 1:35
Dor15-Apr-02 1:35 
GeneralRe: Making new windows Pin
Gianfranco Lanzetta15-Apr-02 1:52
Gianfranco Lanzetta15-Apr-02 1:52 
GeneralRe: Making new windows Pin
Paul M Watt15-Apr-02 5:27
mentorPaul M Watt15-Apr-02 5:27 
Generalnewbie low-level mfc subclassing q. Pin
SirMorrisBig15-Apr-02 1:17
SirMorrisBig15-Apr-02 1:17 
GeneralRe: newbie low-level mfc subclassing q. Pin
15-Apr-02 1:34
suss15-Apr-02 1:34 
Question??? Pin
15-Apr-02 1:12
suss15-Apr-02 1:12 
AnswerRe: ??? Pin
Paul M Watt15-Apr-02 5:33
mentorPaul M Watt15-Apr-02 5:33 

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.