Solved

Installing a Com Object

Posted on 1998-06-19
4
212 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

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

Suggested Solutions

Title # Comments Views Activity
EvenOdd challenge 10 142
fix34  challenge 9 163
Entity Framework Code first - Specify minimum one cardinality in a many to many relation 10 73
Explain Unit of Work pattern 2 75
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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…

679 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