Paul Maker
asked on
Very Simple COM Example Please
Hi
This is not homework
I want to write a simple com component that has a single class RandObj and a single method GetRand(ULONG range). i do not want to use any VC++ wizards MFC etc (i will later once i know how it all works), i am usung VC++ 5 though.
i need the code for the com component and a simple client that will call the component . also need istructions on what to put in the registry.
i want to use this as an in-process server so i dont need to get involved with IDL etc for the time being
i will ask another question after this on how to IDL it so it can be DCOM etc
Thanx
Paul
This is not homework
I want to write a simple com component that has a single class RandObj and a single method GetRand(ULONG range). i do not want to use any VC++ wizards MFC etc (i will later once i know how it all works), i am usung VC++ 5 though.
i need the code for the com component and a simple client that will call the component . also need istructions on what to put in the registry.
i want to use this as an in-process server so i dont need to get involved with IDL etc for the time being
i will ask another question after this on how to IDL it so it can be DCOM etc
Thanx
Paul
In Petzold's classic book(chapter 20) you can find very
simple example of this . If yoy want, I can send you
example of code(write your EMail).
simple example of this . If yoy want, I can send you
example of code(write your EMail).
Download the Platform SDK samples - the COM samples vome in abundance, and they also contain all 'Inside OLE' code.
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
ASKER
Alex
paul_maker@hotmail.com
paul_maker@hotmail.com
ASKER
jkr
the order CD link is busted
i would download it but my ISP is crap and drops my connection every 2hr
the order CD link is busted
i would download it but my ISP is crap and drops my connection every 2hr
Well, a smaller sample can be found at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/shellcc/shell/shell_int/contextmenuhandlers.asp - it demonstrates a context menu handler and several other 'neat' UI stuff, and IMHO also serves as a COM starting point...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
magic alex, thanx, that is perfect. nice and basic,
Thanx again
Paul
Thanx again
Paul
Its the best way to start learning com.
I suggest you to go thru Inside COM by DaleRogerson.
He gives you an example to write component
using c++ ..etc
Do read this book +vely
regards
prem