MSComm32.ocx in VB.Net problem

Hi everyone. A while ago I wrote a library which helps me simply text operations, serial communications, PLC interaction using OPC Automation, etc... My problem is with the vb6 serial control mscomm32.ocx. In my computer, I can use it with no problem. Everything works fine when testing serial control and my forms can open sucessfully. When I try to run a winform that uses Serial library (mscomm32.ocx) in a computer that doesn't have VB6 installed, I get the error "Common Language Runtime Debugging Services. Application has generated an exception that could not be handled. PRocess id=0xe0 (224). Thread id= 0x6f4 (1780)"

I started to eliminate extra references to libraries that were not used, change and register used dll's and take out module loaded from the library I made and my application uses, and I found that the problem is with the Serial part (I did register the ocx) . So if I eliminate that library the form can open with no problem. I then tried importing the MSComm32.cx control from windows/system32. I ran the application and the form opens with no problem at all.

How can I check whats wrong with the library I wrote How can I ensure the serial part, once working in my computer, will work in the clients PC also Can anyone give me a hint with this thing.

Thanks everyone
JP




Answer this question

MSComm32.ocx in VB.Net problem

  • SRavi

    One thing to bear in mind is that you may not have the license rights to distribute MSComm32.ocx with your application. I believe you will only have the rights to do so if you have a license to develop the origional [VB6] application/library.

    (mscomm32.ocx is not licensed for redistribution through VS2003 or VS2005)



  • bronce32

    I g-g-g-uess so.



  • Recycled Gardens

    Oh, I was missunderstanding what SJ said.
    I do have a licensed VB6. So I guess there's no problem with this.



  • Charles G.-Marcil

    You need to install vb6 runtime files which can be downloaded and then distributed with your app:

    http://www.microsoft.com/downloads/details.aspx FamilyID=BF9A24F9-B5C5-48F4-8EDD-CDF2D29A79D5&displaylang=en



  • Paul Martin

    Hey Dman,

    I tried installing the runtime files but I can't still open my form correctly when using Serial control in my VB.Net application. Any other idea why this keeps hapenning Im really lost here.



  • atul_v

    The VB runtime files do not include those components.

    You also need a developers license to develop your application using those components. The licensing for those components has been flaky. There is a 'fix' for this, but it was for the VB6 Development environment. I suspect that when you use your VB6 component which uses the ActiveX controls, the 'invalid' license is detected, whereas putting the ActiveX controls in your .NET application doesn't fire of the invalid license warning (for some reason).

    Basically, you can't create a component wrappering the ActiveX controls and then develop with that component to attempt to bypass the development license restrictions.

    Do you have VB6 installed If not, then installing that will probably correct the issue. The fix for the design time licensing requires VB6 to be installed.



  • Frank Loizzi

    I doesn't make any difference if it works. The software doesn't check to see if the component is licensed.

    WHat SJ is saying is that the ocx is only redistributable IF you are a licensed VB6 owner. If you are not a licensed VB6/VS6 owner then it is illegal to distribute the ocx with your project.



  • sana234

    Hey SJ..

    Well.. I do understand what you are explaining to me. In my case, I can add the control to the form which checking in other forums thats were the license popup appears. I executed VB6Controls.reg from the VB.Net installation CD and registered the .ocx and it worked.



  • PedroAntonio

    Thanks SJ.. thank you for seeing my post.

    My library was developed using VB.Net and in this case when implementing a VB6 component, wouldn't some kind of error appear when compiling the library Besides, if I add Mscomm32.ocx directly in my form no error appears and the application opens with no trouble at all. I also use the msflxgrd.ocx (MsFlexGrid) and this one opens correctly. I tried re-registering the ocx more than once. I got no idea why this happens, and I really need to get it working. Is there any other way to check it will work correctly

    Thanks again,
    JP



  • MSComm32.ocx in VB.Net problem