|
When I entered the forum here today, I saw your post at the top and just asked myself -"Am I in the Lounge?". I had to check once to make sure that I was in the C++ forum and not in the Lounge.
Christopher Duncan wrote: hey, I'm just a geek like everyone else around here. Some days are good, some days are okay, and some days the screen turns a particularly interesting shade of the color blue.
Yes, but I believed that people with reputation as high as yours either don't face any problem while programming or they restrain themselves from asking for help here if they face any. But its really nice to see you post a question and ask for help here.
Regards,
Vijay.
|
|
|
|
|
The biggest wisemen are always those that know where their limits are and are not afraid to recognise that they have errors/questions as the rest of the "mortal" people, although less
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hi,
I am using VC++ 6.0 . I have one MDI application which has Diaglog Bar on the left which has tree control on it. Now when I double click one of the leaf in the tree, it opens the child window. This child window will have Edit Box. I have set the focus to the Edit Box when it opens using the following line.
PostMessage( WM_NEXTDLGCTL, (WPARAM)pEdit->GetSafeHwnd(), (LPARAM)true );
Now along with that, the Edit Box text is also selected which I don't want.
I just want the focus to that edit box. And if possible then cursor at the
end of the text in the edit box.
To remove the selection I have added following line after the PostMessage line:
m_Edit1.SetSel( -1, 0 );
But the selection does not remove/disappear. I have tried different SetSel function ranges but whole text remain selected.
Please let me know, how to remove the selection in this case?
Thanks,
|
|
|
|
|
Finally I found the solution .
I made an event on Edit i.e. OnSetfocusEdit1() and add the following line and it is working. If I add that line out side this function then it is not working.
m_Edit1.SetSel( -1, 0 );
Thanks
|
|
|
|
|
Member 4538510 wrote: This child window will have Edit Box. I have set the focus to the Edit Box when it opens using the following line.
PostMessage( WM_NEXTDLGCTL, (WPARAM)pEdit->GetSafeHwnd(), (LPARAM)true );
Are you Posting the message from the child window? If so why do you want to post a message from the child window when you can get a handle to the edit box?
Member 4538510 wrote: To remove the selection I have added following line after the PostMessage line:
m_Edit1.SetSel( -1, 0 );
If you are posting the message from the dialog bar, calling SetSel() will not have any effect. You need to call SetSel() inside the child window
Yusuf
|
|
|
|
|
Thanks Yusuf,
I am not Posting the Message from child window. I am posting from the DialogBar on the left on which Tree is placed. From the Tree leaf I am opening the child window thus require PostMessage.
Thanks,
|
|
|
|
|
Hello all,
I have a CDialog-based application with a set of controls on the top half that do not change. On the bottom half, I would like to add a panel of controls that I can change based on some state within the application. The number, size, and functionality of the controls on each individual panel will be completely different for each panel. Basically, I would like the functionality of a CTabControl (CPropertySheet/CPropertyPage?), but without the tabs. It would be convenient to have a resource template for each panel, like in a CTabControl, but I would like the controls to look as if they are actually on the dialog, rather than on a Tab. Can someone suggest a method of doing this? Also, please tell me if this violates some major paradigm of MFC! I don’t want to just hack something together; I want it to be maintainable!
I hope my question made sense. Thanks in advance for your help!
+-------------------------------------+
| |
| Other application Controls |
| |
| |
| +----------------+ |
| | Panel of | |
| | state-specific | |
| | controls | |
| +----------------+ |
+-------------------------------------+
|
|
|
|
|
There might be a nice, clean resource file way to do this, but over the years when I've been faced with such a task, I ended up writing the code by hand in the dialog class. By that I mean that I dynamically allocated the CButton, CEdit and such controls, and then set their position / hid them / displayed them / etc. in code.
One method I used was a group box control that was always visible, i.e. your bottom panel, which gave me a relative reference point to use in positioning the other controls. It's maintainable, but frankly it was never something I was proud of. However, there's always these darned deadlines, and it got the job done.
I don't know if this is the sort of thing you're looking for or not (and there may be more elegant solutions), but it's at least one option open to you.
Hope this helps,
|
|
|
|
|
What about a modeless dialog, which can be created from resource template, and place it as a child window on the main application windows, you can then Show/Hide the panel (modeless dialog) depending on your program state. This should work.
I am not sure and not going to try it out now, may be wizard mode modeless property sheet will also do the work.
|
|
|
|
|
im a self taught win32 programmer and i have a project where i want to record the screen, a program like fraps. but i want it with the gui of win32 and not console, how do i do so?
|
|
|
|
|
What exactly is the problem - you don't know how to record the screen or you don't know how to create a GUI application?
-Saurabh
|
|
|
|
|
When you start a new project choosing "Win32 Project", Visual Studio creates the skeleton of the Win32 GUI for you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
well i know how to create the gui etc. i just dont know what code to use to record the screen. once i can get a base code to work on or an article or somethin then i can start. i dont know anything about recording code.
modified on Monday, May 5, 2008 7:34 PM
|
|
|
|
|
Can No one Help me!!!?????
|
|
|
|
|
windows works with "windows objects", try to get the desktop window object and.. work with it. I never tried what you want, but i'll start from something like i said.
Recording data is easy, problem is how to get those data.
|
|
|
|
|
I'm creating a linked list that stores two strings in each node.
I quickly drafted the code as:
<br />
struct SongInfo {<br />
CString Title;<br />
CString Address;<br />
SongInfo* next;<br />
};<br />
<br />
void CreateList() {
...<br />
if (bINeedAnother) {<br />
cur->next = new SongInfo;<br />
cur = cur->next;<br />
}<br />
...<br />
}<br />
I am using CStrings since the length of the strings is unknown. However, since once they are initialized they don't change, I am thinking I should change it to dynamically allocated WCHAR pointers, with the appropriate length for each string. Or is there another practice that would be better?
The other question is on the allocation of the nodes. The number of nodes can be as few as 10, and I've seen as much as 300. Is it a bad idea to allocate one node at a time (i.e. can I rely on Windows to keep the memory unfragmented)? If so, what is a good practice here?
(Sorry for the noobish questions, my programming professor sucked, and her linked lists ALWAYS crashed, and she ALWAYS blamed the OS.)
|
|
|
|
|
1. using CString is ok.
2. usually, when building linked lists, we (me) allocate one node at a time;
Best practice in 2008 would be to use STL (list or vector or dequeue).
|
|
|
|
|
STL containers are well optimized and you have several types where choose. A good practice is using STL (at least, it's my opinion)
Dinamic resizing of vectors was a great help for me some years ago.
|
|
|
|
|
Hello,
I need to change the typematic rate/delay (moreover accessing leds). is there any way to do it without a device driver?
I have seen some small MFC applications (less than 500kb..) that can access to leds. SDL libray can, Allegro can... but, without using 3rd party libraries only with VC++/MFC?
I need to send data to a custom keyboard (yes, i know it's an output device), but since XP kernel inhibits direct access to hardware i had to find other way to send data without making a device driver and... with typematic and led status i could achieve it (data will be sent so much times as needed, not only once).
All help will be great.
Thanks U.
modified on Wednesday, May 21, 2008 12:31 PM
|
|
|
|
|
alichan wrote: I need to change the typematic rate/delay (moreover accessing leds). is there any way to do it without a device driver?
Have you tried changing the following:
HKCU\Control Panel\Keyboard\KeyboardDelay
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hi
How do I customize the standard property sheet buttons
I can change the text of the button using
CWnd *pWnd = GetDlgItem (ID_APPLY_NOW);
pWnd->SetWindowText("Hello");
but what i want to do it add an icon onto the button as well
Can any one help ?
thanks
simon
|
|
|
|
|
Associate a CBitmap object with the button and call its SetBitmap() method.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|