Solved

use the MsComm32.ocx

Posted on 1998-10-30
32
911 Views
Last Modified: 2008-03-03
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
Comment
Question by:SupWang
  • 16
  • 14
  • 2
32 Comments
 
LVL 4

Expert Comment

by:dwwang
ID: 1345049
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345050
hi,dwwang
 
  I use the InstallShield express for Delphi3. How to do that?

SupWang

0
 
LVL 4

Expert Comment

by:dwwang
ID: 1345051
As an "express" version, it does not have the ability of registering OCX/ActiveX during installation procedure.
0
 
LVL 2

Author Comment

by:SupWang
ID: 1345052
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
 
LVL 4

Expert Comment

by:dwwang
ID: 1345053
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345054
I tried using your program and "regsvr32 mscomm32.ocx", but it still gives the same error. Any other ideas?

0
 
LVL 4

Expert Comment

by:dwwang
ID: 1345055
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345056
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
 
LVL 4

Expert Comment

by:dwwang
ID: 1345057
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345058
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
 
LVL 4

Expert Comment

by:dwwang
ID: 1345059
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
 
LVL 4

Expert Comment

by:dwwang
ID: 1345060
What version of win95 are you using? OSR2, maybe you can find some OLE updates from M$ website
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1345061
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345062
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345063
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
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1345064
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 2

Author Comment

by:SupWang
ID: 1345065
All of the result are success, but still cannot register.
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1345066
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345067
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
 
LVL 4

Expert Comment

by:dwwang
ID: 1345068
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345069
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
 
LVL 4

Expert Comment

by:dwwang
ID: 1345070
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345071
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
 
LVL 4

Accepted Solution

by:
dwwang earned 100 total points
ID: 1345072
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345073
hi, dwwang
remain a question not answer. The Title is "EOlesyserror exception - class not registered." (visual basic area).
thank you again.
SupWang


0
 
LVL 2

Author Comment

by:SupWang
ID: 1345074
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
 
LVL 4

Expert Comment

by:dwwang
ID: 1345075
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345076
Can I download the release version of 2.02?
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1345077
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345078
Could you please make a test for me? I download the file but still can not update the oleaut32.dll.

0
 
LVL 4

Expert Comment

by:dwwang
ID: 1345079
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
 
LVL 2

Author Comment

by:SupWang
ID: 1345080
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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

757 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

22 Experts available now in Live!

Get 1:1 Help Now