Click here to Skip to main content
15,860,972 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to pass size of an array from command line Pin
Rick York6-Dec-17 18:52
mveRick York6-Dec-17 18:52 
GeneralRe: How to pass size of an array from command line Pin
User 135094506-Dec-17 20:07
professionalUser 135094506-Dec-17 20:07 
GeneralRe: How to pass size of an array from command line Pin
Rick York6-Dec-17 20:31
mveRick York6-Dec-17 20:31 
GeneralRe: How to pass size of an array from command line Pin
User 135094506-Dec-17 20:32
professionalUser 135094506-Dec-17 20:32 
GeneralRe: How to pass size of an array from command line Pin
CPallini7-Dec-17 3:19
mveCPallini7-Dec-17 3:19 
QuestionCEdit::LineLength returning zero Pin
ForNow6-Dec-17 13:16
ForNow6-Dec-17 13:16 
AnswerRe: CEdit::LineLength returning zero Pin
Rick York6-Dec-17 14:41
mveRick York6-Dec-17 14:41 
GeneralRe: CEdit::LineLength returning zero Pin
ForNow6-Dec-17 15:51
ForNow6-Dec-17 15:51 
I did pass 0 is the index and still it returned 0

I do use The GetTextExtent but thought that LineLength would be easier

This is the code I used to figured out how much space I needed per line I was looking to allow the user up to 8 hex characters (by that I mean 0 -F )

It just didn't come up exactly the way I figured

C++
CSize mycsize = gprdc->GetTextExtent(_T("0123456789ABCDEF"), 16);
   mycsize.cx = mycsize.cx / 16;
   RECT gprrect, gprrect1, accessrect;
 
   WINDOWINFO dlgwin;
   GetWindowInfo(&dlgwin);
   asidgprs.GetWindowRect(&gprrect);
    asidaccess.GetWindowRect(&accessrect);
   int height = gprrect.bottom - gprrect.top;
    gprrect.left = (gprrect.left - dlgwin.rcWindow.left) + dlgwin.cxWindowBorders;
    accessrect.left = (accessrect.left - dlgwin.rcWindow.left) + dlgwin.cxWindowBorders;
    gprrect.top = gprrect.top -  ( dlgwin.rcWindow.top + dlgwin.cyWindowBorders + 20) ;
    accessrect.top = accessrect.top - ( dlgwin.rcWindow.top + dlgwin.cyWindowBorders + 20);
    gprrect.bottom = ( gprrect.top + height) -20 ;
    accessrect.bottom = (accessrect.top + height) - 20;
   gprrect.right = gprrect.left + (mycsize.cx * 10);
   accessrect.right = accessrect.left + (mycsize.cx * 10);


mycsize.cx represents the number of pixels per character originally I multiplied by 8 figuring 8 characters per line but I ended up multiplying by 10 to get 8 characters to fit
asidgprs and asidacess are 2 multiline edit controls in the Dialog
I ended doing a lot tweeking wit this to get it to the right size
GeneralRe: CEdit::LineLength returning zero Pin
Rick York6-Dec-17 19:00
mveRick York6-Dec-17 19:00 
GeneralRe: CEdit::LineLength returning zero Pin
ForNow6-Dec-17 20:39
ForNow6-Dec-17 20:39 
QuestionRe: CEdit::LineLength returning zero Pin
Richard MacCutchan6-Dec-17 22:14
mveRichard MacCutchan6-Dec-17 22:14 
AnswerRe: CEdit::LineLength returning zero Pin
ForNow6-Dec-17 23:49
ForNow6-Dec-17 23:49 
GeneralRe: CEdit::LineLength returning zero Pin
Victor Nijegorodov7-Dec-17 0:39
Victor Nijegorodov7-Dec-17 0:39 
GeneralRe: CEdit::LineLength returning zero Pin
ForNow7-Dec-17 1:53
ForNow7-Dec-17 1:53 
GeneralRe: CEdit::LineLength returning zero Pin
Victor Nijegorodov7-Dec-17 8:40
Victor Nijegorodov7-Dec-17 8:40 
GeneralRe: CEdit::LineLength returning zero Pin
ForNow7-Dec-17 8:51
ForNow7-Dec-17 8:51 
GeneralRe: CEdit::LineLength returning zero Pin
Richard MacCutchan7-Dec-17 22:16
mveRichard MacCutchan7-Dec-17 22:16 
SuggestionRe: CEdit::LineLength returning zero Pin
David Crow7-Dec-17 9:47
David Crow7-Dec-17 9:47 
GeneralRe: CEdit::LineLength returning zero Pin
ForNow7-Dec-17 9:55
ForNow7-Dec-17 9:55 
GeneralRe: CEdit::LineLength returning zero The Answer is CMFCMaskEdit Class Pin
ForNow8-Dec-17 7:48
ForNow8-Dec-17 7:48 
QuestionCalling DLL method from multi-thread Pin
shakumar_215-Dec-17 23:23
shakumar_215-Dec-17 23:23 
QuestionRe: Calling DLL method from multi-thread Pin
Richard MacCutchan5-Dec-17 23:54
mveRichard MacCutchan5-Dec-17 23:54 
AnswerRe: Calling DLL method from multi-thread Pin
Victor Nijegorodov6-Dec-17 8:23
Victor Nijegorodov6-Dec-17 8:23 
QuestionWhy -nan values appear Pin
User 135094504-Dec-17 6:49
professionalUser 135094504-Dec-17 6:49 
AnswerRe: Why -nan values appear Pin
Jochen Arndt4-Dec-17 7:01
professionalJochen Arndt4-Dec-17 7:01 

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.