|
Can an SDI application support 2 or more Views?? and depending on the commandline parameters the application be opened up with a specified view
|
|
|
|
|
yes. There is a sample in MSDN fot single-doc-multi-view. Sorry I forgot the name. You have to handle the switch/flag by yourself.
HTH,
Wenfei Wu
|
|
|
|
|
How can I peek Windows message such WM_LBUTTONDOWN from a region(rectangle) in a window that is the desired region can not receive the message.(I used the PeekMessage() function but this function unfortunatly peek the message from the window not from the region).
|
|
|
|
|
I'm not sure I understand what you're trying to do. All of the space on the Windows desktop is owned by one window or another, so messages are always sent somewhere.
Are you trying to trap messages in the Non-client area of the window?
|
|
|
|
|
Hi, i want to display a backgrond bitmap image in scrollbars pane. how should i do it. i can't derive my own class from CScrollBar and override DrawItem() cause i can't make it ownerdrawn reason being there is no style like SBS_OWNERDRAW availble. any help highly appreciated.
thanx in advance
mukesh.gupta@promap.co.uk
|
|
|
|
|
I am after info on the best way to structure a large MFC/C++ project, addressing the following points:
- Fastest Compilation Speed
- Minimal dependencies
- Minimal knowledge required to add new classes, i.e. no need to remember all the include files involved
The application consists of about 7 Dll's, each containing related functionality (windows, core, document, reporting)
Most new development requires the use of the main Dll's.
|
|
|
|
|
The Holy Trinity of large projects!!
Here is the best single suggestion I can make: Avoid including headers within headers....I made this mistake with my first large C++ project, and as time went on I realized that any change I made to a header (like adding a new method) had the potential to cause recompiles across the application.
To support this, you'll need to replace the member variable object definitions within your classes with pointer or reference members.
|
|
|
|
|
Hi forum,
how can I get datas from a CDocument-Class to a dialog? Is this possible? The function GetDocument() doesn't work, because CDialog is derived from CObject and not from CView!
Can somebody help me?
Thanks
|
|
|
|
|
1. In MyDlg.h add
#include "MyDoc.h"
2. Add a member variable to you dialog class
CMyDoc* m_pDoc;
3. In the function that creates the dialog - after the dialog is create but before DoModal() - add
dlg.m_pDoc = (CMyDoc*)GetDocument();
|
|
|
|
|
Hi,
I need to draw a series of images to the display as fast as possible. What is the fastest way to do this? Also, is there anyway I can time my updates to vertical blanking to avoid tearing? I can't seem to find any function out there. I know this is available in direct-x, but we cannot use direct-x for this application. Thanks for any help!
Chris Hafey
|
|
|
|
|
Hi. If I have a bitmap handle created with
h = CreateCompatibleBitmap (...)
can I replace this line to
h = CreateDIBSection (...)
without having to change anything else?
Can I then attach the new handle to a DC and draw in it? Can I then access the bitmap bits
via the ppbits pointer returned from the Create DIBSection?
Thanks,
Mike
|
|
|
|
|
Our company wants to use an AVI file as the splash screen for our new application.
I cannot get the CAnimateCtrl to show the AVI file. I even tried decompressing the AVI file - making it a whopping 30 megabytes - but that didn't work either.
What are my options at this point?
Do I need a third party control?
Do I need to write a custom viewer from the ancient AVIView source code in MSDN?
Do I need to somehow scramble something together from the bizarre MCI API?
|
|
|
|
|
Check out my animation control at http://www.codeguru.com/multimedia/AviCtrl.shtml
(I really should post this here some day...)
HTH, Jens
|
|
|
|
|
Hi everyone,
is it possible to have a ListCtrl in report-style with multiline entries?
TIA, Chris
|
|
|
|
|
Hi,
I'm trying to create a toolbar inside the DialogBar which is to be placed in a MDI Application. Here, i've created a derived class from the CDialogBar, and i followed the Concept of Placing the Toolbar inside the Dialog. But it doesn't show the Toolbar , but it shows the other controls in the DialogBar.
advance thanx,
Subbi.
|
|
|
|
|
Hi,
Please provide some tips for adding on my controls to IE4.x or IE5.x browser, Like HotBar, Yahoo!!...
If possible, Please provide some good source code links!!
TIA
|
|
|
|
|
This is very simple. You have to create a Deskband but register it under the toolbar section. I am working on an article and a ATL object wizard to do just this. I have samples but nothing that is in a releasable state. There is information on MSDN for creating Deskbands, search for IDeskBand, it has a hello world type sample, really lame. I am hoping by end of week I will have my information posted. If you have specific questions let me know.
I have posted a ATL Object wizard to create deskbands. It's a starting point without having to understand alot of the documentation of IDeskBand.
http://www.codeproject.com/useritems/RBDeskBand.asp
-Erik
|
|
|
|
|
The standard C++ provides string/wstring, an instantiation of basic_string<>. However, the Windows versions in VC++ does not seems to cooperate with DLLs when exporting classes containing string/wstring members.
VC++ keeps giving the warning C4251. Is there anyway to use the standard strings in DLL as class members of exported classes?
Currently, I am being forced to use them as function arguments/parameters and it is not always good for most design.
Regards,
Paul.
|
|
|
|
|
First question: What is error C4251, can you post the message that is with it?
Second... I've never tried to do what your doing (at least I don't think so), but in COM we have to use BSTR ... not strings .... don't know if that will help at all.
|
|
|
|
|
Hello,
Thanks for the response. Well, I never said error C4251, it is a warning! From the docs it is like this
Compiler Warning (level 1) C4251
'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
The specified base class was not declared with the __declspec(dllexport) keyword.
A base class or structure must be declared with the __declspec(dllexport) keyword if a function in a derived class is to be exported.
I am not building a COM interface, a simple non-MFC DLL.
Regards,
Paul.
|
|
|
|
|
Hi,
I need to change my "GroupBox" background color. How can I do it?
Thank you very much!
|
|
|
|
|
In your header file
CRect m_rcGroup;
In you OnPaint handler do the following
CBrush brshGroup;
brshGroup.CreateSolidBrush(COLORREF(RGB(redval,greenval,blueval)));
//replace red,green,blue vals w/ numbers 0-255
HBRUSH OldBrush =(HBRUSH)SelectObject(dc,brshGroup);
GetDlgItem(IDC_YOURGROUP)->GetWindowRect(m_rcGroup);
ScreenToClient(m_rcGroup);
Rectangle(dc,m_rcGroup.left,m_rcGroup.top,m_rcGroup.right,m_rrcGroupcGate.bottom);
SelectObject(dc,OldBrush);
|
|
|
|
|
In your header file
CRect m_rcGroup;
In you OnPaint handler do the following
CBrush brshGroup;
brshGroup.CreateSolidBrush(COLORREF(RGB(redval,greenval,blueval)));
//replace red,green,blue vals w/ numbers 0-255
HBRUSH OldBrush =(HBRUSH)SelectObject(dc,brshGroup);
GetDlgItem(IDC_YOURGROUP)->GetWindowRect(m_rcGroup);
ScreenToClient(m_rcGroup);
Rectangle(dc,m_rcGroup.left,m_rcGroup.top,m_rcGroup.right,m_rrcGroupcGate.bottom);
SelectObject(dc,OldBrush);
|
|
|
|
|
In your header file
CRect m_rcGroup;
In you OnPaint handler do the following
CBrush brshGroup;
brshGroup.CreateSolidBrush(COLORREF(RGB(redval,greenval,blueval)));
//replace red,green,blue vals w/ numbers 0-255
HBRUSH OldBrush =(HBRUSH)SelectObject(dc,brshGroup);
GetDlgItem(IDC_YOURGROUP)->GetWindowRect(m_rcGroup);
ScreenToClient(m_rcGroup);
Rectangle(dc,m_rcGroup.left,m_rcGroup.top,m_rcGroup.right,m_rrcGroupcGate.bottom);
SelectObject(dc,OldBrush);
|
|
|
|
|
Sorry about that... it was just hanging... so I hit submit again...
|
|
|
|