|
George_George wrote: Here is the comments from the book ATL Internals about in-process server considerations,
--------------------
Any thread that calls CoGetClassObject or CoCreateInstance must already have joined an apartment, or the call will fail immediately. So, does that mean all objects exposed from in-process servers must be equally at home in single-threaded and multithreaded apartments so that random clients isn't cause harm? Fortunately, no.
--------------------
Any thread that calls CoGetClassObject or CoCreateInstance must already have joined an apartment, or the call will fail immediately.
This part is pretty straight forward.
So, does that mean all objects exposed from in-process servers must be equally at home in single-threaded and multithreaded apartments so that random clients isn't cause harm?
This just seems to be another way of stating the question you asked.
Fortunately, no.
This is saying that the threading models of the client and server do not have to match but goes into no details on how this is achieved.
Steve
|
|
|
|
|
Thanks Steve,
Question answered. Congratulations to get all COM knowledge back.
have a good weekend,
George
|
|
|
|
|
In my app, i switch to a new desktop and pop up a dialog with an ActiveX control (Flash object) but got an erre msg in new desktop:
Debug Assertion Failed!
...
File: f:\rtm\vctools\vc7libs\ship\atlmfc\src\mfc\oleinit.cpp
Line: 78
But if i pop up this dialog in current desktop,it's fine.
Pls help me !
|
|
|
|
|
I switch using CreateDesktop (GENERIC_ALL...) and SwitchDesktop().
|
|
|
|
|
Could you give some code ?
|
|
|
|
|
Dear Friends,
How to know whether the mouse button is Down
even if it moving.The WM_LBUTTONDOWN message is fired
only for the first time left button is pressed.
But how to know whether it is pressed all the time
though it may be moving.
|
|
|
|
|
|
Calling GetKeyState may be a better choice as it reflects state of the button when the current message was generated.
Steve
|
|
|
|
|
I'm sure that's what I meant
Thanks Steve!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
poda wrote: How to know whether the mouse button is Down
even if it moving.
Add event handler for WM_MOUSEMOVE . If the WPARAM for this event has MK_LBUTTON set then left mouse button is down, or if it has MK_MBUTTON , MK_RBUTTON then the corresponding mouse button is down!
If you are using MFC then use void OnMouseMove( UINT nFlags, CPoint point ).
nFlags will contain appropriate flags to indicate whether left, middle, right buttons or whether shift key is down. Use bitwise and to find out.
E.g.
if(( nFlag & MK_LBUTTON ) == MK_LBUTTON )
AfxTrace( "You are dragging the mouse\n" );
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
modified on Friday, April 11, 2008 2:58 AM
|
|
|
|
|
Thanks for your replies friends.
I used like
<br />
SHORT LButtonDown;<br />
LButtonDown=GetKeyState(VK_LBUTTON);<br />
<br />
if(LButtonDown & 0x8000)<br />
{<br />
...code here<br />
}<br />
It works.Thanks a lot.
|
|
|
|
|
Im not sure see here[^] and here[^] does any help?
|
|
|
|
|
Hi,
I am copying data from a char array to a TCHAR array. In this case first byte of the TCHAR array element is same as char array byte ,but the second byte of the tchar array is FF sometimes instead of 00 for japanese character set.
because of this I am not able to display japanese characters in web page when my system locale is enlish(us)
Surendra Vishwkarma
|
|
|
|
|
1. Please ensure whether you have installed language packs.
2. Make us to understand your situation by providing some code snippets.
Thanks a lot
|
|
|
|
|
Did you want to make multilanguage program?
|
|
|
|
|
hello,,
Can Any one tell me ,howcan i load bitmap( from CFileDialog) in Runtime.
Thanku.
|
|
|
|
|
|
Thanks!!!!! i got the solution
|
|
|
|
|
Or you can use of CImage class for it and other formats.
|
|
|
|
|
Hello All
I want to develop addon for Mozila Firefox browser.
Is there any body who can give me idea to do so?
Thanks in advance
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
|
Refer this article[^]
Use the sample for a better understanding
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Did you search on the Net?
|
|
|
|
|
Hi all,
I want to make a application in which when i click on my exe some files get copied to a specified path and after coping those file one of those files get executed. But i don't want any dialog box to be displayed or anything else to be displayed....
How an i do this???
Thanks in advance
|
|
|
|
|