|
According to my age, my memory doesn't go back that far
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
According to the photograph in your CodeProject member's page, you're not that old.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
That was taken when I was 40.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
For determining class relations at runtime, MFC have its own mechanism called RTCI(Runtime Class Information) which is similar to RTTI in C++. You can resolve class relations by using CRuntimeClass::IsKindOf() etc.
[Edit] With respect to Pillani's reply.
So its obvious that C++ RTTI will be switch offed by default, since MFC itself is providing support. Enabling two similar stuffs at same time helps only to reduce performance.
I'm not sure, but i think that the RTCI evolved and exists together with RTTI due to historic reasons.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
modified on Monday, January 5, 2009 5:12 PM
|
|
|
|
|
Thank you very much, I've enabled it now and use dynamic_cast.
Yes, I habe VS 2003 .NET.
Niki
|
|
|
|
|
Hi,
I'm a long-time C++ programmer and relatively new in C#.
I have not been working with UI-related stuffs for a while.
Recently I had a project that is related to a GUI-based application, which requires a custom-style listview control. I found some listview controls in "the code project" that may fit to my purpose. But most of them are written in C# and it's output is a Class Library (DLL). In general, is there any way for me to use those custom listview controls written in C# in my Win32 C++ project (using Visual Studio 2005)? Or is it simply impossible? Thanks a lot for your help in advance.
|
|
|
|
|
I think you can use of it on the c++ and vice versa.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I needed to run multiple instances of an MFC Application. During testing I realized that there is a limit to the number of instances I can run (sometimes 86 other 101). After reaching this limit I couldn't even run a different MFC app unless I terminated some of the running instances. Does anybody know what is the cause of this behavior? Thanks.
|
|
|
|
|
Surely there's a limit on system resources, When the 180th instance of my MFC test application crashes, it was probably failing CreateWindow .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The graphics library I am using provides basic window functionality, painting, moving etc, but for anything more complex it provides the HWND to each window so we can call Win32 stuff.
My Win32 knowledge is limited, how can I alter the window style using the HWND? I've done some searching but haven't found anything - probably because I'm looking for the wrong thing.
Any help would be great!
Steve
|
|
|
|
|
You may change the window style at runtime using SetWindowLong function [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks,
I have made the following call:
SetWindowLong(window.getHWND(), GWL_EXSTYLE, WS_EX_CLIENTEDGE);
I also call SetWindowPos as stated in the documentation to cause the changes to appear. The window visibly changes. How would I specify that I want to remove or hide the window border and title bar? I have looked at the documentation for Window Styles and CreateWindowEx but am unsure how to achieve this.
I'm looking to achieve something similar to the result of the following .NET code:
myForm.BorderStyle = FormBorderStyle.None;
Thanks again!
Steve
|
|
|
|
|
Try something similar to:
SetWindowLong(window.getHWND(), GWL_STYLE, GetWindowLong(window.getHWND(), GWL_STYLE) & ~WS_BORDER);
IF this doesn't work, try instead of WS_BORDER the other, border related styles like WS_DLGFRAME (see here[^] for window styles.)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Something like this should remove any borders, unless I missed a border style...
::SetWindowLong(window.getHWND(), GWL_STYLE, ::GetWindowLong(window.getHWND(), GWL_STYLE) & ~(WS_BORDER | WS_DLGFRAME | WS_THICKFRAME));
::SetWindowLong(window.getHWND(), GWL_EXSTYLE, ::GetWindowLong(window.getHWND(), GWL_EXSTYLE) & ~WS_EX_DLGMODALFRAME);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey thanks to both of you, the above code works perfectly!
Steve
|
|
|
|
|
Thank you,
But it runs just fine in aero interface
|
|
|
|
|
Is it possible to make a dialog based application behave as domodal dialog when it is invoked by shellexecute???
if not, is there any alternative?
|
|
|
|
|
Super Hornet wrote: Is it possible to make a dialog based application behave as domodal dialog when it is invoked by shellexecute???
Yes. The fact that the dialog based application was invoked via ShellExecute() is irrelevant.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello,
It sounds crazy but how can I disable and hide my current view in my SDI app (CHtmlView) (and afterwards display it again)? [1]
I've tried SetVisible and EnableWindow but it does not work.
Background: In a modal dialog I temporarily load a different page for printing. The user should not see that there is another page loading or printing.
Regards,
Niki
[1] With hide/disable I mean e.g. that the current view is just white or even better: just frozen.
|
|
|
|
|
ShowWindow[^](SW_HIDE) and ShowWindow(SW_SHOW) could do the trick
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Thank you!
This seems to do exactly what I was looking for!
Regards,
Niki
|
|
|
|
|
Yourwelcome.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
How to change picture control size(width) at runtime?
I want to resize it in OnSize of formview.
|
|
|
|
|
You can use the MoveWindow()[^] function.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Do you want to change size of picture or control? if its control you can use of SetWindowPos,too.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|