Click here to Skip to main content
16,005,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralOverLoading Constructor Pin
NewYork24-Nov-03 10:49
NewYork24-Nov-03 10:49 
GeneralRe: OverLoading Constructor Pin
Michael P Butler24-Nov-03 11:26
Michael P Butler24-Nov-03 11:26 
GeneralRe: OverLoading Constructor Pin
John R. Shaw24-Nov-03 17:10
John R. Shaw24-Nov-03 17:10 
GeneralUsing Visual C++ 6 for Palm OS Dev. Pin
Ernesto D.24-Nov-03 9:58
Ernesto D.24-Nov-03 9:58 
GeneralRe: Using Visual C++ 6 for Palm OS Dev. Pin
john john mackey24-Nov-03 11:06
john john mackey24-Nov-03 11:06 
GeneralRe: Using Visual C++ 6 for Palm OS Dev. Pin
Michael P Butler24-Nov-03 11:29
Michael P Butler24-Nov-03 11:29 
GeneralRe: Using Visual C++ 6 for Palm OS Dev. Pin
Christian Graus24-Nov-03 13:03
protectorChristian Graus24-Nov-03 13:03 
Generalpasting from program to notepad Pin
elena1234524-Nov-03 9:49
elena1234524-Nov-03 9:49 
When I am coping/pasting from my c++ program to the notepad the \n's are not coming through.
I get little squares instead of carriage returns.

The string is unicode, but it does not work even when I save-as notepad file as unicode.

Do you know what the problem is and how I can get around it?

ANy help would be greatly appreciated.

Here is my code that puts the string on the clipboard:
void OnCopyButtonClicked()<br />
{<br />
    CString strData;<br />
    CString strWarningHeader, strErrorHeader, strInfoHeader;<br />
<br />
    strWarningHeader.LoadString(IDS_INVENTOR_WARNING_LABEL); <br />
    strErrorHeader.LoadString(IDS_INVENTOR_ERROR_LABEL);<br />
    strInfoHeader.LoadString(IDS_INVENTOR_INFO_LABEL);<br />
<br />
    //create the string that will be posted to the clipboard<br />
    std::vector<InventorErrorMessageStruct>::iterator iter;<br />
    for (iter = m_errorStructList.begin(); iter != m_errorStructList.end(); ++iter)<br />
    {<br />
        InventorErrorMessageStruct messageStruct = (*iter);<br />
        <br />
        //insert break after previous message<br />
        if(strData.GetLength() > 0)<br />
        {<br />
            strData.Insert(strData.GetLength(), _T("\n\n"));<br />
        }<br />
        //insert message type<br />
        if(messageStruct.messageType == CErrorListBox::MESSAGE_ERROR)<br />
        {<br />
            strData.Insert(strData.GetLength(), strErrorHeader);<br />
        }<br />
        else if(messageStruct.messageType == CErrorListBox::MESSAGE_WARNING)<br />
        {<br />
            strData.Insert(strData.GetLength(), strWarningHeader);<br />
        }<br />
        else if(messageStruct.messageType == CErrorListBox::MESSAGE_INFO)<br />
        {<br />
            strData.Insert(strData.GetLength(), strInfoHeader);<br />
        }<br />
        //insert message<br />
        strData.Insert(strData.GetLength(), _T(" "));<br />
        strData.Insert(strData.GetLength(), messageStruct.message);                <br />
    }<br />
<br />
    //post the message onto the clipboard<br />
    if (OpenClipboard())<br />
    {      <br />
        EmptyClipboard();<br />
        <br />
        HGLOBAL hClipboardData;<br />
        hClipboardData = GlobalAlloc(GMEM_DDESHARE, <br />
            (strData.GetLength() + 1) * sizeof(wchar_t));        <br />
        <br />
        wchar_t* pchData;<br />
        pchData = (wchar_t*)GlobalLock(hClipboardData);<br />
              <br />
        wcscpy(pchData, LPCTSTR(strData));		  <br />
        GlobalUnlock(hClipboardData);		  <br />
        SetClipboardData(CF_UNICODETEXT,hClipboardData);<br />
        CloseClipboard();<br />
    }<br />
}


Elena
GeneralRe: pasting from program to notepad Pin
BaldwinMartin24-Nov-03 17:18
BaldwinMartin24-Nov-03 17:18 
GeneralRe: pasting from program to notepad Pin
John R. Shaw24-Nov-03 17:20
John R. Shaw24-Nov-03 17:20 
QuestionDialog box continuous update? Pin
bradleyand24-Nov-03 9:41
bradleyand24-Nov-03 9:41 
AnswerRe: Dialog box continuous update? Pin
Andrey Del Pozo24-Nov-03 10:11
Andrey Del Pozo24-Nov-03 10:11 
GeneralRe: Dialog box continuous update? Pin
bradleyand24-Nov-03 20:41
bradleyand24-Nov-03 20:41 
GeneralWin32 Dialog Box and Date/Time Picker Control Pin
Billy Whizz24-Nov-03 9:40
Billy Whizz24-Nov-03 9:40 
GeneralRe: Win32 Dialog Box and Date/Time Picker Control Pin
BaldwinMartin24-Nov-03 17:21
BaldwinMartin24-Nov-03 17:21 
GeneralRe: Win32 Dialog Box and Date/Time Picker Control Pin
Billy Whizz24-Nov-03 22:56
Billy Whizz24-Nov-03 22:56 
GeneralRe: Win32 Dialog Box and Date/Time Picker Control Pin
Steve S25-Nov-03 2:50
Steve S25-Nov-03 2:50 
GeneralClistbox parsing,help Pin
thes3cr3t124-Nov-03 9:32
thes3cr3t124-Nov-03 9:32 
GeneralRe: Clistbox parsing,help Pin
BaldwinMartin24-Nov-03 17:27
BaldwinMartin24-Nov-03 17:27 
Questiondetermineing a variable type within the program code? Pin
Anonymous24-Nov-03 9:24
Anonymous24-Nov-03 9:24 
AnswerRe: determineing a variable type within the program code? Pin
igor196024-Nov-03 11:56
igor196024-Nov-03 11:56 
GeneralReports in VC++6.0 Pin
Hesham Amin24-Nov-03 8:54
Hesham Amin24-Nov-03 8:54 
GeneralRe: Reports in VC++6.0 Pin
Ernesto D.24-Nov-03 9:05
Ernesto D.24-Nov-03 9:05 
GeneralRe: Reports in VC++6.0 Pin
Game Tester24-Nov-03 14:04
Game Tester24-Nov-03 14:04 
Generalreceive serial xml data Pin
Anonymous24-Nov-03 8:45
Anonymous24-Nov-03 8:45 

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.