473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Proble with COM object events

Hi all,

I am a newcomer to VB 2005, and have a project working that handles events from another application. Strangely, simple things -like displaying a message box inside the event handling subroutine, or changing the text of an edit control- work, but others, like starting a timer or updating a progress bar inside a status strip won't. In the code below, the attempt to set the progess bar to 50 in response to eventcode 1 does nothing and generates "A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll". The DelayedAction timer in response to eventcode 0 will not execute, or -strangely- only the second time it is started???

Friend Class Form1
Public WithEvents Camera As MaxIm.CCDCamera

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Camera = CreateObject("Maxim.CCDCamera")
Camera.LinkEnabled = True
Camera.EventMask = (-1)
Exposure_ProgressBar.Value = 0
Exposure_ProgressBar.Maximum = 100
End Sub

Private Sub Process_CameraEvent(ByVal CameraEventCode As Short)
Select Case CameraEventCode
Case 0
DelayedAction.Start()
Case 1
Exposure_ProgressBar.Value = 50
Case 8
Case 14
MsgBox("Connected")
Sequence_StatusText.Text = "Connected"
Case 15
MsgBox("Disconnected")
End Select
End Sub

Private Sub Camera_Notify(ByVal EventCode As Short) Handles Camera.Notify
Process_CameraEvent(EventCode)
End Sub

Private Sub DelayedAction_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DelayedAction.Tick
MsgBox("Delayed Action")
DelayedAction.Stop()
End Sub

End Class


Frankly, I don't know what to do next. But something must be wrong in how I've set this up. Thanks in advance for any hints!

Robert
Oct 26 '06 #1
0 840

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: pintur | last post by:
The message is: SQL1036C Errore di I/O durante l' accesso al database. SQLSTATE=58030 what is the proble? what for restore tables? thanks
5
by: Sunny | last post by:
Hi, I have to implement client/server application. The client have to instaniate an remoting object via http and pass some auth info. If the auth is OK, the client should invoke a method (or...
12
by: Ricardo Pereira | last post by:
Hello all, I have a C# class (in this example, called A) that, in its constructor, starts a thread with a method of its own. That thread will be used to continuously check for one of its...
5
by: Michael Moreno | last post by:
Hello, In a class I have this code: public object Obj; If Obj is a COM object I would like to call in the Dispose() method the following code: ...
16
by: anonymous.user0 | last post by:
The way I understand it, if I have an object Listener that has registered as a listener for some event Event that's produced by an object Emitter, as long as Emitter is still allocated Listener...
11
by: Andrus | last post by:
I'm implementing entity object which should populate its properties from database when property is first referenced. In RDL reports I use object properties like MyObject.MyProperty MyObject...
6
by: josh | last post by:
Hi, I've the following problem: If I have, for example, BB = { CC = { makeDecision : function() {
1
by: maifs | last post by:
my application contain three forms: frmMain(mdiContainer) frmEditable frmTools private void frmEditable_MouseDown(object sender, MouseEventArgs e)
2
by: saketmayur | last post by:
Hi , I have write the following code to open word document on server using Microsoft.Office.Interop.Word; string DocPath = System.Configuration.ConfigurationManager.AppSettings; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.