Installing a Com Object

Posted on 1998-06-19
Medium Priority
Last Modified: 2013-11-25
I made a simple COM object that makes a dialog box. I am having problems registering it on a non development machine. I can't hand register it on my development machine but VC 5.0 is able to register it. I have used some program to find which dlls the object needs and the estination machine has them. The object works fine with VC 5.0 and VB 5.0.

I would like to know what is the missing ingredient?
Question by:AaronW
  • 2

Author Comment

ID: 1318237
Edited text of question

Expert Comment

ID: 1318238
Strange I had a similar problem which I solved just this morning. I was having problems registering my OCX control on Win NT 3.51 machine. If it helps my problem was there being different versions of OLEAUT32.DLL files. It seems that the older versions cannot read the type library which was compiled with the newer versions. So the AfxOleRegisterTypeLib was failing for me. I just generated the type library and explicitly loaded the generated type library and that works now.

So instead of calling AfxOleRegisterTypeLib(handle, tlid) I call it as
AfxOleRegisterTypeLib(handle, tlid, _T("file.tlb")). I just need to make sure that the type library file is in the same directory as the ocx file.

If U are having a COM object generated using an ATL project, U may want to see microsoft VC++ FAQ. I don't remember the address, but if U go into microsoft search and search for AfxOleReisterTypeLib, U will come up with the VC++ FAQ as one of the result. There is a question there about why registration fails.

Accepted Solution

amby earned 140 total points
ID: 1318239
Ah !!!!

OCX registration...

you need to put these DLLs into the /win95/system or /winnt/system32 directory to register an ocx made with VC:

MFC40.dll(those last two are mainly used by common controls, property pages...)

if you build your control with VB, you nedd:

in all cases, those files must be on the target machine:

I suppose it is the same fight for all com objects (if one of those DLL is missing, the registration fails...)

Author Comment

ID: 1318240
Thanks for all of your help. My problem has a lot of different parts to it. I am using Installshield to install the COM object. I stopped messing with that and I tried to hand register it using regsv32. It failed. My next attempt was to move the dll to a network drive and try to register it from the machine that failed. That also failed. The dlls and tlb files are from a machine that I was able to hand register successfully.

I think I have moved from a "missing dll" situation to a "dll version mismatch" situation.

As for T004024's comments, I am using MFC and ATL, I think that the typelibrary stuff is being handled by MFC.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
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…

600 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