Solved

Very Simple COM Example Please

Posted on 2001-07-15
8
527 Views
Last Modified: 2013-11-25
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
Comment
Question by:makerp
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 1

Expert Comment

by:premchaitanya
ID: 6283398
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
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 6283490
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
 
LVL 86

Expert Comment

by:jkr
ID: 6284010
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!

 
LVL 10

Author Comment

by:makerp
ID: 6284905
Alex

paul_maker@hotmail.com
0
 
LVL 10

Author Comment

by:makerp
ID: 6284923
jkr

the order CD link is busted

i would download it but my ISP is crap and drops my connection every 2hr
0
 
LVL 86

Expert Comment

by:jkr
ID: 6287282
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
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 100 total points
ID: 6294906
Done, sorry for delay: I havn't much free time.
0
 
LVL 10

Author Comment

by:makerp
ID: 6297421
magic alex, thanx, that is perfect. nice and basic,

Thanx again

Paul
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question