Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

Installing a Com Object

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
AaronW
Asked:
AaronW
  • 2
1 Solution
 
AaronWAuthor Commented:
Edited text of question
0
 
t004024Commented:
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
 
ambyCommented:
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
 
AaronWAuthor Commented:
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now