Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

The program I 'm writting needs to call up several devices, on certain moments in time, to collect data that's stored in an SQL database. I found a .dll on the net that gives me the possibilty to open a serial port, and to put data to and get data from it, but this .dll goes in the mist every now and then, resulting in errors where no source is available for. Any idea when microsoft will develop a mscomm - alike control for the .NET environment? I would really appreciate a lot any kind of help/information ...

 

Kurt

qrt
Posted
I found these two pages before, but they are not really satisfying. The best results are actually obtained by installing vb 6.0 and then adding a refference to the mscomm32.ocx ActiveX in the .NET project. I know serial ports are dated technologie, but a lot of industrial devices use them and I really think it's a shame Microsoft didn't create a comparable managed class for the .NET framework until now.
qrt
Posted
I got pretty good results for the moment, but one question: The application runs on my machine because the installation of VB6.0 gave me a developers license for the mscomm32 ActiveX control. On machines where VS6.0 is not installed, the application causes a run time error because the ActiveX isn't licensed runtime. Anyone knows a way to solve this problem? Time issues make it impossible for me to start figuring out about creating my own component.
qrt
  • *Gurus*
Posted
Running the application shouldn't be a problem, mscomm shouldn't require licensing except at design time. Are you sure it's not that you haven't distributed the ocx and registered it properly? That would be the most likely cause.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

Could you give me a short overview of how to do that divil? In the deployment project I used the ocx is mentioned under the detected dependencies. Is there more to do for registrating it on the target machine?

Under the detected dependencies, also scrrun.dll is mentioned. When I build the solution I get a message that I should exclude the scripting runtime dll because its source file is under windows system file protection. Maybe my licensing problem was caused rather by this?

qrt
  • *Gurus*
Posted

It's possible, but unlikely. I have no idea why you have a dependancy on the scripting runtime, you should certainly not be using it in a .NET application.

 

I'm surprised that the mscomm.ocx file was detected at all by your setup and deployment project - I've never had it find ActiveX controls properly. Still, if it is, well done you :) Select the file, and in the propertygrid, look at the Register property. I think this should be on COMSelfRegister for ActiveX controls.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

That's ok. Got it working by acutally placing the ActiveX on a form in stead of creating a variable of the type msCommLib.msComm.

Then the ActiveX is indeed self-registered on the target machine. But when after testing I uninstall my project, the ActiveX is unregistered from my machine as well, and I always have to reregister is (with regsvr32) before I can work with it in VS again.

qrt
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...