Solved

Installing a Com Object

Posted on 1998-06-19
4
204 Views
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?
0
Comment
Question by:AaronW
  • 2
4 Comments
 

Author Comment

by:AaronW
ID: 1318237
Edited text of question
0
 

Expert Comment

by:t004024
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.
0
 
LVL 1

Accepted Solution

by:
amby earned 70 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:

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

if you build your control with VB, you nedd:
MSVBVM50.dll

in all cases, those files must be on the target machine:
ASYCFILT.dll
COMCAT.dll
CTL3D32.dll
OLEAUT32.dll
OLEPRO32.dll
STDOLE2.dll

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

Author Comment

by:AaronW
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java ^ examples 8 62
Dialogbox API leak? 18 82
unix example issues 18 76
.NET tools for adding thread safety to a web app? 3 19
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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…

861 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

23 Experts available now in Live!

Get 1:1 Help Now