473,320 Members | 2,107 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,320 software developers and data experts.

Defining Singleton Patten (Class)

Could someone help me with this, the error reads ' Singleton is not defined '
Expand|Select|Wrap|Line Numbers
  1. using VB.NET Web design
  2.  
  3. Imports Logix
  4. Partial Class _Default
  5.     Inherits System.Web.UI.Page
  6.  
  7.     ' *************************************
  8.     ' * singleton class
  9.     Dim PLCWeb As Singleton = New Singleton.Create()
  10.  
  11.     ' **************************************
  12.     ' Controller class
  13.     Dim thePLC As Controller
  14.  
  15.     ' ***************************************
  16.     ' Tag class
  17.     Dim theTag As Tag
  18.  
  19.     Protected Sub _btnConnect_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _btnConnect.Click
  20.         Try
  21.  
  22.             ' **********************************
  23.             ' Initialize the PLC
  24.             thePLC = PLCWeb.InitializePLC(_ipAddress.Text)
  25.             If thePLC Is Nothing Then
  26.                 _result.Text = "Failed to Create PLC"
  27.             End If
  28.             _result.Text = thePLC.ErrorString
  29.  
  30.         Catch ex As Exception
  31.             _result.Text = ex.Message
  32.         End Try
  33.  
  34.     End Sub
  35.  
  36.     Protected Sub _readTag_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _readTag.Click
  37.  
  38.         Try
  39.             ' *************************
  40.             ' read the tag
  41.             theTag = PLCWeb.ReadTag(_tagName.Text)
  42.             If theTag Is Nothing Then
  43.                 _result.Text = "Failed To Create Tag class"
  44.             End If
  45.             If theTag.QualityCode = ResultCode.QUAL_GOOD Then
  46.                 _result.Text = theTag.Value.ToString()
  47.             Else
  48.                 _result.Text = theTag.ErrorString
  49.             End If
  50.  
  51.         Catch ex As Exception
  52.             _result.Text = ex.Message
  53.         End Try
  54.  
  55.     End Sub
  56. End Class
Aug 14 '07 #1
2 1314
kenobewan
4,871 Expert 4TB
The problem is with Dim PLCWeb As Singleton = New Singleton.Create(). HTH.
Aug 15 '07 #2
Plater
7,872 Expert 4TB
The compiler cannot find a class called "Singleton", possibly you are missing a namespace for it, or have a capitalization error?
Aug 15 '07 #3

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

Similar topics

2
by: Rajarshi Guha | last post by:
Hi, I'm having a little problem with understanding the working of a singleton and borg class. Basically I nedd an class whose state will be shared across several modules. I found the stuff on the...
26
by: Uwe Mayer | last post by:
Hi, I've been looking into ways of creating singleton objects. With Python2.3 I usually used a module-level variable and a factory function to implement singleton objects. With Python2.4 I...
7
by: Senthilraja | last post by:
I have the following program using templates. Someone please let me know the syntax to be used for defining the member functions push, pop etc. as non-inline functions. #include <iostream>...
7
by: Tim Clacy | last post by:
Is there such a thing as a Singleton template that actually saves programming effort? Is it possible to actually use a template to make an arbitrary class a singleton without having to: a)...
1
by: Jim Strathmeyer | last post by:
So I'm trying to implement a singleton template class, but I'm getting a confusing 'undefined reference' when it tries to link. Here's the code and g++'s output. Any help? // singleton.h ...
3
by: Alicia Roberts | last post by:
Hello everyone, I have been researching the Singleton Pattern. Since the singleton pattern uses a private constructor which in turn reduces extendability, if you make the Singleton Polymorphic...
5
by: Pelle Beckman | last post by:
Hi, I've done some progress in writing a rather simple singleton template. However, I need a smart way to pass constructor arguments via the template. I've been suggested reading "Modern C++...
3
weaknessforcats
by: weaknessforcats | last post by:
Design Pattern: The Singleton Overview Use the Singleton Design Pattern when you want to have only one instance of a class. This single instance must have a single global point of access. That...
3
by: stevewilliams2004 | last post by:
I am attempting to create a singleton, and was wondering if someone could give me a sanity check on the design - does it accomplish my constraints, and/or am I over complicating things. My design...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.