Click here to Skip to main content
15,895,370 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Invalid access to memory location - in WriteFile - writting to COM posrt. Pin
Vaclav_1-Mar-10 10:37
Vaclav_1-Mar-10 10:37 
GeneralRe: Invalid access to memory location - in WriteFile - writting to COM posrt. Pin
David Crow1-Mar-10 15:26
David Crow1-Mar-10 15:26 
GeneralRe: Invalid access to memory location - in WriteFile - writting to COM posrt. Pin
Vaclav_1-Mar-10 17:05
Vaclav_1-Mar-10 17:05 
GeneralRe: Invalid access to memory location - in WriteFile - writting to COM posrt. Pin
Avi Berger1-Mar-10 18:03
Avi Berger1-Mar-10 18:03 
GeneralRe: Invalid access to memory location - in WriteFile - writting to COM posrt. Pin
Vaclav_1-Mar-10 18:21
Vaclav_1-Mar-10 18:21 
GeneralRe: Invalid access to memory location - in WriteFile - writting to COM posrt. Pin
Iain Clarke, Warrior Programmer2-Mar-10 6:50
Iain Clarke, Warrior Programmer2-Mar-10 6:50 
GeneralRe: Invalid access to memory location - in WriteFile - writting to COM posrt. Pin
David Crow2-Mar-10 3:42
David Crow2-Mar-10 3:42 
QuestionWrapping toolbar label text Pin
David Ferreira1-Mar-10 2:43
David Ferreira1-Mar-10 2:43 
I've written a MFC application with toolbars.
I've added the text to the toolbar and dynamically sized the toolbar to the length of the label.
I used (CBRS_TOOLTIPS | CBRS_FLYBY| CBRS_SIZE_DYNAMIC)

I set the text with the following code:

if ( !strButtonText.IsEmpty() ) 
{
        //strButtonText.Replace(" ","\n");//an attempt to wrap text
	//AfxMessageBox(strButtonText);
        SetButtonText( nIndex, strButtonText );
    }


Where nIndex is the button's position and strButtonText is the desired text.
I've tried both the above method (commented out) where the messagebox displayed the expected result but the button on the toolbar just appears to have dropped the space i'm assuming this is because CToolBar ignores the return character.
I've also tried to //strTemp += strButtonText.left(10) + "\n" +strButtonText.mid(10, strButtonText.getLength())
With the same result("\n" is ignored).
"\r\n" also has the same result as "\n" so it would appear to not be as easy as a "\n".
So as I'm sure you've guessed by now the question is...Does anyone know a method of wrapping the label text on a CToolBar?
I would greatly appreciate any guidance.
QuestionStrange Issue Pin
john563228-Feb-10 23:35
john563228-Feb-10 23:35 
AnswerRe: Strange Issue Pin
john56321-Mar-10 0:35
john56321-Mar-10 0:35 
AnswerRe: Strange Issue Pin
Code-o-mat1-Mar-10 1:47
Code-o-mat1-Mar-10 1:47 
GeneralRe: Strange Issue Pin
john56321-Mar-10 2:06
john56321-Mar-10 2:06 
GeneralRe: Strange Issue Pin
Code-o-mat1-Mar-10 2:51
Code-o-mat1-Mar-10 2:51 
QuestionAES 128bit encryption using CryptoAPI Pin
Varghese Paul M28-Feb-10 22:13
Varghese Paul M28-Feb-10 22:13 
AnswerRe: AES 128bit encryption using CryptoAPI Pin
Richard MacCutchan28-Feb-10 23:52
mveRichard MacCutchan28-Feb-10 23:52 
GeneralRe: AES 128bit encryption using CryptoAPI Pin
Rajesh R Subramanian1-Mar-10 6:25
professionalRajesh R Subramanian1-Mar-10 6:25 
GeneralRe: AES 128bit encryption using CryptoAPI Pin
Richard MacCutchan1-Mar-10 6:33
mveRichard MacCutchan1-Mar-10 6:33 
QuestionHow to create a form or dailog in MFC-MDI ? Pin
Patrick Tang28-Feb-10 21:31
Patrick Tang28-Feb-10 21:31 
AnswerRe: How to create a form or dailog in MFC-MDI ? Pin
CPallini28-Feb-10 21:40
mveCPallini28-Feb-10 21:40 
AnswerRe: How to create a form or dailog in MFC-MDI ? Pin
Patrick Tang28-Feb-10 22:23
Patrick Tang28-Feb-10 22:23 
GeneralRe: How to create a form or dailog in MFC-MDI ? Pin
Eugen Podsypalnikov28-Feb-10 22:43
Eugen Podsypalnikov28-Feb-10 22:43 
QuestionRe: How to create a form or dailog in MFC-MDI ? Pin
David Crow1-Mar-10 3:14
David Crow1-Mar-10 3:14 
Questionsigned char[] to CString Pin
PaulowniaK28-Feb-10 19:51
PaulowniaK28-Feb-10 19:51 
AnswerRe: signed char[] to CString Pin
Eugen Podsypalnikov28-Feb-10 20:06
Eugen Podsypalnikov28-Feb-10 20:06 
GeneralRe: signed char[] to CString Pin
PaulowniaK28-Feb-10 20:13
PaulowniaK28-Feb-10 20:13 

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.