|
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...
|
|
|
|
|
Hello,
I need to write a copy constructor and my class has got a couple of member variables which are pointers. What I need is some general advise on how to write a copy constructor so, that I don't have bad hockey afterwards.
Thanks very much!
Matthias
|
|
|
|
|
Hi,
I would suggest that all classes your class has pointer members to, does also have copy constructors. That way you will keep your copy constructor tidy:
Example:
class CExClass
{
...
CExClass(const CExClass& Src)
...
CAnyMember* m_pAnyMember;
}
CExClass::CExClass(const CExClass& Src)
{
m_pAnyMember = new CAnyMember(*Src.m_pAnyMember);
}
CAnyMember::CAnyMember(const CAnyMember& Src)
{
// copy ...
}
If you don`t want to make real copies of your data, you can use smartpointers as members instead of real pointers.
Michael
|
|
|
|
|
|
Hi All
Iv'e tried adding an icon for my app to the system tray using
the usual Shell_NotiyfyIcon() call, but everytime the mouse moves over it
It dissapears.
Any ideas on this behaviour
thanks
|
|
|
|
|
|
Does anybody know where i can find a description of the file format for color palettes (like used in Paint Shop Pro) ?
Thanks in advance
Michael
|
|
|
|
|
I do not know anything about this but I found on WEB
The Dr. Halo Palette (PAL) file header has the following content (40 bytes):
struct Hpal
{ BYTE ID[2]; Should be AH
int version, size;
char filetype, subtype;
WORD brdid, grmode;
int maxindex, maxred, maxgreen, maxblue; Colors = maxindex + 1
char signature[8], filler[12]; "Dr. Halo", 12 0's
} ;
The palette data is integer triples (R, G, B) for each color in the palette.
The palette file data (including the header) is in 512 byte blocks. If there
is not a full integer triple at the end of a block, the data should be
ignored and the next block started.
|
|
|
|
|
I have a MFC AppWiz generated explorer style application that requires the user to be presented with a dialog box when the file open command is selected. Unfortunatly, I cannot seem to find a way to use the OnFileNew() method and call a method in both the TreeView and ListView update their data, as well as allow the framework to properly deal with the document object. I'm also not sure which class I should be placing the OnFileNew() override into. Can anyone offer some assistance?
Thank you,
Ritch
|
|
|
|
|
Hello Ritch,
If I do understand your problem well, then provided you are using doc/view arch in your application then use the ClassWizard to override the OnFileNew in your document class, ie the id ID_FILE_NEW.
Let me know, if this does not solve the problem.
Regards,
Paul.
|
|
|
|
|
Paul,
Thanks for your response. However, I had initially tried that approach and the problem is that the OnFileNew method gets called when the application is initially created. I only want the dialog to appear when the user selects the File New item from the app's Menu. My theory (I've set this issue aside temporarily) is that I need to change the ID for the menu item. Then when the user selects the menu item, I call the base class FileNew member to allow the MFC architecture to create the document, aftewords I present the user with some dialogs that intialize the newly created document.
|
|
|
|
|
how do you play a WAV audio file as a resource.
I have tried to use the sndPlaySound function, but when I compile it says it is undeclared.
I think I need to include some library... which one do I need??
|
|
|
|
|
how do you find the name/path of the file/files being dropped on a control on a dialog.
|
|
|
|
|
Did you notice "Search" on the home page?
You need to subclass the control and handle WM_DROPFILES.
See http://www.codeproject.com/listctrl/filedroplistctrl.asp for how...
|
|
|
|
|
how do you make the selected item highlight the full, entire length of all the columns
in a CListCtrl. this is hard to explain... please look at the attached picture to see what I
am talking about.
|
|
|
|
|
Either
ListView_SetExtendedListViewStyle(m_hWndYourListViewHwnd,LVS_EX_FULLROWSELECT);
or
SendMessage( m_hWndListviewhwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (LPARAM)LVS_EX_FULLROWSELECT );
==================
The original message was:
how do you make the selected item highlight the full, entire length of all the columns in a CListCtrl. this is hard to explain... please look at the attached picture to see what I am talking about.
|
|
|
|