|
Maverick wrote:
is it because of the fact the function from where the event was fired, is running on a separate thread?
Yes. My guess is that your threads live in separate apartments.
Please see this[^] article for a discussion and solution on how to fire events across apartment boundaries.
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
I have a cedit view, and I want to set the forcus to special place where I hope,
Could you help me how to do it?
Thank you.
-Freehawk
|
|
|
|
|
Define "special place." Are you referring to hilighting?
Kuphryn
|
|
|
|
|
Thank you for the reply.
I only want to place the forcus to a special.
Now I made the source code as the following:
Example:
SetSel(1,1)
is the way right?
-Freehawk
|
|
|
|
|
Hi everyone,
I hope there's someone out there, who can help me with my problem, I've asked about this in the COM forum, but no one knows or cares to reply.
I have an ATL control, which should communicate with Macromedia's Flash control. I generated the IDL file and the event interface (based on IDispatch) has a few custom methods in it. When I use MIDL these custom methods nor the dispids are present in the .h file.
Is this correct behaviour? I could ofcourse add the methods to the interface and then base my event sink on that or am I supposed to do it with the IDispatch and thus responding to those methods when invoke is called?
.NET and VB provide actions for these events directly, but I need to use ATL for the task and would really like to understand the internals, rather than pick the quick and easy way out.
Even links to c++ sourcecode interfacing with Flash would help me out.
Thanks in advance!
|
|
|
|
|
Must've missed this one.
When you say the custom methods and dispids are missing from the .h file, does that mean you only see the dispinterface as IDispatch in there?
Have you tried using #import on the typelibrary (or DLL if there isn't an explicit one) and looking at the tli/tlh files generated to see if they are any different?
If you use OLEVIEW and examine the IDL of the Flash control, is it different, or is that what you used to generate it in the first place?
Worst case is, as you say, to have your own IDispatch; initially it could just dump out the events that are sent to it, so you can at least confirm it's behaving as expected.
Steve S
Just waiting for the day when someone asks a non-urgent question...
|
|
|
|
|
Sorry for the stream of consciousness, I used the OLEVIEW to generate the IDL for Macromedia Flash control and after using MIDL to generate the header, it contains only the IDispatch interface.
As I'm an ATL/COM newbie, I just wanted to get this right in the first place, I can add the methods to the generated class and then base my sink on that, but I have a feeling this isn't the right way to do it.
I'll probably add the dispids for the Flash events as constants and test with a IDispatch, still I want to know whether this is expected behaviour when compiling an IDL file.
|
|
|
|
|
Better than an stream of unconsciousness...
That would be _IShockwaveFlashEvents, then?
I've repeated what you've done, and also #import-ed the OCX, and examined the generated file. In each case, the sink is empty. I've also tried tweaking the IDL to remove the "hidden" keyword, but this made no noticeable difference.
I'd go with plan B, and test with an IDispatch. I've looked at much of our code here, and that's how we tend to do things; a hand-crafted invoke function that then calls the appropriate functions.
Steve S
|
|
|
|
|
Steve,
thanks a million!
It's always nice to share the burden with someone 'in the know'.
Would you recommend using the dispids from the IDL file or should I implement the GetIDsOfNames in my IDispatch? I'd presume Flash would be using the predefined IDs in the invoke calls rather than asking for the ids I've chosen myself, afterall it's Flash's interface I'm playing with.
And one final note, is everyone using VB and .NET to do this? Is the C++ implementation a well kept secret or what? I thought this would be something a lot of people had done before and still Google was unable to give me anything else than this same question asked over and over again.
If someone is looking for an idea for an article here, this could be it; communicating with Flash using SetVariable and catching the FSCommand event. Quite trivial to implement, yet causing confusion among many developers.
|
|
|
|
|
Didn't realise I was 'in the know'!
You can just use the dispids from the IDL, preferably, as you said before, defined as constants somewhere. Flash will be using the predefined IDs, so it will be safe, and it's much less painful than implementing GetIDsOfNames, which you won't need.
Don't know about the final note, I only use C++/C/C# with VBS thrown in.
For what it's worth I usually 'handcode' the event sink so that the invoke function calls a pure virtual in a base class, then my concrete class provides the pure virtuals. This is occasionally useful if I need the same kind of sink somewhere else in the project or another app.
Steve S
|
|
|
|
|
Has anybody tried to make the *subj* for MDI? If so, coul anyone provide me with the reference.. And I hope the topic would be interesting for all WTLians, not only for beginners like me..
Thank you in advance.
Best wishes for all --
ScD
|
|
|
|
|
dfsdfsd;)
|
|
|
|
|
Is there any documentation on the thread safety of the Dinkumware STL library distributed with VS.NET 2003?
-Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Dinkumware's STL is thread-safe in a very weak manner: if thread A uses container instance a and thread B uses a different container instance b , no threading problems arise. But if the same container instance is simultaneously handled by two different threads, no guarantee is made at all: you will have to synchronize access to the container by your own.
There are good reasons for not providing stronger thread-safety: the rationale is that oftenly most of the time the program has its own concepts about what an atomic operation is, and this may involve more than one call to STL; for instance in an accounting program an atomic transaction operation involves removing an element from somewhere and inserting it somewhere else. In these situations, simple thread-safety at the call invocation level does not suffice.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
SGI docs say that read access to same container from multiple threads is safe. But, from what you mention, I assume that even that is not guaranteed by Dinkumware.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I doubt that is the case. There can never be thread errors on read only operations. I have a really hard time to believe that dinkumware STL is doing write operations behind the scenes of a perceived read only operation. Then someone ought to take the dinkumware STL authors out on a field and... But I really really really doubt anyone would do such a treacherous thing.
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
I started getting a very sporadic and strange error on a STL find operation on a vector, and found that the only change from a previous version was that the container is now accessed from two threads. The vector is not written to after startup. Hence the question. I went to the Dinkumware site, and they make no statement on any thread safety.
According to one mail I read on a mailing list, there indeed was some problem with the VC6 version of STL regarding multiple readers, but Dinkumware has released a new version after that and is included in VS.NET 2003.
I was hoping someone might have a conclusive answer, just for the sake of knowing. This is certainly not a problem for my current situation. I already added thread-symc code to prevent simultaneous access to the vector.
Jörgen Sigvardsson wrote:
someone ought to take the dinkumware STL authors out on a field and...
I have a few ideas to fill in the blanks.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Old Dinkumware's STL as shipped with VC6 certainly had an issue with thread-safety even in the weak sense described above. From what I undertand, this is fixed in the STL shipping with MSVC 7.1.
Have you checked whether the fixes described in http://www.dinkumware.com/vc_fixes.html[^] are already incorporated in the STL you are using? If so, and if you still have the problem, I suggest you post it to microsoft.public.vc.stl adding "Dinkumware" in the subject line: P. J. Plauger or Pete Becker from Dinkumware will surely show up promptly
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín M López Muñoz wrote:
Dinkumware's STL is thread-safe in a very weak manner: if thread A uses container instance a and thread B uses a different container instance b, no threading problems arise.
The version shipped with VC6 wasn't even thread-safe in this regard. I learned it the hard way
|
|
|
|
|
I have some problem in writing An ATL COM Simple Server. When i try to make a new project i notice that some files where the main code must be are not created.
For example i write a project with name FirstCom, and i don't have FirstCom.h, and in FirstCom.cpp i have only this:
#include "stdafx.h"
#include "resource.h"
[ module(dll, uuid = "{85212E22-36B1-470E-A30A-CBC2B398C31B}",
name = "FirstCom",
helpstring = "FirstCom 1.0 Type Library",
resource_name = "IDR_FIRSTCOM") ]
<\pre>
And that's why i think i have error, that my servers isn't registred(smth like this:)). I have
Visual Studio Net 2002 and WTL installed. Can it be the problem??? How to uninstall in that case WTL??? Or What To Do???
Thanks.
|
|
|
|
|
Does anybody know what development tools I could use for the Windows CE platform to make use of a ATL DLL that I wrote with Embedded Visual C++ 4.0?
I cannot add it as a reference to any of the tools that I have including Visual Basic and C# from Studio .NET 2003 and Embedded Visual Basic 3.0.
Thanks in advance.
Max
|
|
|
|
|
I want to use Icon overlay for my files.
What i ve to do with the folowing method of IShellIconOverlayIdentifier
Methods are
GetOverlayInfo
GetPriority
IsMemberOf
(let my file type is .myp)
|
|
|
|
|
Hi there,
I'm trying to mimic Acrobat Reader (or MS Office) behavior: that is when a pdf document is embedded in some HTML, the Acrobat Reader displays itself in IE. If accessed thru Windows Explorer, the Acrobat Reader app is started.
I want to mimic the same behavior for a new file type that i will call .xyz
When a file of type .xyz is accessed thru Windows Explorer, a viewer is launched and this is fine. Now when a .xyz file is clicked in IE, it also launches the associated viewer, but outside IE. This is not what i want.
Any suggestions on how to proceed? Can a BHO do the trick? What are the mechanics behind the scene on how Acrobat Reader is working?
Any comments or hints would be highly appreciated. Thanks.
Thanks,
pnyr
|
|
|
|
|
|
Thanks for the reply.
I came to the same conclusion, but then i renamed the 2 BHO DLLs associated with Acrobat Reader and pdfs are still opening inside the browser, so i am not sure.
pnyr.
|
|
|
|