Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

MJ_Karas

@MJ_Karas
About
Posts
20
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • character display window in a dialog???
    M MJ_Karas

    Thanks for the suggestion.....unfortunately I have no idea where to start in order to implement such a control. Can you make a suggestion where I can see a sample CStatic control in "Owner Drawn" mode that supports multiple lines (25 in my case) where the string for each row would be independent and each row need to be displayed in a manner with some text in normal video (black char on white background) and some characters in reverse video (white char on black background)? Michael Karas

    C / C++ / MFC c++ com data-structures business json

  • character display window in a dialog???
    M MJ_Karas

    I have looked at all the CList control articles on this web site and tried to study each carefully. I cannot directly see how a list control would be used to simply display a box of text. I did see one article about using the CustomDraw features of the List Control - but that seems way over kill to me....... does it need to be this complicated to support a terminal emulator screen at 25x80 characters with just a reverse video attribute capability? Michael Karas

    C / C++ / MFC c++ com data-structures business json

  • character display window in a dialog???
    M MJ_Karas

    Hello: I am in the midst of trying to make a small dialog based application that has an interface to a COM port. I need to be able to display the data that comes from the COM port into a text type box that is organized in specific rows and columns similar to a terminal display. I have tried to use an edit control, a static text box and other types of controls but none give me the features I need. I am curious as to whether anyone has any idea of where I can start with this project in order to get it off the ground. Here I list the requirements that are needed for this text display area... - It needs to permit me to use a fixed width pitch for the characters so that distinct columns are produced. It would be nice of the actual font used is selectable but that is not a requirement. - The text area needs to be accessable to dynamically determined row and column positions of the array so that a text string can be displayed. - Any given part of the text needs to be able to be displayed in an alternate color scheme. Ideally the effect that needs to be achieved is to make certain text appear as reverse video to the rest of the text in the box. - It is not really necessary for there to be any kind of cursor in the text area for "user entry of data. Just think of this text area as a display field. - The control mechanism needs to be able to function as a control on a dialog. I am somewhat experienced with creating windows applications but so far all my work has been with dialog based applets. The current project is one of this type and the request for help here is to try to add a small display window to the dialog that works somewhat like the text box of a HyperTerminal window with regards to the display of data characters that will be arriving from a serial port. Any help, discussion, pointers, or sample code would be extremely helpful to me. Note that I am working in a Win32 environment with MFC and Visual C++ Ver 6. Thanks Mike Karas -

    C / C++ / MFC c++ com data-structures business json

  • Rendering Font Fixed Width
    M MJ_Karas

    I believe that your suggestion will give a result that is similar to my current use of the Courier font. I actually need to find the solution that works with the font that is already set for the dialog. This is becasue that font may have been set to a Unicode font with far eastern characters in it and I need to make sure that font gets used, not one selected by the CreateStockObject().

    C / C++ / MFC tutorial help question

  • Rendering Font Fixed Width
    M MJ_Karas

    Thanks....your suggestion appears to be exactly what must be done. I have looked at the GetCharWidth32() function and it gives exactly the information I need. I think I may just scan the strings I am trying to display at the given moment and find the widest character from that set and align the multiple stacked edit boxes based upon that width. If the user edits the string(s) again and selects some other wider character the controls repaint anyway and will find the wider character and update accordingly. Thanks Again !!!

    C / C++ / MFC tutorial help question

  • Rendering Font Fixed Width
    M MJ_Karas

    Thanks Prem.....But I need individual character columns to line up vertically just as they would with a fixed pitch font.:)

    C / C++ / MFC tutorial help question

  • Rendering Font Fixed Width
    M MJ_Karas

    Can anyone provide me information on how to render the font in a dialog edit box in a fixed pitch format as opposed to the normal way that the font normally displays. For example the normal Dialog font is MS San Serif and this is a font with variable width characters and is normally rendered in a variable pitch manner. I need to render the font in a fixed pitch format so that columns of text in edit boxes stacked above one another will line up vertically. I have tried using the Trur Type Courier font....That works until one switches the dialog font to unicode in order to support Japanese, Chinese, Arabic, etc. ANy help out there?

    C / C++ / MFC tutorial help question

  • Reporting Property Page Button to Parent Dialog
    M MJ_Karas

    Thanks for your reply. Your suggestion game me an idea to try. Instead of cloning the handler and the message table I can see (from a debuggger trace) that within the button handler of the property page I can use GetParentOwner() to get the CWnd* of the parent dialog. Using this I can send a message right to the base dialog. I do have yet to work out just what message to send. I would like there to be a single handler in the base dialog for all of the various buttons on the proprety pages. Due to this I inclined to look into the WM_NOTIFY scheme or to otherwise use the ON_REGISTERED_MESSAGE() macro mechanism inthe message map and make a custom message type via a registration with windows. Mike

    C / C++ / MFC question help tutorial

  • Code Segment Question
    M MJ_Karas

    Loli10: b=a; will give compile time error becasue it is not legal to assign the int value from a to the pointer value in b. b=&a; this moves the address of a to the pointer variable b....the answer you were looking for. b=*a; this is not legal because *a means get contents pointed to by a and yet a is not a pointer variable. *b = a; this is a legal statement IF b has a valid pointer in it. If so then the value of a is moved to the integer pointed to by b. &b=&a; this is not legal becasue it does not make logical sense to use the & address of operator on the left side of an = sign. Mike

    C / C++ / MFC question

  • Reporting Property Page Button to Parent Dialog
    M MJ_Karas

    I am looking for help in understanding how to have a parent dialog be made aware of button presses that occur from buttons that are pressed on the panes of a property sheet. I already have code in the classes, for each of the property pages, that gets attention when each of these buttons is pressed. I have that code in the property page class becasue some information from the page controls needs to be gathered and then the parent dialog needs to know this information. The parent dialog uses this to change an edit control contents that is on the dialog outside the client area of the property sheet. What is the method to report this information out to the parent dialog? MIKE

    C / C++ / MFC question help tutorial

  • How Do I Detect Activity In a CEdit Control ?
    M MJ_Karas

    Thanks Jon. Your idea gave me the encouragement to do what needed to be done. I subclassed the CEdit control with a class that has message handlers for all of the appropriate messages that potentially change the caret position in the edit box. These include WM_KEYDOWN, WM_KEYUP, the three left moouse button messages, the three right mouse button messages and the reflected CHANGE message. It turns out that WM_CHAR is not so very useful as this does not get sent except for typed characters that will be modifying the edit box text contents. One sees no response there except for the likes of the arrow keys that actually move the caret around. Thanks again. Mike

    C / C++ / MFC question c++ help announcement

  • How Do I Detect Activity In a CEdit Control ?
    M MJ_Karas

    With the MFC class CEdit it is possible to receive notification messages for EN_UPDATE (for when the control is about to display altered text) and EN_CHANGE (for when the control has finished the display of altered text). Can anyone tell me how I can get notification to my dialog when the user is simply moving the cursor caret around inside the edit control and the text is not changing? I am using a single line version of the CEdit control. Your help would be greatly appreciated. If you need further information about what I am doing or in order to answer my question please leave a reply post here and I will answer back. Thanks Mike

    C / C++ / MFC question c++ help announcement

  • Using a Timer in a Subclassed Control
    M MJ_Karas

    Thankyou All that replied on the Timer issue. And thx esp to Nemanja for the link to the timers article. Mike ;)

    C / C++ / MFC question workspace

  • Using a Timer in a Subclassed Control
    M MJ_Karas

    I have a question of about the use of a system timer within a class. The class in question is a dialog control class derived from CEdit. What I need to know is when is the appropriate time to allocate and setup the timer via the call to SetTimer(). I also need to know when is the appropriate time when to quit the timer service via the call to KillTimer(). My initial thought was as follows: Call SetTimer() within my class constructor; Call KillTimer() within my class destructor; However I have been thinking if it would be better to add event routines to my class to support the WM_CREATE and WM_DESTROY and place the calls as follows: Call SetTimer() within my class OnCreate() event handler; Call KillTimer() within my class OnDestroy() event handler; For any of you out there that are more experienced than myself I would ask.... Which of these approaches is better or more apt to work better? And if these are neither appropriate then what is the proper implementation? Thank you, Mike

    C / C++ / MFC question workspace

  • Using Line Control On a Dialog
    M MJ_Karas

    This is a great idea Ravi. I like this solution because it can be totally handled at design time and requires no code to be added. After all who wants to have to add more code to draw a line on a Dialog Box..... I still miss the old Borland BC3.1 C C++ compiler from 10 years ago for programming with Win 3.1 & WFW. Their RESOURCE WORKSHOP tool had a nice line control with six separate styles to pick from....Why today does MS not support the lowly line???? Mike

    C / C++ / MFC c++ csharp visual-studio design help

  • Using Line Control On a Dialog
    M MJ_Karas

    Thankyou very much Roger,,,,I will take a look at it.

    C / C++ / MFC c++ csharp visual-studio design help

  • Using Line Control On a Dialog
    M MJ_Karas

    I use Visual C++ 6.0 Professional with Visual Studio. In the Dialog design tool I would like to put a raised bump line or a sunken line grove onto the dialog. The problem is that for reasons unknown to me there is no LINE tool on the Dialog Controls Palette Tool bar. Can anyone tell me how to design a line into my dialog at design time? Then also is there some way to add a line tool to the Dialog Controls Tool Bar? Thanks Mike

    C / C++ / MFC c++ csharp visual-studio design help

  • Problem getting to Event Procedure for a SubClassed Control
    M MJ_Karas

    Actually I found that my check code in the dialog was never happy with the edit text and was changing the edit box content...This apparently cases the edit control to get another update message and so the process went on till some 12 megabytes of stack get used up!!!! Thanks again,,,I think I am on track now of how to correct the problem. Your help with ON_CONTROL_REFLECT_EX is more than appreciated !! Mike Karas

    C / C++ / MFC help c++ question workspace

  • Problem getting to Event Procedure for a SubClassed Control
    M MJ_Karas

    Thanks for looking at all my code!! I tried the ReBuild All again (I had done this before anyway out of normal practice) but it does not help the problem. I have now done some debug investigation. I set two breakpoints. One at the UpDate function in the CStringEdit class and one at the Update handler code in the parent dialog code. What seems to be happening is that the two breakpoints are being hit alternately first the edit control update and then the parent update routine in a never ending loop. I see the ESP register steadily going downard in addresses at each breakpoint. I am guessing that there is an interlock in here that some how that makes the stack grow till it reaches its lower bound and tries to reference memory outside my programs stack area. DOes this seem like this could happen?? And if so how does one fixup to prevent a deadly loop like this from happening?

    C / C++ / MFC help c++ question workspace

  • Problem getting to Event Procedure for a SubClassed Control
    M MJ_Karas

    I have made a smart edit control class called CStringEdit that is subclassed off the CEdit class. This control works very nicely for me when I include it as a member variable control in a Dialog class. The purpose of this control is to let me have a lot more run time control over a users data entry in a dialog edit box. The CStringEdit class has interfaces to perform these functions: void SetFixedLen(BOOL bFixedLen) ... used to set the string to fixed length padded if necessary to the right at the call to GetText(). Defaults to FALSE. void SetMaxLength(int nMax) ... used to set the maximum string length. The default value of zero means no length restriction and FixedWidth feature is ignored. void SetLegal(LPCSTR lpszLegal) ... used to enter a string of characters that are legal in the edit box. Defaults to NULL string which means that all characters are legal. void SetIllegal(LPCSTR lpszIllegal) ... used to put in a string of characters that are specifically illegal in the editbox. Defaults a NULL string such that there are no illegal characters. void SetText(LPCSTR lpszText) ... used to send intial text to the edit box. void GetText(CString& strText) ... used to get back out the edited text string. This control class uses a connection that I setup with the ClassWizard on the OnUpdate() message to validate the edit box contents at each instance that the control thinks there has been a change to the text content and it thinks it is time to re-display the control contents. In this event routine I do the validation to limit the string length and verify if the string contents are valid. It works just dandy!!! :) NOW FOR MY PROBLEM....... I have a particular instance of this control in a dialog where there needs to be some additional real time validation of the edit box content that is dependent upon other things on that same dialog. I have tried to connect the specific instance of this edit control member variable to its own OnUpdate() procedure in the dialog class. Once again this cinnection was mapped using the Class Wizard. My problem is that the event procedure is never being invoked. :confused: Can anyone help me figure out why this does not work?? I can send the whole class source code plugged into a simple demo app if my write-up here is not complete enough.... Thanks from a new VC++ 6 user. Mike

    C / C++ / MFC help c++ question workspace
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups