|
MS Office 'menus' are not menus at all- they use custom window classes (MsoCommandBar) to implement "cool" look and docking. The only reference I've found in MSDN is in AccessibleObjectFromWindow docs located in Platform SDK: Accessibility - it seems that you can get a IDispatch interface for a command bar.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
How can I use a CFileDialog as one of the pages in the property sheet.
|
|
|
|
|
Have data in ascii representation and need to convert to float equivalent. Not atof, that will convert ascii chars like "1234.567" to a float... I need to know how to take things like "=..." and "...." to their float value. Any ideas?
Aaron
|
|
|
|
|
Please!!!!!
atof();
Carlos Antollini.
|
|
|
|
|
I don't understand what you're asking. "=" has no float equivalent. atof() is what you should use.
Unless you're asking for the ASCII value of a character? In that case:
int ch = '=';
--Mike--
http://home.inreach.com/mdunn/
Push the button, Frank.
|
|
|
|
|
Hi there,
I was wondering if anyone here would know whether all those C++ Microsoft certifications for MCSD and MCDBA will be retired when the new .NET stuff rolls in, in the near future.
|
|
|
|
|
I doubt it - more likely they will add new subjects and retire old ones, just like MCSE does.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
The question is not if they will be retired but when will they be retired.
I've had to upgrade my MCSD after the old exams were retired and I expect to do it again sometime in the next two years. It's one way for Microsoft to get developers to use their tools and software.
|
|
|
|
|
Hi there,
When you are using Visual C++ and add Dialog box through the resources tab, how can you specify the exact width and height of the dialog box?
|
|
|
|
|
You should be able to just size the dialog by dragging the edges. If you want to enter the exact width and height, you might need to edit the resource file (*.rc) and scroll down to the dialog section, and enter your values there. hope it helps,
Jake
|
|
|
|
|
If you mean how to you set the exact size in pixels, you can't. Dialogs use DLU (dialog units) which are independent of pixels.
You can call SetWindowPos() in OnInitDialog() to set the size in pixels, but be aware the result will look awful in font sizes other than the ones you use.
--Mike--
http://home.inreach.com/mdunn/
Push the button, Frank.
|
|
|
|
|
I have a very particular problem that I need some help with. My problem
is that I am creating a regular MFC DLL that displays a dialog which
then does some work based on user input. I need to create an ActiveX
control (in this case Snowbound Software's Rastermaster OCX) on this
dialog at runtime. No matter how I've tried to approach this problem it
just does not seem to want to work. It seems to bomb in the
InitControlContainer() function in the MFC source file OCCCONT.CPP, where
it goes to make the call to
m_pCtrlCont = afxOccManager->CreateContainer(this);
I've tried this using other ActiveX controls and have gotten the same problem
so I do not believe it's a problem with the snowbound control in particular.
Can anyone please tell me if I'm just doing something wrong, or if what I'm
attempting to do is just simply not possible?
Any help will be GREATLY appreciated! Thanks!
X 10
|
|
|
|
|
And with this in the initinstance?
AfxEnableControlContainer();
Carlos Antollini.
|
|
|
|
|
I am making sure to call AfxOleInit() and AfxEnableControlContainer() in my App's InitInstance. Then in the constructor for my dialog I create a new object of the ActiveX control type which I then call the Create() member on in the dialog's OnInitDialog() function. For some reason after the call to create the control object's HWND is still NULL. It keeps failing on an assertion error in "Winocc.cpp" which I think is a result of trying to call a method on this object with a NULL hwnd.
The error as reported by the VC++ debug window is as follows:
Loaded 'C:\WINNT\system32\OLE32.DLL', no matching symbolic information found.
CoCreateInstance of OLE control {B2D168E0-5597-101D-843A-DA16297B4C87} failed.
>>> Result code: 0x800401f0
>>> Is the control is properly registered?
I'm pretty sure the control is registered however as I ran a successful call to regsvr32 on it.
|
|
|
|
|
Just solved my own problem... The answer was to be found in some comments containing the code for the AfxOleInit() call. I had to calle OLEInitialize() before doing anything else in my app's InitInstance() and now it all works fine. Why calling
AfxOleInit() doesn't have the same affect is beyond me, but hey, that's just the way it works!
|
|
|
|
|
Hi All,
I want to implement sometihing like a task manager's
applications tab.So What did i do,
HWND hwndDesktop = GetDesktopWindow();
EnumChildWindows(hwndDesktop,EnumChildProc,NULL);
and stored the hwnd's in a list.But i get a lot of handles
like the program manager's etc .I just need the handles to the application windows .Also,How does one get the hwnd of the topmost window in the Z Order.Also,Is there an API like GetLastFocus() which returns me the hwnd of the window
that last had the focus.(I could store that in WM_SETFOCUS,
but what if an app does not have a window by itself but wants to do shifting of focus of other windows in the system.)
Thanx All for the help.
Sriram M R
|
|
|
|
|
Can anybody recommend some good books about MFC? I have "Programming Windows with MFC" by J.Prosise so i'd like to take step forward in the areas which that book didnt cover like database and internet/network related programming etc. etc
Any suggestions??
|
|
|
|
|
You should check out:
MFC Internals
The MFC Answer Book
I think there definite must haves.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Mike Blaszczak's book Professional MFC with Visual C++ 6 is what I read when starting with MFC. (Actually I used the edition that came out for VC 4, but the VC 6 edition should cover the same stuff, with many new sections on features added since VC 4.)
--Mike--
http://home.inreach.com/mdunn/
Push the button, Frank.
|
|
|
|
|
Agreed on The MFC Answer Book. Do NOT buy 'MFC Extensions By Example', as a lot of the examples suck. For example, the MFC Answer Book correctly shows you how you can use SetWindowPos to make a dialog that resizes to show/hide some options, but 'Extensions by example' creates TWO dialogs to solve the same problem. Ech.
The other one I like is MFC Programming with Visual C++ Unleashed. It covers everything from databasing to ATL/COM to OpenGL.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I have a wizard that I only want a title in the caption bar. I have turned off all the close box for each page of the wizard in the dialog properties box. The user should only be able to close the dialog by hitting the "Finished" button.
How can I hide the close button?
Thank.
|
|
|
|
|
You can override PreCreateWindow() and in that function remove the WM_SYSMENU style:
BOOL CWizardDlg::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style ~= WM_SYSMENU;
return CWnd::PreCreateWindow(cs);
}
this will also remove the command menu to the left of the caption along with the minimize/maximize buttons.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Thank you...That what I wanted...Over and out.
|
|
|
|
|
Hay what going up with my program. I let VC++ 6.0 Override PreCreateWindow() and then I inserted "cs.style &= ~ WM_SYSMENU;" in the body of PreCreateWindow(). I tried "cs.style ~= WM_SYSMENU;" but that wouldn't compile but "cs.style &= ~ WM_SYSMENU;" does. My problem is that I set a break point on the line I inserted and hit the debug button to run the program but my wizard was shown and the break point wasn't hit and the X box still there. Why isn't PreCreateWindow() being called?
|
|
|
|
|
I'm trying to write a function that performs some pretty natural polymorphism. It takes as a parameter a pointer to a base class object, then sets it to a new object of the subclass. In code:
void DoMorph(CBaseClass *foo)
{
foo = NULL;
foo = new CSubclass();
}
Is there an obvious reason this wouldn't compile, if CSubclass is derived from CBaseClass? I get this unexpected error:
'type cast' : conversion from 'class CSubclass *' to 'class CBaseClass *' exists, but is inaccessible.
thanks in advance,
Jake
|
|
|
|