Link to home
Start Free TrialLog in
Avatar of Paul Maker
Paul MakerFlag for United Kingdom of Great Britain and Northern Ireland

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
Avatar of premchaitanya
premchaitanya

Hi 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
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).
Avatar of jkr
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/
Avatar of Paul Maker

ASKER

Alex

paul_maker@hotmail.com
jkr

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
Avatar of AlexVirochovsky
AlexVirochovsky

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
magic alex, thanx, that is perfect. nice and basic,

Thanx again

Paul