Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 29th, 2006, 02:02 AM
Registered User
 
Join Date: Feb 2006
Location: pune, maharashtra, India.
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
Reply With Quote
  #2 (permalink)  
Old June 5th, 2006, 03:29 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
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.
Reply With Quote
  #3 (permalink)  
Old June 5th, 2006, 11:14 PM
Registered User
 
Join Date: Feb 2006
Location: pune, maharashtra, India.
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
Reply With Quote
  #4 (permalink)  
Old June 6th, 2006, 09:35 AM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
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
Reply With Quote
  #5 (permalink)  
Old June 7th, 2006, 12:50 AM
Registered User
 
Join Date: Feb 2006
Location: pune, maharashtra, India.
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
Reply With Quote
  #6 (permalink)  
Old June 7th, 2006, 10:02 AM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
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
Reply With Quote
  #7 (permalink)  
Old June 8th, 2006, 01:22 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.