|
Essential COM by DON BOX is a good Book
Mad Coding.
|
|
|
|
|
"Inside COM". MS Press, Dale rodgerson.
How low can you go ? (MS retrofuck)
|
|
|
|
|
Okay. Thanks.
Davros posted an interesting reponse about COM and its future at cprogramming.
http://cboard.cprogramming.com/show...&threadid=26804
Kuphryn
|
|
|
|
|
In my original message, I did not include a question on
the order at which to learn and even become proficient
with COM design and implementation using C++.
What is the order in terms of books to study for learning
and become proficient with COM design and implementating
using C++? In other words, do you learn ATL first, or COM?
Kuphryn
|
|
|
|
|
Definitely COM concepts first. Then you could attempt an ATL and COM side by side though the better you know COM, the more you understand and appreciate and hate what ATL does.
|
|
|
|
|
Hi,
I am trying to access password and aliases or for that matter every thing related to microsoft exchange users i am able to retrieve only usernames using mapi.session object,
Please help in retrieving other things if any body has code plesae post it here.
I have tried using ADSI also.
Thanks,
Amit Gupta
|
|
|
|
|
You must be kidding. I would worry as a whole if you could retrieve the password !
What you can get instead is a SID (security descriptor) that reflects the user logged session. And that's enough to do practically anything else.
How low can you go ? (MS retrofuck)
|
|
|
|
|
Has had any experience with using IMoniker to open files stored in dll's or exe's using the res: protocol.
I have written code that uses CreateURLMoniker() and then IMoniker::BindToStorage() to open files and read their content via IStream. This works fine for file:, http:, ftp: protocols but fails when using the res: protocol which unfortunately is the protocol i am particularly interested in!
I don't understand how IE does it since i can use CreateURLMoniker() and then pass the moniker to ShowHTMLDialog() and IE is happy to read the file. If I step through the code then my IBindStatusCallback::OnProgress() gets called with BINDSTATUS_MIMETYPEAVAILABLE and after the MIME type string 'text/html' in the szStatusText parameter is the text of the file i want to load but i don't get a good IStream* back from IMoniker::BindToStorage().
My original code used URLOpenBlockingStream() which suffers from the same problem when accessing res: resources.
Please help!
|
|
|
|
|
I am not sure there is a moniker for the res:// protocole. Actually, CreateURLMoniker is for http://, ftp://, and a few other. I am almost sure that CreateURLMoniker does not work with file:// for instance.
How low can you go ? (MS retrofuck)
|
|
|
|
|
In my tests it works fine with the file: protocol. Thats the beauty of it, since an app can locate the resources it needs in a consistent way no matter where they are stored. Unfortunately the protocol handler for res: doesn't seem to work exactly like the others but it must be possible since you can create a IMoniker to a res: file and hand that to IE for it to load with no problems!
I know that i could create my own pluggable protocol handler and that would then allow me to get at my files in resources but that seems like a lot of work when there must be slight change that i can make to the way i deal with the IMoniker interface to take advantage of Microsofts res: implementation.
|
|
|
|
|
Alrighty, here's the setup.
Machine A has a local object server (.exe) called AFIT. Another application creates the AFIT object and registers it using RegisterActiveObject(). Another server is available to local and remote clients called AFITFinder, which provides one method that returns the results of GetActiveObject().
Machine B has a client that creates an AFITFinder on Machine A, and uses it to get an interface to the AFIT object from Machine A's ROT.
This all works fine.
Machine B can create an AFITFinder on Machine A no problem for the first 5 minutes (very repeatable) after AFIT has been created. If, on the other hand, I wait for 5 minutes or more, then the GetActiveObject() call fails on Machine A. That is, Machine B creates the AFITFinder on Machine A (successfully), calls GetAFIT() (marshalled successfully), but in GetAFIT(), the call to GetActiveObject() fails with 0x800401E3 (Operation Unavailable).
I've tried changing every security setting I can find. It just doesn't make sense that the same call becomes unavailable after leaving the connection idle for 5 minutes.
Have any of you ever heard of a timeout like this? Is there some security setting that time's itself out in a DCOM connection?
Is there some reason the ROT should drop my object after a certain period of time? It's registered as "strong" and definitely NOT being revoked in the meantime.
Any help would be greatly appreciated.
[edit]
I just tested it with a local client and it failed with the same problem. That is, Machine A created a local AFITFinder object and failed in the same spot.
[/edit]
J
|
|
|
|
|
What is your client written in? I know some languages (PowerBuilder for one) have a default timeout of 5 minutes on all ole objects.
Jason Henderson start page articles "If you are going through hell, keep going." - Sir Winston Churchill
|
|
|
|
|
Client(s) and server are all written in C++ (ATL).
What would enforce that timeout? Some boilerplate framework code? Or is it something in the underlying COM libraries?
J
|
|
|
|
|
I want to create event handler in WebBrowser (using MSHTML).
But I don't know how to set VARIANT.pdispVal to point to my event handler function.
/*************************************/
IHTMLElement::put_onclick(VARIANT v)
/*************************************/
/************** My code ***************/
IHTMLElement* pElement;
......
VARIANT var;
VariantInit(&var);
var.vt = VT_DISPATCH;
var.pdispVal = ????? <==== what I have to do ?
pElement->put_onclick(&var);
/*************************************/
What I have to do to make my handler function becomes IDispatch interface ?
|
|
|
|
|
You've got to pass an object interface supporting the following DISPID_HTMLELEMENTEVENTS_ONCLICK dispatch method id. Search MSDN with this keyword.
You've got to implement Invoke in this object, and especially provide implementation for the case dispid==DISPID_HTMLELEMENTEVENTS_ONCLICK.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
Is there a way to enumerate all client connections to a DCOM server? I'd like to be able to call a method on all instances of my class object.
Is it possible and if so, how??
Thanks
Jason Henderson start page articles "If you are going through hell, keep going." - Sir Winston Churchill
|
|
|
|
|
I think the only way to do this is to register the clients at the server object, i.e. store a reference to the clients (observer pattern).
|
|
|
|
|
Hi, I am having some problems with a pair of COM controls i have written. Each control starts up threads to deal with a serial port and fires events back to the container app on certain data recieved.
I want to be able to deal with the situation where the container is shut down with out calling my clean up methods.
If I have only one control running every thing seems fine and the code cleans up
if i run both controls (seperate serial ports no common variables or code) then I can get in a situation where i signal my threads to stop and they never do. I call the "Emergency shut down" on a c++ deconstructor of the com control. The emergency shut down sets a flag that will cause the thread to abort and not fire the controls events but the thread gets NO runtime even with stupid sleeps() while i am waiting for it to return before destroying my com object (from a c++ sense).
I can only assume I have deadlocked the com control. If i let the deconstructor complete I either get a page fault due to my variables being now nonsense or I find I was in the middle of firing the com event and now the rest of that events code no longer exists either way page fault and the container goes down with any recorded data.
How can I
1) avoid this dead lock
2) detect the container/control is going down and have time to stop my threads close ports etc.
and why does having both controls running on a single container matter?
Thanks in advance
Robin,
|
|
|
|
|
The most common overlooked problem in STA COM components is that the thread that CREATES the components must be running a message loop or else no method call will be processed, even the release. If you have a thread 1 that's waiting for a thread 2 to Release(), and thread 2 created the COM STA component, you are in serious trouble (deadlock).
Without looking at the code, it seems to me that this is the problem.
My latest articles:
Desktop Bob - Instant CP notifications
XOR tricks for RAID data protection
|
|
|
|
|
Thanks for the reply,
My main thread in each control is based on an ATL wizard anyway so that should be sound and have a message loop etc. Its a worker thread that is locking up. The worker thread can send events (via a global interface table) it does no other COM and it just watches for a c++ flag to drop to quit. The kill method is in the main ATL bit so/and the flag is getting set but then while I sleep waiting for clean up the worker thread seems to stall.
But and this is where it is werid. If i run one control it cleans up, if i use two controls it locks up!. The two controls are very similar. a main ATL wizard body and a worker thread that can dispatch events with a GIT. but apart from a common container (VB6 form) they are independent!
My assumption is that if the event gets fired in the worker thread and a method is invoked in the "main" thread the event is locked until the method returns meaning i can never clean up.
Based on your reply will a message loop in the worker thread help? I'm confused!
|
|
|
|
|
I'm working on a rather large and useful library (with some implementations of it, like shell extensions and ActiveX controls) that I'd like to sell as shareware, but I'm new to the COM licensing model. I've been researching it quite a bit, but I'm curious if anyone here in this forum has any experience with it.
Say I'd like to offer a 30-day/15-uses trial period. Is the COM licensing model a good thing to use for this, or would a home-brewed solution work best (perhaps even a commercial library that does this, although the price I'm selling it for doesn't really warrant such a commercial library)? Any experience out there on this? TIA
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Hi,
I'm creating a directshow application with visualc++ 6.
I need to make a selection tool (similar to Paint) that can select rectangular, elliptical and free-hand regions.
Is there a tool already availible for this? If not, what is the best way of retrieving the coordinates of mouse down and up events if they occur within a certain area of the dialog box?
[... still new to this]
|
|
|
|
|
I worked before. Then I did something stupid and my program crash. Then I change it back. Now when I execute the program, it hangs. I trace through the source and find it stops at ::CoCreateInstance (called by CComPtr.CoCreateInstance()). Any idea?
|
|
|
|
|
register the COM component again.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
Hello There,
Can somebody advise me where I can download the sample codes(i.e.control object(CO) and service object(SO) and its testing application) ? I need to know the skeleton and the methods/properties relation for each CO,SO and AP.
Meanwhile, some opos related link to Microsoft is gone !
(i.e.http://www.microsoft.com/business/industry/ret/retoposoverview.asp). If anyone of you knows where to link to Microsoft for OPOS documents, please let me know.
THANKS IN ADVANCE !!!
BEST REGARDS FROM,
Julio
|
|
|
|