Solved

Very Simple COM Example Please

Posted on 2001-07-15
8
491 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
 
LVL 10

Author Comment

by:makerp
ID: 6284905
Alex

paul_maker@hotmail.com
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now