|
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++
|
|
|
|
|
|
I am new to WTL and currently i try to port an MFC app to WTL.
I try to find a way to get the application main window similar to AfxGetMainWnd().
For the moment i put the CMainFrame in a global variable, which works. I just want to know if there is a 'proper' way, like a function in CAppModule or something.
Thanks.
|
|
|
|
|
No, there is no "proper way". You'll have to provide your own version of AfxGetMainWnd()
Good music: In my rosary[^]
|
|
|
|
|
|
is there a way to format strings in STL like MFC CString's Format()?
CString str;<br />
int i;<br />
str.Format("%d", i);
thanks in advance...
- Indivara
"...This city desert makes you feel so cold.
It's got so many people but it's got no soul..."
- Gerry Rafferty, Baker Street
|
|
|
|
|