class

How to share a class object in Java?

Hi, I'm using NetBeans IDE to create a system. I created an instance of a class, then I want to access this instance from a different JSwing Form. I declared the class as public, but it still doesn't recognize the instance. Any help? Regards.. ...

how can i use main class variable in extendeded class

class a{ $array = array(); } class b extends a{ **I need to get that array here !** } I'm not familiar with oops concept so please somebody help me ...

Misscreation of my template class causes errors with SOCKET, why?

Hey... I created a class which holds data of type and returns an vector on request. But somehow the following error occurs: error C2259: 'CAcceptor' : cannot instantiate abstract class due to following members: 'void CDataAndEvent<C>::InitQueue(void)' : is abstract with [ C=SOCKET ...

Call to a member function prepare() on a non-object error.

This is the code I'm using to pass the database handle to my class: $db = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); if ($db->connect_error) die('MySQL connection error (' . $db->connect_errno . ') ' . $db->connect_error); $linkgen = new Linkgen($db); echo $linkgen->getLinksLeft(); And this is the code in the Linkgen class: ...

How can I get the class name from a C++ object?

Is it possible to get the object name too? #include<cstdio> class one { public: int no_of_students; one() { no_of_students = 0; } void new_admission() { no_of_students++; } }; int main() { one A; for(int i = 0; i < 99; i++) { A.new_admission(); } cout<<"class"<<[classname]<<" "<<[objectname]<<"has "...

Create an instance of a class referenced by a variable generated in a method

Ok so here is what I need to do: I am reading in a CSV file and need to generate a new instance of a class for each line. I then need to store the reference variable for the class in a List. I am ok with most of this but how do I generate a class using a variable something like this string newClassName; int a = 1; //counts number of...

C# accessing form member from separate class

Hi all, I need some advice please on the best way to achieve a particular outcome... My scenario... I have a Form1 class, which is my main Form with a picture box on it. I have a second class called camera that using an event handler grabs a frame (bitmap) from my webcam. I then want to pass this frame to the picture box in the main...

cant call function from within its class but can otherwise?

hello there. - just can't seem to get a result from a function called in its class... require_once($_SERVER['DOCUMENT_ROOT']."/youradmin_v2/scripts/php/IPTC.php"); class Media{ function Media() { // connects to db } function getMetaData($mediaID){ global $select; $mediaDB = $select->mediaSelect($...

Cloning objects in Java [3 questions]

will the clone method of Asub be called by doing this? Or is Asub deep cloned properly? If not, is there a way to propery deep clone Asub through this kind of method? abstract class Top extends TopMost { protected Object clone() { Object obj = super.clone(); // deep copy and try catch } } abstract class A exte...

When classes want to couple

I am having an issue with 2 classes that were once nicely separated, but now they want to couple. Without getting too much into the specifics of the problem, here it is: I used to have a class Triangle that contained 3 space-position vertices. class Triangle { Vertex a,b,c ; // vertices a, b and c } ; There were many Triangle in...

iPhone SDK difference between isKindOfClass and isMemberOfClass

Can any one tell me what the difference is between the isKindOfClass:(Class)aClass and the isMemberOfClass:(Class)aClass functions? I know it is something small like, one is global while the other is an exact class match but I need someone to specify which is which please. ...

Is UML Class Diagram of Zend_Log correct?

Background of question Analysis of Zend_Log reveals following Class Diagram Zend_Log: uses ReflectionClass & Zend_Log_Exception maintains reference to array of Zend_Log_Writer_Abstract maintains references to array of Zend_Log_Filter_Interface Zend_Log_Writer_Abstract maintains reference to array of Zend_Log_Filter_Interface main...

__call magic creating new classes in PHP

Hey everyone, I am using the __call magic within some of my mvc code to produce an autoloadable forms framework but I have ran into a problem I am hoping some one on here might have a work around for. The __call magic takes two paramters: $methodName and $arguments. The arguments come back as an array of args which you called. Normally...

Objective C create object by class

I would like to know how to create an object of the specified Class in objective c. Is there some method I am missing in the runtime docs? If so what is it? I would like to be able to do something like the following: NSDictionary *types; -(id<AProtocol>) createInstance:(NSString *) name { if ((Class cls = [types objectForKey:name])...

Get object class name from within parent class?

I am wanting to use the get_class($var) to show the class of an object. What would be the best way to do this? My code at the moment is: abstract class userCharacter { var $cName; var $cLevel = 0; var $cHP = 50; var $cMP = 20; function __construct($n) { $this->cName = $n; } function showDetails() {...

Can't get window handle of a D3D application

Hello there, I'm trying to send keys to a minimized/unfocused D3D application using C#. So I borrow FindWindowEx and PostMessage function from the Win32 API. I also used Winspector Spy to determine the class name of the D3D canvas to fill in the 3rd parameter of FindWindowEx function, and the name is "D3D Window". Here's my code: Sy...

PHP singleton class structure - Am I doing it right ?

I have a really big script. It has a database class, a base class, a user authentication class, a resellers authentication class, paypal ipn class, a downloads class, and a plugins class The Base class extends database class like this: class Base extends database { var $userid; var $root; var $config function Base...

Using Generics in a non-collection-like Class.

Hi, I'm working on an engine which is meant to be configurable by the user (not end user, the library user) to use different components. For example, let's say the class Drawer must have an ITool, Pencil or Brush, and an IPattern, Plain or Mosaic. Also, let's say a Brush must have an IMaterial of either Copper or Wood Let's say the effe...

What is the :: sign/operator before the class name in ruby?

Hi, in ruby, :: namespaces the module and class. But I often see :: at the beginning of the class name like the following: #snippet of gollum gem def page_class @page_class || if superclass.respond_to?(:page_class) superclass.page_class else ::Gollum::Page end end What does that :: stands for if its in the be...

C#: How do you access an object instance?

I created a splash class with a timer on it, and when the timer is finished it instances another class as shown in the code below. When i then create a new class how can i access MainWindow? namespace Kinetics { public class KineticsCommand : RMA.Rhino.MRhinoCommand { Splash Splash = new Splash(); Splash.Show(); ...