|
Can't you not use a CFormView and create your controls on the dialog resource?
Michael
|
|
|
|
|
Yeah well..
You know what?!
That idea.. You can just.. stuff it up.. hmm.. maybe..
Guess it wasn't quite so dumb afterall :P
I might just do exactly that!
Thanks man! =)
I O U 1! =)
"You know you're drunk when you can't even lie still on the floor without holding on to the floor"
|
|
|
|
|
Hi !
I have one option of a menu and I need to change the associated bitmap, in modifyMenu it asks me for a pointer to bitmap, but...
Should I take care to destroy that bitmap or the menu handles it ?
Thanks, Bye !
Braulio
|
|
|
|
|
Should I take care to destroy that bitmap or the menu handles it ?
You're responsible for destroying the bitmap. However, you should do it until the menu uses this bitmap. If you delete it earlier, you will see garbage in the menu item.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I need help bad!!!!!
I created a second toolbar in addition to the default toolbar. Everything works fine in release mode, but in debug mode, the application hangs upon exiting. If I remove the toolbar everything works okay. If I add just the definition of the toolbar and not the code, it hangs in debug mode. I'm using CToolbarEx to define the toolbar. Any ideal to what could be causing this?????
Any thought, comment or assistance would be greatly appreciated.
I found the following errors:
memory check error at 0x00D45834 = 0x00, should be 0xFD.
memory check error at 0x00D45835 = 0x00, should be 0xFD.
memory check error at 0x00D45836 = 0x00, should be 0xFD.
memory check error at 0x00D45837 = 0x00, should be 0xFD.
Could this be anything???
Thank-you
Sincerely,
RAH
|
|
|
|
|
Ctrl+Break when app hangs and have a look at the call stack. You should be able to see where's the problem.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
|
Is exiting the function right away will provide less memory movement
Don't worry about that. Worry about code readability - and in this case exiting early wins hands down.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Chances are it makes no difference which version you use, as probably the compiler redirects all returns inside a function to the same code stub. Anyway, you can always try to run a profile batch against your program to know (your VC++ comes with a profiler tool).
From the point of view of readability, my opinion is (in accordance with what others have said) that the first version is better: When you finally got to the main part of code all secondary scenarios are ruled out, and that makes it easier to concentrate on a smaller mental model of your problem. That's how my brain works at least. I guess this could make for an interesting discussion subject at the lounge.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
second option generates a higher jump value than the first one
So what? How many nanoseconds do you want to save? I think you're wasting your time on totally irrelevant stuff.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
|
In a 3d engine, nothing is Irrelevant when it's about optimization
Bullshit. In function like this you're checking if file exists. This means you have to call underlying OS, which usually causes context switch. This operation alone takes orders of magnitude longer than time saved with possible 'optimization' after rearranging control flow.
As Michael Abrash writes in his "Graphics Programming Black Book":
Know when it matters. (identify the portions of your program where peformance matters, and don't waste your time optimizing the rest.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
|
But let say this function is called every cycle
Are we still talking about bmpLoader function? Do you suggest that you'll be loading bitmaps from disk in tight, time-critical loop?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have made a DLL. I have used it from SDI program. I want to send a message from dll through SendMessage() to view of SDI.
I have written the message handler as well. I have registered the message on both dll as well as application (that is SDI)
Luck favors the prepared mind.... [Under Siege 2]
Regards Naveed.
|
|
|
|
|
I have created a help file external to vc++, but i can not figure out how to run it.
I have created a message map
ON_COMMAND(ID_HELP,OnHelp)
I have created a OnHelp function
What do i need to put in the OnHelp function to startup the help file?
Or am I looking at this from the wrong direction
thank you ?
|
|
|
|
|
From MSDN:
WinHelp
Starts Microsoft® Windows® Help (Winhelp.exe) and passes additional data that indicates the nature of the help requested by the application.
BOOL WinHelp(
HWND hWndMain,
LPCTSTR lpszHelp,
UINT uCommand,
DWORD dwData
);
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
In a class,I want to put the method's address to a DWORD value.
How to do it? or can I access the vtable of the class?
hi
|
|
|
|
|
You can't do that in a portable way. Why do you need this functionality?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I want use assembly to call method.
now I got the way to do it.thank you!
hi
|
|
|
|
|
class foo
{
public:
void func ( int x ) {}
};
DWORD dw = (DWORD) foo::func;
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
DWORD dw = (DWORD) foo::func;
Sorry - this will not compile, at least on VC6 (error C2440).
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
I am resizing a CTabctrl in response to a WM_size. Basically I want the Tab Control to fill the entire window at all times.
My Code is as follows
CRect size;
GetClientRect(&size);
int iWndWidth = size.right;
int iWndHeight = size.bottom;
::SetWindowPos(m_tabs,0,0,0,iWndWidth-15,iWndHeight-15,SWP_NOMOVE | SWP_NOZORDER);
Can anyone tell me why i needed to subtract 15. By the way It's a CFormview i am working with.
Thanks In Advance
Rich
|
|
|
|
|