|
josip cagalj wrote: lpofn.nMaxFile = 0;
Why is this set to 0?
josip cagalj wrote: and still not working!
Which means what?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The parametar lpofn.nMaxFile was initionali set to lpofn.nMaxFile = sizeof(szFile);. i make a mistake copying code and i dont know how did i deleted it.
With "and still not working!" i ment thad openfile dlg still dont shows it self!
The 'GetSafeFileName(&lpofn)' does not open dialog!
|
|
|
|
|
|
|
Did you check _WIN32_WINNT and also your code working on the vs2005
|
|
|
|
|
http://www.codeproject.com/dialog/searchfolders.asp[^]
When it comes to the bit where you add member variables of this new static text type, how do you get that to appear in class wizard, so that you select the static control, click member variable, set that to control and then your option is to set it "CStatic". Is there something I'm supposed to do to make CStaticFileSPec appear, or do you just set it to CStatic and the "subclassing" lines in OnInitDialog take care of that?
|
|
|
|
|
Hi,
sorry to follow this up, but can someone point me in the right direction with this. The class here would really help me by displaying some long filenames in a dialog app I have, but am unsure whether the instruction to add a member variable means something via the class wizard, or if I can just manually insert this into the class via the code (and making sure I have everything in the right place)
|
|
|
|
|
OK, I just added it into the dialog class directly and it worked fine. Sorry for being a muppet.
|
|
|
|
|
How to get a text on the label control ? I have used the label control of the XGraph, It display a blank label. I need some text should be inserted and then properties are applied further.
thanx in advance
rams
|
|
|
|
|
Can you use of GetWindowText
|
|
|
|
|
If the label control is like a "real" Windows control, and you can get it's HWND , you may be able to use something like GetWindowText(...) . If it is a custom control, or is completely managed by your XGraph class/library, you may have to go through that class/library to get the text for the label.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi,
I have a Dialogbox (Main Dialog). I need to have another dialogbox (no title bar) inside this main dialogbox.
How can i do this ?
Thanks.
|
|
|
|
|
Insert a dialog to your resource or insert a new CDialog to your class
|
|
|
|
|
I mean to say that the second dialog should appear like other controls in that main dialogbox.
How ?
|
|
|
|
|
Sakthiu wrote: I mean to say that the second dialog should appear like other controls in that main dialogbox.
How ?
After insert it to your project use of Create
|
|
|
|
|
I have done this previously using two different approaches. The first was to simply reuse the Property Page/Property Sheet approach, the other was to manually manage the child dialog as a non-modal dialog window, and keep moving/sizing it as the parent is moved/sized.
You have to watch out for focus issues via keyboard navigation in either case. Look up the WS_EX_CONTROLPARENT style and KB articles that mention it for more information.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
You can right click on resource and insert CDialog to your project and on the main dialog use of
m_Preview.Create(IDD_MYDAILOG,0);
m_Preview.ShowWindow(1);
|
|
|
|
|
Dialogs are windows, just like other windows, just like controls.
You may want to look up windows and child windows in the MSDN and/or SDK.
Your dialog needs to be a child window (have the WS_CHILD style) and be modeless. You'll need to
position it within the parent window as well - you can use MoveWindow() for this.
|
|
|
|
|
Create a dialog box without WS_CAPTION style.
|
|
|
|
|
Hello,
I have a class that logs string information into text files. I do a lot of string operations (using CString) and there are several instances of my class running in the same time. Everything works fine excepting high CPU usage which goes up to 70 – 80 percent when 100-150 instances are running.
The final version of the project will require 300-400 instances running and the CPU usage should be as low as possible. If anyone can suggest me a CString replacement that will reduce the CPU usage, I would highly appreciate it.
Thanks,
Dan.
|
|
|
|
|
First, see if you really have to use CString at all... It is far too easy to get into the habit of abusing CString objects because so many developers are too familiar with them.
If you really do need to use a string object, you can try to reduce the number of allocate/deallocate cycles by keeping them around (i.e. do not cause creation of CString objects).
Preallocating space into them when they are first created may also improve performance. See the CString::GetBufferSetLength(...) function for more info.
For most logging applications, you rarely need to log all that much data. For example, a CString can hold easily hold more than 1 megabyte of data, but you will rarely be logging that much in a single call. If you have a maximum logging amount, something like 4, 8, 16 or even 32KB, you can easily use a stack-based buffer for something as small as that. This will significantly improve logging performance.
If you are logging large (>=4KB) amounts of data and using CString::Format(...) you are really wasting time due to the way CString::Format(...) works. You are much better off managing your own memory or sticking to stack-based buffers and a function like ::_sntprintf(...) .
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
IMO, avoid using all forms of (xxx)printf, including CString.Format.
I once hand-optimized a loop for writing magnetic tapes. I managed to decrease the processing time (for 1000000 simulated tape writes) from 21 seconds to 4.
Just by replacing one sprintf statement with a number of strcat(), strcpy(), itoa() e.t.c
A that time, I realized the cost (performancewise) of using (xx)printf.
And as James R. Twine said, avoid memory allocations.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Preallocation, as James has already been mentioned, will greatly improve the performance. You might also consider using string instead of CString .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: You might also consider using string instead of CString
Is string actually faster? Do you know of any benchmark results? I've got a couple classes in an application that use CString heavily, and wonder if string would improve their performance.
Software Zen: delete this;
|
|
|
|
|
Gary R. Wheeler wrote: Do you know of any benchmark results?
Nothing scientific, just empirical testing.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|