|
Man, I'm suffering with you. Linking errors are not fun.
Good music: In my rosary[^]
|
|
|
|
|
Hi
I have a WTL dialog box which is a layered window. I have used the following code
::SetWindowLong(m_hWnd, GWL_EXSTYLE, ::GetWindowLong(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
g_pSetLayeredWindowAttributes(m_hWnd, 0, bAlpha, LWA_ALPHA);
where g_pSetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes)
GetProcAddress(hUser32, "SetLayeredWindowAttributes");
It works fine. I have another dialog dlg1, which I am going to display on some events in the main window.There is a combobox in the dlg1. when I click on combobox,portion of the combobox becomes transparent. It works fine with all other controls in dlg. Any idea?
Regards
|
|
|
|
|
I create an activex control(composite control) with ATL. Now I want to change the static's text color in the dialogbox.I do it like this:
HDC hdc = ::GetDC(GetDlgItem(IDC_STATIC_STATUS));
SetTextColor(hdc, 0x000000ff);
These two sentences are in the OnInitDialog function, but after this the color don't change.
Who can tell me why? And what shoud I do to change the color?Thanks.
|
|
|
|
|
You need to handle the WM_CTLCOLORSTATIC message in the dialog. That message will give you the HDC being used to draw the static control. Just set the text color on that DC, and you will achieve what you want.
For more info, see the MSDN docs.
Good music: In my rosary[^]
|
|
|
|
|
Jörgen Sigvardsson,thanks very much, I have successfully set the text color and I found that I should put MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic) before CHAIN_MSG_MAP, if not, it didn't work
|
|
|
|
|
Another question, there is a sentence in the MSDN:
"The system does not automatically destroy the returned brush. It is the application's responsibility to destroy the brush when it is no longer needed.
"
I wonder when I should destroy the brush and where did I get the brush's handle?
-- modified at 6:22 Tuesday 6th September, 2005
|
|
|
|
|
its about the brushes which u have created, for those ones u must have hadles to them
|
|
|
|
|
Hi,
I'm trying to make an activex plugin for IE. It will be used for displaying images that are coming in over the network.
To that end, I started off by making an ATL control that creates a thread which simply updates a text buffer with the current time, calls FireViewChange(), and sleeps for around one second.
This works in the test container, but not in IE. I've gathered that I can't call FireViewChange() from a "worker thread", but i'm getting confused quickly trying to find a workaround for that.
All of the stuff I find seems to be a few years old, and things are different, so I can't quite follow some of the tutorials of how to handle something like this.
Can someone give me a quick walkthrough of this?
Thanks,
--buddy
|
|
|
|
|
ActiveX controls are normally apartment-threaded (since they usually have UI), so you'll need to marshal the interface to the thread so it can use that to call FireViewChange() . I usually use the GIT (see CComGITPtr in ATL7) for this task, but if it's a one-time deal, you can also use CoMarshalInterThreadInterfaceInStream() .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Hi Mike,
I've read something similar to that before, but I'm not a win32 programmer at all, so it goes straight over my head. Can you give me a code example?
I also thought of doing a windowed activex control, and then just painting to the HWND whenever I have a new image to display, thus bypassing the need to ask the container to redraw the control.
Will that work? Is there a better way? I really don't know if I'm approaching this right or not.
What I need is an ATL control that can be used in a web page, which continuously downloads and displays a JPEG from a remote host. Any suggestions of the best way to do that are greatly appreciated
Thanks again,
--buddy
|
|
|
|
|
I've noticed in examples of CoMarshalInterThreadInterfaceInStream() there are usually a vector of interfaces. Is this all subscribers to the event or am I stupid.
|
|
|
|
|
Not sure where you saw vectors used with CoMarshalInterThreadInterfaceInStream() , it only deals with one interface at a time.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
"Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain."
-- Paul Watson, Linux Zombie
|
|
|
|
|
I am trying to create the Atl servce in VC++ for file monitoring. I am following the link "<http: www.codeproject.com="" atl="" atl_control_with_mfc.asp".="" i="" am="" using="" this="" sample="" code="" in="" sevice.
=""
but="" facing="" problem="" "ccomobject<cfilemonitorsink=""> *m_FileMonitorSink;. It is not including the CComObject"
It's not getting included properly.
|
|
|
|
|
I created a project using 'ATL COM AppWizard'.
After Selecting projecting Name from 'class view', I did not find the 'New ATL Object' Menu item either from Insert Menu or from Popup menu.
Could you please let me know by selecting/changing which options I can get this menu item.
|
|
|
|
|
You should reinstall your VS.
|
|
|
|
|
yes,otherwise there is no reason why it is not showing.
|
|
|
|
|
Hey everyone! I'm working with WTL; when I try to use std::list with a class let's say "int", i can safely use this list. Since i've defined a class , let's says "CMyClass" and tried to use it:
list <cmyclass> c1;
list <cmyclass>::iterator Iter;
that dosesn't work and i still can't undestand why is it because of the definition of this class ( i ude in it my own defined types)?. Can someone give me a help?
Madjid
|
|
|
|
|
How does it not work? Does it not compile, or does it generate runtime errors?
|
|
|
|
|
It doesn't generate any error at compilation but when executing! in fact, i find a solution: not to use CMyClass but *CMyClass. Thanks everbody!
Madjid
|
|
|
|
|
I bet you didn't take copy construction/assignment into account.
|
|
|
|
|
When converting an MFC project to a WTL one, I was unable to find the equivalent
of CList in WTL and even if I implement it, there're too many problems when
using template classes. Does anyone have an idea? thanks!
Madjid
|
|
|
|
|
|
I second Mr Dunn's choice. STL collections are way better than the ATL collections. ATL collections are only worth taking a look at if you want to remove the dependency on the C/C++ runtime DLLs.
Good music: In my rosary[^]
|
|
|
|
|
Just to add my voice to the cacophany, CList is crap. std::list rules.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|