instance

ActionScript - how to address instance by name?

Hi, i am new to Action Script and i have the following problem: i have global variable tabName and a button, that changes its value, just like this: on(release){ _root.tabName = this._name; } and now i want to use String variable tabName to address curtain instance on stage to edit its property (actually, i want to control, which ...

How can I call a static method on a variable class?

Hi, I'm trying to make some kind of function that loads and instantiates a class from a given variable. Something like this: <?php function loadClass($class) { $sClassPath = SYSPATH."/classes/{$class}.php"; if (file_exists($sClassPath)) { require_once($sClassPath); $class = $class::getInstance(); } } ?> If I use it like...

How do you create multiple instances of a library class in CodeIgniter?

I'd like to create several instances of a class in codeigniter. I have created my class as a library, but cannot figure out the syntax to use to create more than 1 instance. ...

Static instance, desctructor never called

Please see code below. The destructors are never called. Anyone know why and how this can be rectified? public partial class Form1 : Form { private Goo goo; public Form1() { InitializeComponent(); goo = Goo.GetInstance(); } } public class Goo { private foo f = new foo(); private sta...

Static vs. instance method for shared use

Here's what I am trying to determine... I have a utility class to append lines to a textfile. This must be used by a number of other classes, like a common logging file. In my first implementation, I had all the classes that wanted to use it make a referenceless instance, e.g. new Logger(logline,logname); The constructor creates a Pr...

Changing fill color of MovieClip Actionscript 3

Hi, i want to ask, how to change only fill color of an instance on the stage - i can do it by using ColorTransform object, but it changes color of the whole instance, not just the fill. I want to change only the fill color, not the stroke color. can anybody help me? this is my code: function paint(){ var myColorTransform:ColorTrans...

JNI vs. C++ Object Instances

I have just started at a new job. Here we are new to using JNI ( for bridging C++ / Java ). I am new to JNI so please forgive my noobness :) In our (win32) Java app we are loading a C++ DLL. On the Java side we have several instances of "SomeJClass" each of these instances needs access to corresponding instance of "SomeCClass" on the DL...

Dynamically invoking any function by passing function name as string

Hello, How do I automate the process of getting an instance created and its function executed dynamically? Thanks Edit: Need an option to pass parameters too. Thanks ...

How to list SQL 2005 Express instances

I would like to list what instances of SQL 2005 Server (Express Editon) are installed on local or remote machine (my app is in Native C++). I found that i can make it by SQLDMO, however it seems that SQLDMO does not see SQL 2005 Express Edition and call to ListAvailableSqlServers returns empty list. How can i make it? Playing with syste...

Static class vs instanced class

Duplicate Should C# methods that can be static be static? Please forgive me if this question seems elementary - I'm looking over some source code that otherwise looks pretty good, but it's raised some questions... If a given class has no member data - i.e. it doesn't maintain any sort of state, are there any benefits in not ma...

NullReferenceException was unhandled, Object Reference not set to an instance of an object

Hi there, Whenever I run my program, I get: NullReferenceException was unhandled, Object Reference not set to an instance of an object. When I start the program, I have a form appear called MaxScore where the user enters the max score and presses OK. In the OK event, I call a method from MainForm to update the maxGameCountLabel on MainF...

Members vs method arguments access in C++

Can I have a method which takes arguments that are denoted with the same names as the members of the holding class? I tried to use this: class Foo { public: int x, y; void set_values(int x, int y) { x = x; y = y; }; }; ... but it doesn't se...

How do you keep a persistent reference between two apps on the windows platform even if one crashes and re-opens?

What are some options for keeping a persistent reference to two applications even if one crashes so that when re-opening the first one, it can get a reference to the second one and call methods on it. The situation is as follows: App1 (a web browser plugin) instantiates App2 via a object reference in an HTML page and gets a reference ...

In Java, why super-class method can't access protected or private methods/variables from sub-class instance?

Let's start from another behavior: even if you declare method/variable as private, another instance of the same class can access it. It's OK I can live with it. I call these class private and not instance private. Now the question part: For example, in runtime I want to be able to check that all String variables in this class are not nu...

C# : how to - single instance application that accepts new parameters ?

I'm creating a (C#) program that downloads binaries using NZB files, there may only be one instance of my application running at any time. So when a user doubleclicks an .nzb-file and my program is not running, it should start and process it (easy, file registration). Now if my program is already running, I do NOT want to launch a secon...

Ensuring only one instance of SWF open?

I need to make sure that only one instance of a SWF is open at any one time on a computer, whether it is in 2 browser windows, or two different browsers. How can I go about doing it? I have so far thought of two potential solutions: 1) Using a Flash sharedobject - but since they never expire, if the user closes the browser window with...

It looks like I'm instantiating this SpeechAPI interface. How is that possible?

Hi, I am using Microsoft Text-to-Text Speech feature in my project. But I have a question about that, actually not directly about that. So : Normally programmers when creating Interface, they put I as a prefix of the interface name like IReadable,IEnumerator etc. But I've come across something that actually shocked me. in Microsoft Te...

Can we have a single portlet instance on multiple pages in liferay?

Can we have a single portlet instance on multiple pages in liferay? ...

flex interface question

<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Label id="lb" text="check"/> <mx:Script> <![CDATA[ import mx.managers.BrowserManager; import mx.managers.IBrowserManager; public var brm:IBrowserManager = Brow...

Reflecting on property to get attributes. How to do when they are defined elsewhere?

I have a class Bar like this: class Foo : IFoo { [Range(0,255)] public int? FooProp {get; set} } class Bar : IFoo { private Foo foo = new Foo(); public int? FooProp { get { return foo.FooProp; } set { foo.FooProp= value; } } } I need to find the attribute [Range(0,255)] reflecting ONLY on the property ...