Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 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 May 29th, 2006, 02:02 AM
Registered User
 
Join Date: Feb 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to samir_katore
Default Event handler

Hi
I want create event that will respond to change in value of varible.
As like text_change event available for Text box.
    So i want to create simillar event should get fired when value of varible get changed.
Is there any link available to do the same.

Regards,
Samir Katore
 
Old June 5th, 2006, 03:29 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

You will need to create an class with the ability to raise events.
Create your variable inside this class and expose all of that variable's properties in the class' interface.
Anytime [u]your</u> interface changes the value of the variable, raise the event you have created for that ocurrence.
 
Old June 5th, 2006, 11:14 PM
Registered User
 
Join Date: Feb 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to samir_katore
Default

Dear BrianWren,
Will you give me code example for same. Or any link explaning the same.
Thanx in advance.


samir
 
Old June 6th, 2006, 09:35 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It would be helpful to me if you would better define your requirement.
Is the variable you are trying to monitor declared as a "module" level variable in the general declarations area?
Is this variable in a form, a class or a module?
Where is the code that you want to receive the event when the variable changes?

Woody Z http://www.learntoprogramnow.com
 
Old June 7th, 2006, 12:50 AM
Registered User
 
Join Date: Feb 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to samir_katore
Default

 Actually i am fetching the values from another software(Scada), They are around 20 values. From these values if any value changes from its previous state i have to detect it, and i have to log it into database. Value will be boolean type.


samir
 
Old June 7th, 2006, 10:02 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ah. This still isn't clear. Does your Scada application publish changes? Does it provide some kind of API that provides hooks to detect changes? Is it a GUI app with a Windows form interface that provides a display of the values? There are a lot of unknowns here.

You say you are already fetching the values from the Scada software, which seems to indicate that you have some kind of API. So... the values are coming in, you need to check if they have changed, and then log the changes - seems like you already have everything you need. What specifically isn't working?

Woody Z http://www.learntoprogramnow.com
 
Old June 8th, 2006, 01:22 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

    You do not seem to be talking about an event situation. If you go get these data from the Scada system (for those who don't know, this is a protocol for interfacing small computers to automated machinery, “Supervisory Control and Data Acquisition ”), and you want to store all that have changed, you will need to examine each datum——one-by-one——to determine whether there has been a change. If you find that there has, then store the new datum.
    But that is not an event issue.





Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW TO ADD AN EVENT HANDLER pallone .NET Framework 2.0 10 September 16th, 2008 12:28 PM
Mouse Event Handler daniel.mihalcea C# 2008 aka C# 3.0 1 September 8th, 2008 06:30 AM
Event handler problem carro123 Javascript How-To 1 May 20th, 2005 03:30 PM
PreDefined Event Handler mark C# 1 June 7th, 2003 04:47 AM





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