|
I have an OpenGL application app based on MFC. I have a requirement that I need to redraw the whole scene every second(some sort of animation). When I use the standard method of invalidating the client area every second, the CPU usage is very high and my app does not respond to any other commands.
Can someone suggest any better ideas?
Thanks
|
|
|
|
|
Only redraw the scene when something changes.
If you still need a frame every second, do a ::BitBlt() each second.
Michael S. Scherotter
Lead Software Architect
Tartus Development, Inc.
|
|
|
|
|
I tried defining an entry in the Accelerator table (CTRL+ALT+Z) and attaching it to the ID of a button. That didn't seem to work, cuz nothing happens when i press the key combo.
I would appreciate any help.
Thank you.
|
|
|
|
|
Never mind.
I just answered my own question.
For those who are interested, use RegisterHotKey() along with WM_HOTKEY message.
Works like a charm.
|
|
|
|
|
I enumerate the encoders registered on my computer(such as:Cinepak Codec by Radius, MJPEG Compressor,DivXMPEG-4 Fast-Motion...).Then how can I select one of them (Such as DivXFast-Motion) to compress the timeline using DirectShow filters?
Note:
These encoder have the same CLSID(CLSID_AVICo),only FccHandler and FridenlyName are different.How to select one of them?
Thanks!
|
|
|
|
|
is there any way to get the local time of your computer without using time_t of time.h?
|
|
|
|
|
No solution friend.
You will have to give up using time_t and start using Win32 SDK calls
these revolve around SYSTEMTIME structure and functions are GetSystemTime GetLocalTime.
|
|
|
|
|
thank you very much i will try that!
|
|
|
|
|
I wanna run an exe file from my software that is coded in VC++... Is that possible???? If yes can someone tell how??
Thanx....
|
|
|
|
|
_spawn works for me. Or WinExec. Or CreateProcess. Or use the help system...
|
|
|
|
|
ShellExecute can also be used.
- David Gevert (don't feel like logging in.)
|
|
|
|
|
Search as I may, I cannot find how to set a selection in a clistctrl from within code ( as in preseting a selection when the control is first populated ).
Also, I notice that whenever the dialog bar containing the list control is significantly moved ( un/docked, un/hidden ) the highlighted selection disappears.
Can anyone tell me how to handle these things?
I imagine they're fairly simple.
Thanks in advance.
|
|
|
|
|
To set the selection: ListView_SetItemState ( hwndYourList, nIndexToSelect, LVIS_SELECTED, LVIS_SELECTED );
You can add LVIS_FOCUSED to the flags to set the focus rectangle to the item as well.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
I am having problems reading an object from a file..
this the class:
class MEMVAr
{
public:
CString Course;
int Wheight;
CString Grade;
MEMVAr() : Course(""), Wheight(0), Grade("")
{ }
};
I have declared the object as a public variable in the class CGPACalcDlg as follos:
MEMVAr D_F[18];
now.. when I write the object to the file using this function:
void CGPACalcDlg::OnWrite()
{
ofstream outfile("data.dat", ios::binary);
outfile.write(reinterpret_cast<char*>(&D_F), sizeof(D_F));
outfile.close();
}
the follwing function only reads the integers:
void CGPACalcDlg::OnRead()
{
UpdateData (TRUE);
ifstream infile("data.dat", ios::binary);
infile.read(reinterpret_cast<char*>(&D_F), sizeof(D_F));
infile.close();
UpdateData (FALSE);
}
I can only view the integers in D_F object.. what is wrong with the code ?? why I can't read the CString variables?
|
|
|
|
|
A CString only holds a pointer to the string data (much like a plain char*) so when you write out the raw struct, you don't save the string itself. You'll need to write out the actual strings, and when you read back in, assign the strings to the CString memebers.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Do you think converting the CString into chars, then write the whole thing will help ?
|
|
|
|
|
|
I need to make a small HTML editor , not a tag editor a WYSISWYG type like FrontPage
I only need the view class or atleast HOW to make one, it should be interactive so when I
write http://www.somesite.com it will change it to a hyperlink and I can insert an image.
any thing will help...
|
|
|
|
|
I'm in need of some code to filter a list of files based on their types. Now, I could use the extensions, but I'm using the shell functions to get the filenames, and these may not include extensions. I thought I'd try to use the shell functions to query the flie types, but.. alas.. there does not seem to be such a function! SHGetFileInfo will return the file type name - the descriptive name shown to the user - among other things, but I'd rather use the type itself. (As a ferinstance, the file type for a .cpp file is "cppfile", whereas its type file name is "C++ Source File".
Anyone know how to do this?
Jim Johnson (sorry, not anonymous, can't remember my *%^% password...
|
|
|
|
|
Are you using IShellFolder to enumerate files? If so, when you call GetDisplayNameOf(), you can pass SHGDN_FORPARSING to get the raw filename.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Hey guys, is there an easy way to dynamically create a menu based on the contents of the windows\start menu\programs folder and all subfolders?
I'm creating a shell-type thing for my Computer Science 201 class; it's a very simple and limited shell right now. I'm kind of, err, a beginner, when it comes to VC++, but I know shells out there that can dynamically generate menus on the fly, and that feature would come in handy and pretty much instantly make my program usable.
Another question I have: is there any practical way to let a user add/delete/edit buttons, like ones that launch programs? Right now my shell is a simple dialog box with two buttons (launching notepad and wordpad with ShellExecute(...)), a calendar, and a run command.
Thanks!!
|
|
|
|
|
Use CreatePopupMenu() to create a new popup menu. Then call InsertMenuItem() to add items into the menu. To enumerate the Start menu, get the location of the Start Menu directory with SHGetSpecialFolderLocation(), then FindFirst/NextFile() to enumerate the contents of that directory.
How you organize stuff on the menu is up to you.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Hi,
Does anyone have an idea how to set a network card in "promiscuous mode"?
I was thinking about playing around with writing a network_sniff_thing, mostly for the challenge of it...
Any hints/ideas are welcome...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I believe my sister spent most of the 80's in promiscuous mode ( that was the word on the street in any case ), but my attempts to set other women to that mode failed completely.
Christian
#include "std_disclaimer.h"
|
|
|
|
|
Now I see why you use #include "std_disclaimer.h"
Hehehehe
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|