|
it functions!
thank you very much!
MFC
p.s.: i never find what i´m looking for in the msdn.
|
|
|
|
|
If i draw one from the toolbox, my application won't start, it exits right after starting. And if i try to create one with CreateWindowEx and PROGRESS_CLASS as classname like msdn does, it says it's an invalid class, how do i do it?
thanks!
|
|
|
|
|
What do you mean "a progressbar in my application?" do you want a visible progress bar in the status bar? I believe there are classes in the MFC sections that feature progress bars that are built right into the status bar.
Kuphryn
|
|
|
|
|
You need to call InitCommonControls() before creating the progress bar.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
hey there.. i am calling SetScrollPos() then calling UpdateWindow() in my CFormView derived class.. this causes a bunch of flicker in comparison to when you just use the scrollbar, but if i leave out the UpdateWindow() call then all it does is adjust the scrollbar and not move the view with it..
what command should i be calling besides UpdateWindow() ? TIA!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Flicker free drawing is such a pain in the a$$...
There are lots of ways to reduce or remove flicker, but each works under certain circumstances...
I don't understand why your calling SetScrollPos() and then UpdateWindow() ...instead of letting default scrolling to occur...?
You have a CFormView, so i'll assume you have dialog controls on the form and these controls are what are flickering...??
in your dialog resource try checking WS_CLIPCHILDREN , this will prevent your controls from flickering...
HTH
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
its a view i have that is displaying metafiles and text.. the default scrolling still works, but i have implemented a dragging hand for the view.. so im using SetScrollPos() to move the view when they drag it up/down. the dragging view works great, just has lots of flicker.. i have tried double buffering it, but that doesnt fix it.. the UpdateWindow() call is causing all the flicker..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Have you tried Keith Rules CMemDC class...if your drawing everything inside one function like OnDraw()
the his simple little class is all you should need...
Just remember to either make your background NULL or return false inside OnEraseBkgnd()
Did this work...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
i tried implementing double buffering with memdc, but it kept drawing the screen black.. however i was already overriding OnEraseBkgnd(), and i didnt think to look at that.. ill prolly try the double buffering again.. thanks for the suggestions!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
I'm having problems reading the proper EventID when reading the eventlog. Most of the Microsoft generated EventID's are OK, but some sources like Diskeeper will display as "1034662352" instead of "12" from the EventViewer.
Any ideas?
Here's a snippet of code that should give you an idea of what I'm doing...
pevlr = (EVENTLOGRECORD *) &bBuffer;
while (ReadEventLog(h, // event log handle
EVENTLOG_BACKWARDS_READ | // reads forward
EVENTLOG_SEQUENTIAL_READ, // sequential read
0, // ignored for sequential reads
pevlr, // pointer to buffer
BUFFER_SIZE, // size of buffer
&dwRead, // number of bytes read
&dwNeeded)) // bytes in next record
{
while (dwRead > 0)
{
printf("EventID: %d\n", pevlr->EventID);
}
pevlr = (EVENTLOGRECORD *) &bBuffer;
}
|
|
|
|
|
I have a database file that I want to delete if it already exists, so that I can create a new one with my code. I will have the path to the existing database available. How can I code so that it deletes the database if it exists?
Appreciate your help,
ns
|
|
|
|
|
use
BOOL DeleteFile(
LPCTSTR lpFileName
);
|
|
|
|
|
Thanks. But I also need to check that it exists. Or can I just blindly delete it even if its nonexistent? I think that might not work> Is there a FileExists kind og function thats available?
Appreciate your help,
ns
|
|
|
|
|
CFile::GetStatus() .
Damn, you're really making me feel bad! My FileSystem class (as yet unposted at CP) does all this and more!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hey stranger!
Thanks for the GetStatus. Hows the new project coming along?
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
Hows the new project coming along?
Cool!
Btw, contrary to what someone replied, you need to check if the file is readonly - if so, modify its attributes (use CFile::SetStatus ) before deleting it - or at least warn the user. Damn, I reeeeely should post that FileSystem class at CP! Its deleteFile() method has a bool bForce arg that will take care of this.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
CFile::GetStatus()
_access(...) is another way to do it!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
|
You can delete it even if it doesn't exist. Don't worry about DeleteFile, it won't crash your program if the file doesn't exist...well maybe on 98
Chris Richardson
|
|
|
|
|
Sounds like what you really want to do is use CreateFile with CREATE_ALWAYS.
|
|
|
|
|
Whilst looking at my MFC CWnd window, I often just fiddle with the mouse wheel out of boredom.. however my window has a slider control class on it, and if I've just moved the slider then fiddling with the wheel will make it move.
I would like to put in some kind of handler for the main CWnd so that if the user clicks anywhere in the window that isn't a control, the focus is given to the window and not the control.
Which handler do I use? CWnd::OnMouseActivate() doesn't quite seem to work in the way I want...
Thanks,
____________
Smidge
|
|
|
|
|
Hmmm, by wanting to have *no* child window have focus when the user clicks in an "empty" part of the window, you'll likely confuse your users by overriding Window's standard behavior (i.e. remembering which child window has focus).
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I'm aware of what the window behaviour would be like, but this would not cause major problems..
Do you know which message I should handle? Thanks,
|
|
|
|
|
I think you'd need to handle WM_SETFOCUS and WM_LBUTTONDOWN in PreTranslateMessage() . Good luck! I'd be curious to know how it works out.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I dont want to have duplicate entries, but I dont want any sorting either. I was using a set but it wont work for me since it sorts. A vector doesnt sort, but allows duplicates. Is there a container that will neither allow duplicates, nor sort?
Appreciate your help,
ns
|
|
|
|