|
(ex: code runs faster because it's in the same namespace? less memory used? etc...)
Nope, namespaces are just a way to localize class/object names, and are handled at compile time. Grouping stuff in namespaces has no impact on the binaries.
--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?
|
|
|
|
|
Hello. I have programmed several applications with MFC. For my next program, I would like to get text from a window in another program to use within my own program. I have looked at the window in spy++, but that really hasn't helped any. Can someone point me in the right direction? Thanks.
|
|
|
|
|
Have a look at WM_GETTEXT.
|
|
|
|
|
Hello, the codegurus around the world.;)
Currently, I'm working to check the version number of Windows XP.
On RC1, Windows XP's the major number is 5 as Windows 2000 does.
And, the minor version number of XP is 1, but that of Windows 2000 is 0.
Recently, my friend got Windows XP evaluation version at the computer show in Atlanta, GA, and its version number is 2002?
Does anybody get the true information of Windows XP version number?
Thank you in advance.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Windows XP = Windows NT 5.1
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi,
I have a CDisplay class (CWnd), and I want to programatically add a configurable menu to it, ie, no class wizard junk. Problem is, that I want to support 3-4 instances of this object in one app while maintaining system-wide resource ID integrity and the ability to relay UI msg's when the user clicks the menu. Any creative suggestions?
|
|
|
|
|
In a dialog based app. how can I detect WM_MOUSEMOVE on a CBitmapButton?
I´ve declared a CBitmapButton m_add and then WM_MOUSEMOVE (OnMouseMove) but the CBitmapButton just doesn´t detect when mouse is over it...
Here´s the code sample.
CBitmapButton m_add;
void CMyDlg::OnMouseMove(UINT nFlags, CPoint point)
{
CRect rect;
m_add.GetWindowRect(rect);
if (rect.PtInRect(point))
{
AfxMessageBox("Add button");
}
/*
if(WindowFromPoint(point) == GetDlgItem(IDC_BASEADD))
{
AfxMessageBox("Add Button");
}
*/
CDialog::OnMouseMove(nFlags, point);
}
None of the above two methods works in a dialog based app. Can anybody help me out??? It would make my day sort of speak... Thanks!!!
Jesper S.
|
|
|
|
|
CYourDlg::OnMouseMove will be called only if there's no other control under the cursor. Otherwise, the control handles the message. You have two options:
1) derive a class from CBitmapButton and handle WM_MOUSEMOVE
2) handle PreTranslateMessage in CYourDlg. The mouse and keyboard messages go through message queue before they reach the handlers - this function is the place to intercept them.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I´ve thought of deriving a class from CBitmapButton but being pretty "green" I don´t know how to do it like I do with the other MFC classes!
Can you show me how to derive a class from CBitmapButton in MS VC++?
If so I would be very thankfull!
The second method has also come to my attention but again I lack the skills!
Sorry but I´m still learning from, you guys...
Jesper S.
|
|
|
|
|
Never mind I´ve solved the problem! Thanks.
Jesper S.
|
|
|
|
|
I am planning on creating a kind of file transfer client.
The thing is:
1)how is the CASyncSocket at transferring binary info (is there another alternative?)
(Will there arise any unforeseen problems with CASyncSocket?)
2)is CString an alternative AT ALL when considering storing the info received from the sockets. (How is it at storing BINARY INFO, that is)
Or should one use char buf[SIZE] or something?
I have only been thinking about this, not studying the CString or CASyncSocket classes in depth.
I thought that I should check it with someone here with experience on this.
-Oddis-
|
|
|
|
|
1)CASyncSocket doesn't care what you are sending binary or text it takes the whole data as binary.
2)To send a file open it in binary and then use char* or void* buffer to send it through your socket. To send a binary data all you have to do is to open a file in binary the buffer will contain binary data.
In my dream, I was dorwning in my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Project is an SDI FormView derived app.
Ok, I replaced the Icon in the resource file and named it IDR_MAINFRAME, all well and good. The icon in the usual place is right, in the taskbar it's right, in explorer it's right. But here's the kicker: When I right click on the debug executable and hit properties, I get the right icon. When I right click on the release executable and hit properties, I get the default MFC icon. I've tried rebuilding clean to no avail. Any ideas what I'm doing wrong? Thanks in advance
--
Peace,
Amit Jain
|
|
|
|
|
How many icons do you have in the executable? Are you using 256 colors or more?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
There's only the two that come as default, so I think it's 32x32x16 and 16x16x16.
--
Peace,
Amit Jain
|
|
|
|
|
Hitting F5 should fix that. If not, clearing your shell icon cache with TweakUI will definitely fix it.
--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?
|
|
|
|
|
It worked, whoo hoo! Thanks!
--
Peace,
Amit Jain
|
|
|
|
|
Hey!
I have a dialog box stored in a DLL. From my parent app, I load
the DLL and present the dialog to the user. Problem is,
tabbing doesn't seem to work. (I don't even have that the little
dotted rectangle to show which control has focus). I've read
somewhere that this is a known problem with MFC. Is this true?
Is there anything I can do to fix it?
Steve The Plant
|
|
|
|
|
Hmmmm... I worked on multiple-dll projects with many dialogs and never encountered this problem. Can you check your controls with Spy++ - do they have WS_TABSTOP style set?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Spy++ says that they do. All the controls are set to
their default settings (ie I didn't change them), so
that means they should all have WS_TABSTOP set.
Steve The Plant
|
|
|
|
|
|
I used the AppWizard to Generate a "Regular MFC Dll using shared MFC DLL".
In the DLL, I have an exported function that the client app
uses. I have the exported function, I initialize a dialog like so:
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
m_oMainDialog.Create(IDD_MAINDIALOG);
m_oMainDialog.ShowWindow(SW_SHOW);
dwLastErr = ::GetLastError();
}
This is the dialog where tabbing doesn't work. The dialog needs
to be modeless, so that it doesn't interfere with the operation
of the client app.
Steve The Plant
|
|
|
|
|
From VC++ help:
Regular DLLs must have a CWinApp-derived class and a single object of that application class, as does an MFC application. Unlike the CWinApp object of an application, the CWinApp object of the DLL does not have a main message pump. [...]
If the DLL opens modeless dialog boxes or has a main frame window of its own, the application's main message pump must call a routine exported by the DLL, which in turn calls the CWinApp::PreTranslateMessage member function of the DLL's application object.
This should clear things a little bit.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi, I have a CPropertySheet class object with several CPropertyPages in it. There are situations where I would need to prohibit the user from having access to a partiular PropertyPage. Is there a way to gray out that PropertyPage Tab to prevent it being selected?
Thanks in advance,
Jerry Wang
|
|
|
|
|
There's no flag or message for disabling tabs. You'll have to use owner-draw. Have a look at March 1998 issue of Microsoft Systems Journal, C++ Q & A column - it has the code you need. This article may be in your VC++ help; search in the 'Periodicals' section. If it's not there, go to msdn.microsoft.com, then MSDN Magazine and Past Issues.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|