Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

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
0
makerp
Asked:
makerp
  • 3
  • 2
  • 2
  • +1
1 Solution
 
premchaitanyaCommented:
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
0
 
AlexVirochovskyCommented:
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).
0
 
jkrCommented:
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/
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
makerpAuthor Commented:
Alex

paul_maker@hotmail.com
0
 
makerpAuthor Commented:
jkr

the order CD link is busted

i would download it but my ISP is crap and drops my connection every 2hr
0
 
jkrCommented:
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...
0
 
AlexVirochovskyCommented:
Done, sorry for delay: I havn't much free time.
0
 
makerpAuthor Commented:
magic alex, thanx, that is perfect. nice and basic,

Thanx again

Paul
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now