Improve company productivity with a Business Account.Sign Up

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

use the MsComm32.ocx

My Delphi program use the MsComm32.ocx. When I use the program in other computer(had not installed vb5), the programs raise an EOlesyserror exception.
If some file had not be copy or the Registry would be modify?

Regards,
SupWang
0
SupWang
Asked:
SupWang
  • 16
  • 14
  • 2
1 Solution
 
dwwangCommented:
You must either rigister the OCX manually or in programm.

For manual registration, use "regsvr32 mscomm32.ocx", or use some install software such as Install Shield for Delphi4.

For progrmmingly,try the code below:

.

  uses Windows, SysUtils, ComObj;

  ...

  function OLERegister(strFileName : STRING) : BOOLEAN;
  type
    TOleRegister = function : HResult;
  var
    hLib : THandle;
    fnAdr: TFarProc;
  begin
    Result := FALSE;
    hLib := LoadLibrary(PCHAR(strFileName));
    if (hLib > 0) then
    begin
      try
        fnAdr := GetProcAddress(hLib, pchar('DllRegisterServer'))
        if (fnAdr <> nil) then
          Result := (TOleRegister(fnAdr) >= 0);
      finally
        FreeLibrary(hLib);
      end;
    end;
  end;        
0
 
SupWangAuthor Commented:
hi,dwwang
 
  I use the InstallShield express for Delphi3. How to do that?

SupWang

0
 
dwwangCommented:
As an "express" version, it does not have the ability of registering OCX/ActiveX during installation procedure.
0
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.

 
SupWangAuthor Commented:
I have the InstallShield 5.0 Professional (Build-224) version.
In it's development choose, can choose Borland Delphi, but not Borland Delphi 3. Can it support the Borland Delphi 3 or 4?
and Are you sure you program have no bug?

0
 
dwwangCommented:
In the professional version, I think every thing is OK, surely Delphi3 should be supported. Although I've not tried it yet.

I just know that Install Shiled has the ability to register OCX/ActiveX for you, but had never used that function. I never use OCX at all, I use Delphi native VCL (such as Commdrv32 or spcomm)for COM port communication.
0
 
SupWangAuthor Commented:
I tried using your program and "regsvr32 mscomm32.ocx", but it still gives the same error. Any other ideas?

0
 
dwwangCommented:
So I think the problem is not only because of mscomm32.ocx, there must be some other thing that is not registered.

Since there are so many possibilities, may be you can describe the environment as well as your App in more details.
0
 
SupWangAuthor Commented:
I tried using "regsvr32 mscomm32.ocx", but it gives the following error message: LoadLibrary("mscomm32.ocx")failed. GetLastError returns 0x0000001f. My delphi version is delphi 3. My vb version is vb5 sp3. I use the InstallShield express for Delphi3 to make the setup disk.

0
 
dwwangCommented:
Regsvr32 is a Windows system tool, how can you get such error message from this programm?

The programm I provide is an alternertive to regsvr32, which might not be fully tested, but should be used in most environments.
0
 
SupWangAuthor Commented:
I reinstall my win95, try to use the "regsvr32 mscomm32.ocx" again, but it still gives the same error. In the new win95, regsvr32.exe is not existing. I must copy it from other computer. The property of the regsvr32.exe is FileDescription: Microsoft(C)
Register Server, FileVersion: 5.00.1586.1, ProductVersion: 5.00.1586.1, ProductName: Microsoft(R) Windows NT(R) Operating System. I don't know what's the program installed the regsvr32.exe. The property of the Mscomm32.ocx is FileDescription: MSComm, FileVersion: 5.01.4319, OleSelRegister: $, Comment: July 19, 1997, ProductVersion: 5.01.4319.
0
 
dwwangCommented:
I think maybe you meet some OLE problem, I'm not very familiar with that, but if you can install IE4, those OLE files should be up to date.
0
 
dwwangCommented:
What version of win95 are you using? OSR2, maybe you can find some OLE updates from M$ website
0
 
MirkwoodCommented:
The error just means that you are missing a dll.
Goto www.sysinternals.com and download filemon
Run filemon while trying to register the mscomm.ocx.
Filemon will tell you which file did not exist.
0
 
SupWangAuthor Commented:
Can you tell me what's the DLL not exist? I tried using the Filemon to monitor the register, but still not solve the problem. Please tell me the step in more details.

0
 
SupWangAuthor Commented:
Have somebody familiar with the InstallShield 5.0 Professional? Can I use the InstallShield 5.0 Professional to register the OCX?
How to specify the destination for the File Groups in InstallShield 5.0? How to transplant the "Select InstallShield Objects for Delphi" section of the InstallShield express for Delphi 3 to the InstallShield 5.0 Professional version?  

 
 
   
 

0
 
MirkwoodCommented:
Could you post the result of filemon.
Somewhere in the output of filemon there is an entry that said
-- Failed
that the one that you are looking for.
0
 
SupWangAuthor Commented:
All of the result are success, but still cannot register.
0
 
dwwangCommented:
SupWang, surely you can use IS for Delphi4 to install Delphi3 programms, InstallShield is quite stand alone software, although named "for  Delphi 4".

Also it can open the projects created by IS for Delphi3.

Would you mind if I answer your these two questions?  :-)
0
 
SupWangAuthor Commented:
hi, dwwang
No, I am not minded. But I don't have the Delphi 4 now. Can you make some test for me? Use the Delphi 3 database Demo and add some OCX and make a SetupDisk and then setup it to another computer without Delphi and Vb. Test the Database and OCX work ok.
thanks,
SupWang
0
 
dwwangCommented:
You can just install the IS express for D4 on the machine that you are using D3. Then open the setup project(*.iwz) file use ISE for D4, this is a smooth migration.

However, our machines already have either D3 or D4 installed, so I need time to get a chance to do a real setup test on a machine.
0
 
SupWangAuthor Commented:
I tried using the IS express for D4, but still can not register the mscomm32.ocx.

I used the MS Visual Basic 5 to make a empty project, include the
MSCOMM32.OCX in it, make a setup program.In the VB setup disk, have the following files: MSVBVM50.dl_, OleAut32.dl_, OlePro32.dl1, Setup.exe, Setup.lst, setup1.ex_, St5unst.ex_, StdOle2.tl_, VB5CHS.dl_, VB5StKit.dl_, AsycFilt.dl_, ComCat.dl_, Ctl3d32.dl_, Mscomm32.oc_, OlePro32.dl2, tesinst.EX_.
I set the following files copy to the \system directory: VB5CHS.DLL,MSVBVM50.DLL, STDOLE2.TLB, OLEAUT32.DLL,
OLEPRO32.DLL, ASYCFILE.DLL, COMMCAT.DLL, MSCOMM32.OCX, MSCOMCHS.DLL (This file was found in the above test setupdisk). And set the MSVBVM50.DLL, STDOLE2.TLB, OLEPRO32.DLL, COMCAT.DLL, MSCOMM32.OCX can be self-register. But during installation procedure, Only the OLEPRO32.DLL can be success register.
Have somebody familiar with the InstallShield professional/express version?
Could you make some test for me?
I use a lot of time on the problem. Help, Help, Help.

Thanks,
SupWang

0
 
dwwangCommented:
I think you those DLLs have dependencies on each other, so you may need to use quickview(included in Win95) to view the import table of those DLLs/OCXs, then make the correct sequence of registering these.

But the most IMPORTANT thing(on which maybe I was wrong before) is that: do not select the 'self register' option for a DLL/OCX if it is not selected by default.
0
 
SupWangAuthor Commented:
Hi, dwwang

The problem was sovled.
Don't use the c:\<windir>\system\stdole2.tlb, c:\<windir>\system\oleaut32.dll, c:\<windir>\system\olepro32.dll, c:\<windir>\system\asycfilt.dll and c:\<windir>\system\comcat.dll. use this files from the c:\Program Files\DevStudio\Vb\setupkit\kitfil32\sys32
Can you please give a dummy answer of this Title and Title: "EOlesyserror exception - class not registered." and "Install the OCX" and "EOlesyserror exception - class not registered." (Please read my question history get the URL) so I can award you the Points. but sorry I can't give the points of the "use the InstallShield", becasue I still want to know how to use the InstallShield Professional Version. By the way, Can I smooth migration My Delphi 3 program to Delphi 4? Dose I need to change the code? How to using quickview(included in Win95) to view the import table of those DLLs/OCXs?

Thank you everyone.
Thank you very much.
0
 
dwwangCommented:
Ok, that's fine indeed!

Well, migration from D3 to D4 is quite easy, however, there are two main points:

1. D4 has more restrictions in type checking, but that will obviously help you make more robust programm.
2. If you are using Internet OCXs from D3, you must install them seperately from D3, since D4 has no such OCXs any more.

For quickview, you just need to install it from the accesorries group of Win95 Setup("add/remove programms" in control panel). Once installed, you can double-click any DLL/OCX/TLB... and then select quickview as the viewr.

Good luck!
0
 
SupWangAuthor Commented:
hi, dwwang
remain a question not answer. The Title is "EOlesyserror exception - class not registered." (visual basic area).
thank you again.
SupWang


0
 
SupWangAuthor Commented:
hi, dwwang
What's the InstallShield express version of your delphi4? Mine version is 2.02 Beta. It has a few bugs. Why the D4 come with a Beta InstallShield? It can not update file by any file update method. Such as DLL. That will cause setup program can not register the DLLs and OCX if a older version exist. How to solve the problem?

regards,
SupWang
0
 
dwwangCommented:
You must have Delphi4 Build5.37 CD-ROM,the IS express in it is release version of 2.02, it has no problem.

I think you can cantact Inprise local sales to get the 5.37 version CD.
0
 
SupWangAuthor Commented:
Can I download the release version of 2.02?
0
 
dwwangCommented:
Well, I can tell you a site, it's rather large. Anyway, it's what you want.

http://www.seawind.com.cn/files/delphi/ISfor537.exe

How about this time? I hope you have no further questions. :)
0
 
SupWangAuthor Commented:
Could you please make a test for me? I download the file but still can not update the oleaut32.dll.

0
 
dwwangCommented:
Sorry, but I'm afraid I can't, maybe I can't find two version of that DLL, and even I can, I don't know how and which OCX/DLL it will affect.

Are you sure the DLL cannot be updated even you select 'Always update file'? Did you restart windows after the installation?
0
 
SupWangAuthor Commented:
What's the different between the restart and not restart? If that file not be updated During the install, The MsComm32.ocx can not be self-register. Please talk about that in "use the InstallShield express".

0
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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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