|
This is a bit too much C++ as I am mostly a Perl/PHP developer. I was hoping for something that I could do with simple file I/O. =)
I will look into it however.
Thanks!
|
|
|
|
|
Well then you could just open the file, and read from the end of it. Maybe keep track of the file size from the previous open, and compare to it's current size, and then read in the difference from the end. That's slower, and less complex, but makes heavier duty use of disk IO. Don't know how big a deal that is for you.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Kenny0323 wrote: This is a bit too much C++...
Actually, memory mapped files have nothing to do with C++. One thread/process will need to call CreateFileForMapping() (all others will need to call CreateFile() ). Call CreateFileMapping() , then use the pointer returned from calling MapViewOfFile() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Will NotifyChangeEventLog() help?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I looked into this, but this seems tailored to logs that use the same format (and actually write to) the windows event logs. Which our system does not.
Thank you, though.
*** I guess I should have been more clear. These are *not* standard Windows App Event Logs, they are flat text .LOG files.
|
|
|
|
|
Kenny0323 wrote: I looked into this, but this seems tailored to logs that use the same format (and actually write to) the windows event logs.
When you said "application event logs", that only means one thing to me.
Kenny0323 wrote: These are *not* standard Windows App Event Logs, they are flat text .LOG files.
You'll need to make sure that read and write operations are synchronized. Otherwise, one could preempt the other and you'd have a big mess to clean up.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
How to change color of text and background on the About dialog ?
|
|
|
|
|
Is there a method that, when you select something from a drop down menu, will automaticly go to another dialog edit control box? Like when you hit tab, so that the number, or whatever is inside, is highlighted and ready to be chaged. It seems there should be, and i dont think im wording it right in my google searches.
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Why not just call SetFocus() in the menu handler to set the focus to the edit control? You might need to do a SET SEL as well.
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Yes, setsel was what i was looking for, thank you.
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Hi,
I developed a thumbnail viewer using doc / view architecture and GDI+. I have done the rotate, flip options, but when we choose or click any thumbnail image, I want to draw the focus rectangle around the image instead of bluecolor shadow selection. Can u help me ...... if it is possible send a sample code.
Thanking you.
Regards,
Inbakumar.G
-- modified at 9:37 Thursday 1st December, 2005
|
|
|
|
|
Greetings:
I am trying to create one of those dialog boxes that have an "expand and contract" feature. I'm sure you have all seen them: The box has a smaller "fixed" segment, say, at the top, but there is a control, like a button that says "More >>" that causes it to expand at the bottom and reveal additional controls and options.
I think I understand that I need to create TWO dialog resource templates, one representing the fixed top portion and a second that is layed out at the top identical to the first dialog but larger at the bottom with the extra controls. Then, when the "More >>" button is pushed, somehow, I swap the old resource template for the new one.
Its the "somehow" part that has me stumped. I have two questions:
1. How do I keep the dialog open while I swapp templates? (Or can I? Is this done some other way?)
2. How do I do this trick while keeping the fixed part of the dialog positioned on the screen? In otherwords, I don't want the the new, larger, dialog window trying to re-center itself. I want the top part to stay put and the swap operation to appear as though the dialog has literally expanded at the bottom.
If it turns out that I have to essentially close the old dialog and re-open it with the larger template, then I would like to preserve the illusion that the original dialog is simply expanding to revela more controls.
I guess that is a pretty loaded request but any assistance would be greatly appreciated.
Thank you,
Mark
|
|
|
|
|
You can create a second dialog resource and attach a class to it. Create it as modeless, and a child of the main dialog. When user presses the more button, show it using ShowWindow(SW_SHOW); and position it correctly using SetWindowPos() etc. Similarly when button is pressed again, check if it is visible: m_ChildDialog.ShowWindow(! m_ChildDialog.IsWindowVisible());
Hope that helps.
this is this.
|
|
|
|
|
Hi Khan:
Is there anyway to do this and still keep the dialogs modal?
Also, what will happen if the user moves the new window? Won't the old window be revealed behind it?
Thanks for your help!
Mark
|
|
|
|
|
If you need to scroll the controls at the bottom into view, then create all the controls on the main dialog, and increase/decrease the height of the dialog in a loop using SetWindowPos() .
this is this.
|
|
|
|
|
I've done this by dinamically hiding\disabling set of controls + resize of the dialog itself. If your extra portion is in the middle, this would need some efforts to reposition other controls, but I have done this too before.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
|
Thanks Igor. I'll check these out.
Mark
|
|
|
|
|
What do you think if I implement my classes in .h files instead of dividing the declarations in .h files and the implementation in .cpp?
Is this a bad programming style or it will bother the compiler?
|
|
|
|
|
For me it seems strange,
I know that AppWizard makes the reverse for CAboutDlg of
a single/multidocument app
It inserts the declaration in .cpp before the implementation
I think it's better the usual way
|
|
|
|
|
it wont bother that much the compiler if you do it correctly.
however, it is a bad habit to do so.
we generally put into headers only declarations, other includes, class definitions, and the implementation code into deparated .cpp files...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
|
|
|
|
|
toxcct wrote: it wont bother that much the compiler if you do it correctly.
It doesn't bother the compiler, but it bothers the linker.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hello,
It's a bad (C/C++) programming practice and it will bother the linker if you include the header in more than one place. (Multiple defined symbols...). Besides that, if you place all your code in header files (no *.cpp file(s)) you'll not be able to create object files and executable code...
If you are talking about templates (I assume you are not), then you have to put all the code in a *.inl document or in the header file.
Hope this helps you.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
bad idea, if you change the implementation all file dependant on that header file will be recompiled.
Also, I don't think the debugger will be able to step in the code.
anyway, bad idea, I sure others will give you other reasons why.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|