Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 22nd, 2010, 07:29 AM
Registered User
 
Join Date: Nov 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot create active x component error

Hi,

I am using visual basic.net to move some linear stages through a serial port. I managed to write a code which worked and I was able to move the stages etc. However the computer I want to use does not have a serial port and so I am now using a serial to USB adapter. When I now try to run the program I get an error message saying:

An unhandled exception of type 'System.Exception' occurred in microsoft.visualbasic.dll

Additional information: Cannot create ActiveX component.

when I click on the "Open com port" button.

The start of my piece of code is:

Dim OldHandshake As Integer
Dim Oldsettings As String
Dim OldMode As Integer
Dim OldInputLen As Integer
Dim myCom As Object

Private Sub OpenComPortRenumber_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenComPortRenumber.Click
myCom = CreateObject("MSCommLib.MSComm")
With myCom

.CommPort = 1
.PortOpen = True
'save current port settings
OldHandshake = .Handshaking
Oldsettings = .Settings
OldMode = .InputMode
OldInputLen = .InputLen
'set the new settings
.Handshaking = 0
.Settings = "9600,N,8,1"
.InputMode = MSCommLib.InputModeConstants.comInputModeText
.InputLen = 1
.RThreshold = 1

MsgBox("Opening Com Port")
System.Threading.Thread.CurrentThread.Sleep(1000)
MsgBox("Done")
MsgBox("Renumbering Units")
.output = Chr(0) + Chr(2) + Chr(0) + Chr(0) + Chr(0) + Chr(0) 'renumber the units
MsgBox("Done")
End With
End Sub

The code cannot run past the myCom = CreateObject("MSCommLib.MSComm") line of code.

I would appreciate any help as I am very new to all of this.

Louise





Similar Threads
Thread Thread Starter Forum Replies Last Post
Active x control Crystal Reports Component Problem jimh78 SQL Server ASP 2 July 11th, 2007 01:19 AM
Create Component and use anywhere vivek_inos ASP.NET 2.0 Professional 0 October 20th, 2006 07:50 AM
Run time error 429- ActiveX component can't create carswelljr VB How-To 2 September 8th, 2006 12:22 PM
how to update active X component in ASP Andraw Classic ASP Basics 5 April 26th, 2006 03:51 AM
Active x control Crystal Reports Component Problem jimh78 Classic ASP Components 0 September 25th, 2003 03:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.