|
Developers guide to ATL and COM
http://www.amazon.co.uk/exec/obidos/ASIN/1556227043/202-2451278-4678239[^]
This book is the best by a long shot.
It takes you though what com is about - interfaces, and before you even touch com works you though making interfaces in pure C++. Later you make a com dll in pure c++, and its not hard once its explained well. Then it moves on to using IDL(interface definition language) and how ti helps. Then finanlly once you know the fundamantals, it shows you how to use ATL properly, from In process DLL's to out of process objects in an EXE possibly even on another machine with DCOM. As well as that it clearly explains call backs and connection points, COM error handling.
If you want to learn COM get this. It has to be one of my best all time buys.
Don't be put off by the version. ATL skipped from 3.0 to 7, but there is no difference in the COM area of ATL. The main only thing I see in ATL7 that is not the same with ATL3 is NT Services, and all they have done there is make it easier.
Hope this helps.
|
|
|
|
|
"Developer's Workshop to COM and ATL 3.0"
I fully agree that it's a great book. As Giles says, the approach it takes is what makes it so good. Probably one of the best Technical books I've ever bought
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
I have encapsulated a "view" into an ActiveX control.
I realized that if my testers ran the production version of my program they might get the test version of my control or vice-versa. In order to fix the problem, I re-register all .ocx and .dll files found in the program directory.
The problem is... When a user launches the production version, then the test version, then opens the "view" in production they get the test version (registered last)
Do I need to constantly be updating GUIDs or is there an easier way to do this with a compile time switch?
|
|
|
|
|
Hi all,
could anybody advise me a reading or help me to solve the problem:
How to COM client to get known about the server it uses crashed without polling on some interface method of this server waiting for error ? I mean, is there some back notification mechanism ?
Best regards,
Vipsy
|
|
|
|
|
If you create the server process, then you have its process's handle.
Therefore, create a worker thread that waits on the handle:
WaitForSingleObject(...).
If you didn't create that process, then you can get the process handle by
using my tool:
How to get handle to any running process by its name
Goodluck,
Dudi
|
|
|
|
|
|
I think Wrox used to publish one, what are you looking to do?
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Is it wise to create a critical section in the constructor, and delete it in the destructor? I once read that I should use FinalRelease, however I am unsure about it. Could someone offer some advice?
Jeremy.
Jeremy Pullicino
Professional C++ Developer
Done any hacking lately?
|
|
|
|
|
The big difference between the constructor/destructor and finalconstruct/finalrelease is that in final* you can return a value.
If something goes wrong in the constructor, you can not tell it to the client, but if you use finalconstruct instead you can return E_FAIL, and the client know there was an error.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
No return value in FinalRelease(). Think about it, who're you going to return to?
--
Yeeeeehaaaaawwwwd!
|
|
|
|
|
Oops
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
The biggest advantage over FinalXXX over ctor/dtor is that you can compile with _ATL_MIN_CRT and not having to worry whether your global objects constructors/destructors are called or not. And you can signal error through HRESULT in the FinalConstruct method, causing CoCreateInstance() to report the failure. In C++ you'd have to throw something for that, and we all know that exceptions and COM doesn't really go hand in hand.
Of course, you could bypass the _ATL_MIN_CRT effect with placement new/explicit destructor calls in select places. However, FinalXXX is safer and produces more maintainable code, IMHO.
--
Yeeeeehaaaaawwwwd!
|
|
|
|
|
Hello everyone!
I've been searching for a tutorial about creating ActiveX controles on a website (no asp.. just html & javascript)
One of my friends said that i should use "COM", but i haven't found anything that worked.. I've seen one here with cookies in ASP, but when i'm not using ASP, it's kinda hard..
maybe someone has a small source for an ActiceX control that returns a string.. like
This is a test: (call function from ActiveX control)-> "Test string returned from an ActiveX control"
I hope someone can help me or direct me to a good tutorial..
Ice
|
|
|
|
|
you cant create an ActiveX controls on websites but you can embedd it on a web page. You must create your custom activex by VC++ or VB. Then embedd it with one of web page design programs such as front page or composer.
A. Riazi
|
|
|
|
|
I've got that far.. Now, how do i make the activex control? I'm using VC++ 6.0.. so which projekt should i use?
|
|
|
|
|
MFC ActiveX Control Wizard!
A. Riazi
|
|
|
|
|
I have a ActiveX COM component and i am using that component in webpage packed as cabinet file.
When the button in a webpage is clicked the page is processing using the activex.
But i am having the strange problem...the compoent works if i wait till the component is fully downloaded.
But if the use clicks the button on the page before the page is fully loaded i am getting error..
How do i fix this problem..
any help appreciated..
|
|
|
|
|
Make an empty page containing only this ActiveX. when downloading of ActiveX finished, redirect this empty page to your desired page (page that has button)!
A. Riazi
|
|
|
|
|
I was wondering I have heard lots of how it is good to have some COM/ALT expereince I was just wondering where exactly can you find info on this subject are there any very informative sites on this subject? If so where? or is it more of a thing you learn with lots of experience and books. If so how many years should one wait before learning alt/com.
- LiquidKnight
|
|
|
|
|
There are a lot of articles about COM/ATL here on codeproject...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello,
I'm running the same executable under WIN200 Pro, SP3
and WIN200 Server SP2. This app uses the same InProc
COM control. BUT, under WIN2000 Server the call takes
approximately 15 times longer.
Any ideas/suggestions aree highly appreciated.
Regards,
Valeriy Raygorodetskyy
|
|
|
|
|
What does it do? Is it under COM+? Did you use procexp.exe?
|
|
|
|
|
Thanks for your responce.
No it is not COM+, just pure InProc guy which makes some
calculations (no database calls). And I did use DependencyWalker to be sure that I'm comparing apples-to-apples, but thanks for reminding about procexp.exe - I'll try it as well.
Valeriy
|
|
|
|
|
Hi,
I created a VbActivex dll and called the dll in the asp page using CreateObject Function.Dll is working Fine,but once after running the Asp page, then if i try to "make the dll" again after making some changes to it,I am getting the error:"Permission denied C:\winnt\system32\project2.dll".Only if i restart the System and then make the dll then it is getting compiled.Every time i cannot keep on restarting the system as and when i make any small changes.I am new to this concept.Can anyone provide me a solution for this so that i can make the dll again and again without system restart.I require ur help plsssss.
Thanks in advance
shankar
|
|
|
|
|
Restarting MTS(COM+)/IIS is a simpler solution
|
|
|
|