|
Brilliant, thanks. Just trying now...
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks - now I have another external library that won't link so I'm trying to rebuild it with /MT, but even if I change that setting, I get the same error. Do you have any idea why that might be ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can someone explain to me the basics of source code colorizing?
I want to add source colorizing to a CEdit control, but I only have a rought idea as to where to get started.
Can you explain the steps for colorizing C++ code for just:
1) Strings
2) Comments
3) Numbers
4) Keywords
If you don't wish to explain, but instead know of an article which explains the state machine/engine responsible for colorizing a source document I'd like to hear about it.
I AM NOT however asking to be referred to any of the CP articles such as CrystalEdit which serves as a good example as to how a colorizing engine might work.
I would like a more detailed explanation than just reading someone source code and learning from that.
I should also note, that I am not planning on using any parsing framework like Spirit, etc...
I want to code the colorizer by hand Just becuz
Cheers
It's frustrating being a genius and living the life of a moron!!!
-- modified at 19:47 Monday 29th August, 2005
|
|
|
|
|
If you don't want to use a parsing framework, then you need to write one. The most obvious place to start is to search for keywords. My first step would be to add the regex stuff from Boost, to make it easier to find those words.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I should have mentioned, this is for a CEdit control, so regex would probalby be too much.
Everytime a keystroke occurs a function is called which is passed the entire controls buffer (actually i'm changing that soon to only visible characters - which creates a problem on it's own )
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Hockey wrote:
should have mentioned, this is for a CEdit control, so regex would probalby be too much.
I dunno, maybe I've been spoiled by C#, but regardless of how it's being stored/displayed, I think regex is the nicest way to have to be mashing strings looking for keywords.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I am not much of a GUI programmer when it comes to doing complex stuff so I hope you will bear with me and help me fix this problem. I have a CPropertyPage that I want to contain a Custom Control so I went to the Dialog Editor and Dragged the Custom Control to it, assigned an ID, and put the name of the window class that I am using for it (I registered the class). Now when I start my dialog, which contains the property sheet and this property page, the page fails to display. The funny thing is, if I get rid of the property sheet and page and just put this same control in a dialog box, all my code works correctly. What am I doing wrong? Why does my stuff work in a Dialog Box but not in a property page?
Mark Cariddi
|
|
|
|
|
BTW, if all I do is get rid of the custom control , the property page that contained the control displays. For some reason the custome control is not getting created when it is in a propery control. Is DDX_CONTROL the proper way to assign a variable name to this control....
|
|
|
|
|
I've noticed within my MFC application that should a MessageBox() API be invoked while the user is displaying a context menu that the menu is taken down and the MessageBox is shown. However, if a DoModal() API is called to show one of my dialogs while a context menu is being shown the menu stays up but you can no longer select from it. Its kind of frozen.
How can I go about causing the context menu to go away prior to calling the DoModal() API? Is there a way to search for a visible menu and then subsequently destroy them? Any ideas or code snipits?
Craig
|
|
|
|
|
|
Thanks very much. That's just what I needed to learn.
Craig
|
|
|
|
|
Hello,
I was looking for way to enumarate applications systemwide that currently using serial ports, let's say to get PID of who currenly has open COM1 or COM2... Actually I'm interested in the ports that are in use: "Port Settings->Advanced->Com Port Number" from "(in use)".
Thanks
|
|
|
|
|
I have a CWnd-derived class. In the demo dialog I'm put the object from this class. I'm need to handle an arrow button push in the object of the CWnd-derived class, but I can't retrive a WM_KEYDOWN message.
Can somebody help me?
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
You're not getting WM_KEYDOWN at all, or just for the arrow ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm not getting WM_KEYDOWN at all, but I need a arrow button only.
I'm try to handle a message in the OnKeyDown() handler and in the PreTranslateMessage() method.
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Then something else is swallowing the message - what on the dialog has the focus ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes, dialog has the focus. By press arrow button has effect in the last focused window (for example - CListBox). If I press TAB then after some steps I jump to the my CWnd::OnFocus() method.
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Eugene Pustovoyt wrote:
Yes, dialog has the focus. By press arrow button has effect in the last focused window (for example - CListBox).
Then, the dialog does not have the focus. How is this window being shown, is it a modeless dialog ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
No, it's modal dialog
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Then how can you be pressing tab to move the focus into the dialog ? Or did I misunderstand you ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You're misunderstand me. When I press TAB then focus jump by all controls of the MODAL dialog and to my control (OnSetFocus method) too. Therefore I think a dialog do process WM_KEYDOWN message, but this message isn't arrive at my CWnd-derived class.
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Oh - is your CWnd derived class a control on the dialog ? If that's the case, then the fact you need to press tab proves that your control does not have focus, and therefore does not get any keyboard messages.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes, my CWnd-derived class is a control on the dialog.
And how can set focus if SetFocus() method has not effect or how can I get WM_KEYDOWN message??
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
To get the message, you need the focus. Can't you set your control to be the one that recieves initial focus in the dialog editor ? Perhaps making it top of the tab order will do this ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In my OnSetFocus() handler I call CWnd::OnSetFocus(pOldWnd) and just SetFocus(), but it has not effect to getting WM_KEYDOWN message. How another I can set a focus?
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|