Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Very Simple COM Example Please

Posted on 2001-07-15
8
Medium Priority
?
542 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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 400 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

715 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