There are still some good book out there for that:
Essential COM
COM and ATL (CD with exe-server)
.NET and COM (very actual and 2000 pages of info ;-)
Understanding and Programming COM
Regards
Friedrich
Main Topics
Browse All TopicsI need a very basic source code example for an out-of-process COM server and client on Visual Studio 2005. Bo the client & server should be written in C++. can somebody point me to the right place.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I tried the solution by OnegaZhang. This works correctly with VC6.0. Then I converted it with VS 2005, and got a compiler error
"server_p.c: fatal error C1189: #error : You need a Windows 2000 or later to run this stub because it uses these features".
I added "_WIN32_WINNT=0x0500" to the preprocessor definitions. But then I get several link warnings:
1>.\Proxy.def : warning LNK4222: exported symbol 'DllGetClassObject' should not be assigned an ordinal
1>.\Proxy.def : warning LNK4222: exported symbol 'DllCanUnloadNow' should not be assigned an ordinal
1>.\Proxy.def : warning LNK4222: exported symbol 'DllRegisterServer' should not be assigned an ordinal
1>.\Proxy.def : warning LNK4222: exported symbol 'DllUnregisterServer' should not be assigned an ordinal
Is there something else I need to do?
Hi, based on link provided
http://www.codeguru.com/cp
I built COM server in similar manner. I able to access via client properly.
When I am trying to extend the COM server interfaces I am getting failure when doing CoCreateInstanceEx(E_NO_IN
.idl --- code
...
[ object, uuid(725AB476-9A20-401e-B1
interface ITriple : IDispatch {
HRESULT Triple(int x, [out, retval] int* retval); }
library Server {
importlib("stdole32.tlb");
interface IDouble;
[ uuid(10000002-0000-0000-00
coclass MiniDcom {
interface IDouble; }
interface ITriple;
[ uuid(98BB1009-F869-408b-92
coclass MiniDcom2 {
interface ITriple; }
};
Server.cpp /// code
created
class CMiniDcom2 : public ITriple // similar way what is there for CMiniDcom
created
class CFactory2 : public IClassFactory // similar way as per CFactory
main()
RegisterServer("Server.exe
RegisterServer("Server.exe
IClassFactory *pIFactory = new CFactory();
CoRegisterClassObject(CLSI
IClassFactory *pIFactory2 = new CFactory2();
CoRegisterClassObject(CLSI
//// Client.cpp --- Inside Client code
I am first calling CoCreateInstanceEx(CLSID_M
then calling
hr = CoCreateInstanceEx(
CLSID_MiniDcom2, NULL, CLSCTX_REMOTE_SERVER, &si, 1, rgmqi);
I am here getting E_NO_INTERFACE failure. !!!
If I call only CoCreateInstanceEx(CLSID_M
things doesn't work if I want to create both CLSID.
What could be worng here ? can someone pl. provide me correct approach to implement multiple CoCreateInstance for different CLSID?
Thanks.
Business Accounts
Answer for Membership
by: OnegaZhangPosted on 2007-09-28 at 18:14:40ID: 19982647
http://www.codeguru.com/cp p/com-tech /activex/a rticle.php / c5547/
Minimized Sample of DCOM Server