Create Events in derived class of CNi4882Dev​ice

Using VB and CW GPIB ActiveX control, we are able to do this:
CWGPIB1.NotifyMask = cwGPIBRQS
CWGPIB1.Notify
Private Sub CWGPIB1_OnGPIBNotify(ByVal mask As Integer)
In VC++, i have created a derived class from CNi4882Device. How do I add event capabilities to it and get the same callback mechanism as in the VB example?

You will use the InstallEventHandler function. You can use it to install an event for any event mask that you want. Then you can just override the OnEvent virtual member of the class and handle the event however you like. You can also install an external (outside the class) function to handle the event, but since you are deriving from CNi4882Device, it would make more sense to override the virtual member OnEvent. See the online help for CNi4882::InstallEventHandler and CNi4882:nEvent for more help.
Best Regards,
Chris Matthews
National Instruments

Similar Messages

  • Create Events in Global Class

    Hi,
    I used this link for create Events in Global Class through SE24.....
    [http://sapabapnotes.blogspot.com/]
    I do same steps as given in this link....but it show some syntax error when i check it...
    Error : "IT_LFA1" is not an internal table - the "OCCURS n" specification is missing...
    Where i define it...
    Plz tell me wat can i do...
    Thanks...
    Edited by: Prince Kumar on Jan 25, 2008 12:25 PM
    Edited by: Prince Kumar on Jan 25, 2008 12:46 PM

    Hi,
    Thanks for reply....
    I create a table type with structure LFA1....
    Plz tell me that in the interface tab....wat i write....
    Plz clear...
    thanks....

  • Flex/AS3 Best way to construct a derived class instance from an existing base class instance?

    What is the best way to handle the instantiation of a derived class from an existing base class.
    I have a base class which is being created via remote_object [RemoteClass alias] from the server.   I have other specialized classes that are derived from this baseclass, but serialization with the server always happens with the base class.     The base class has meta data that defines what the derived class is, for example
    [RemoteClass (alias="com.myco...')]
    public Class Base
         public var derivedType:String;
         public function Base()
    public Class Derived extends Base
         public "some other data"
         public function Derived()
    In my Cairgorm command which retrieves this object from ther server I want to do this:
    public function result (event: Object):void
        var baseInstance:Base = event.result;
         if (baseInstance.derivedType = "derived")
              var derivedInstance:Derived = new Derived( baseInstance );
    What is the most efficient way of doing this?   It appears to me that doing a deep-copy/clone and instantiation of the derived class is pretty inefficient as far as memory allocation and data movement via the copy.

    Thanks for the assistance.  Let me try to clarify.
    MY UI requires a number of composite classes.    The individual components of the composite classes are being transfered to/from the server at different times depending upone which component has changed state.    The construction of the composite classes from the base class happens in my clients business logic.
    Composition happens in a derived class; but server syncronization happens using the base class.    When I recieve the object from Blazeds through the remote object event, it is in the form of the base class.  I then need to instantiate the derived class and copy the elements of the base class into it (for later composite construction).   And likewise when sending the base class back to the server, I need to upcast the derived class to its base class.   But in this case just a mere upcast does not work.  I actually need to create a new base class and copy the attrbutes into it.  I believe this is limitation of how remoting works on Flex/AS3.
    My question is, what is the best way to turn my base class into it's derived class so further composite construction can take place.   The way I am currently doing it is to create a  load method on the base class, that takes the base class as on argument.  The load function, copies all of the instance attribute references from the base class to the target class.
    public Class Base
         public function Base()
         public function load(fromClass:Base)
        {  //  copy the references for all of the instance attributes from the fromClass to this class }
    Then,  after I recieve the base class from the server.   I create a new derived class and pass the base class into the load function like this:
                for (var i:int=0; i < event.result.length; i++) {
                    var derived:Derived = new Derived();
                    derived.load(event.result[i]);
    The drawbacks of this approach is that it now requires 2 extra instance creations per object serialization.   One on recieving the object from the server and one sending it to the server.    I assume copying references are pretty efficient.  But, there is probably some GC issues.     The worst of it is in code maintenance.   The load function now has to be manually maintained and kept in sync with the server class.
    It would be interesting to hear how others have solved this problem.      The server side is an existing application with around 2M LOC, so changing the code on the server is a non-starter.
    Thanks for your help.

  • Custom Inherited/Derived Class & the Data Warehouse

    Hi there,
    I'd like to reference an older post by Travis in regards to getting a Custom Class into the Dataware House:
    DW Reporting on Custom Class
    Scenario:
    I've created an Inherited/Derived Class, with its own Form (not an
    Extension).
    This Class Inherits from the Base Incident Class.
    Inherited Class has two (2) new properties (a String and a List Property).
    Class and Form is all working well within the SCSM Console.
    By default, this class is inheriting all the Relationships (like AssignedTo, AffectedUser, CreatedBy, HasConfigItem) from the Base Incident Class without me having to do anything in the mp apart from including the <Reference> & <TypeProjection>
    components.
    To get this class I am aware that it has
    to be defined - as in a new dimension has to be created for this Derived Class.
    Questions:
    1. Is it recommended to have these dimension/s in a separate sealed mp, or include it with the derived Class mp (sealed) - is there a best practice?
    2. Online resources (technet and other) state a dimension has to be created for the new Class <Dimensions>, but do I also need to include <Outriggers> as well as <Facts>
    for this Class?

    In JDeveloper 10.1.2, I configure in adfjclient_binding.xml:
    <controlDefinition name="JTable Ext"
    className="com.lib.swing.JTableExt"
    classPath=""
    shortLabel="JTableExt"
    longLabel="com.lib.swing.JTableExt"
    tooltipText="com.lib.swing.JTableExt"
    bindingType="DCTable"
    icon="/oracle/ideimpl/resource/images/palette/JTable.gif">
    <useTemplate>
    <![CDATA[${FieldName}.setBinding(panelBinding,"${BindingName}","${IteratorBinding.getId()}")]]>
    </useTemplate>
    <imports>
    <![CDATA[javax.swing.JTable;javax.swing.table.TableModel;com.lib.swing.JTableExt]]>
    </imports>
    </controlDefinition>
    and In my projects, I only drag and drop JTableExt into my form, it auto generate code:
    jTableExt1.setBinding(panelBinding, "SubProfileTypeView2", "SubProfileTypeView1Iterator");
    because setBinding function of JTableExt in my library, it contains setmodel function and some other function.
    Now, In JDeveloper 10.1.3, I drag and drop JTableExt into my form and I have to code one line:
    jTableExt1.setBinding(panelBinding, "SubProfileTypeView2", "SubProfileTypeView1Iterator");
    Which way is there, I haven't to code?
    Jacque

  • Help me I'm trying to create event listeners

    I am trying to create event listeners
    Whenever any keyboard event occurs the string s gets appended by a,c
    or p.At the end of the program its supposed to print value of s
    But s always happens to null.Please tell me how to correct it....so
    that detection is possible for any case
    import java.io.*;
    import java.awt.event.*;
    public class trial {
    int x;
    public static String s;
    //OutputStream f1=new FileOutputStream("file2.txt");
    public static void keyReleased(KeyEvent e)
    s=s+"a";
    public static void keyPressed(KeyEvent e)
    s=s+"c";
    public static void keyTyped(KeyEvent e)
    s=s+"p";
    public static void main(String args[])
    throws IOException
    char c;
    BufferedReader br =new BufferedReader(new
    InputStreamReader(System.in));
    System.out.println("Entercharactes,'q' to quit.");
    do
    c=(char)br.read();
    System.out.println(c);
    while(c!='q');
    // for(int i=0;i<s.length();++i)
    System.out.println(s);

    I suggest looking at the java tutorial. Your code completely misses the mark and you need to see examples.

  • View not copied or enhanced with wizard Error while creating Event Handler method in Z Component

    Hello Friends,
    In one Z Component (Custom Component), in one of the views, while creating event handler, it gave me error message that view not copied or enhanced with wizard.
    I am aware that in Standard Component, if we want to create the event handler method then we need to first Enhance the Component and then we need to enhance the view.
    But, in the Z Component (Custom Component), how to create event handler method in one of the views as while creating event handler method i am getting view not copied or enhanced with wizard error.

    Hi,
    Add a method in views impl class with naming convention eh_on__* with htmt and html_ex parameters.  I dont have have the system right now. Please check any existing event import export parameters.
    Check out do handle event method in the same class.
    Redefine that method.  Call that event method in this handle method. See existing code for reference.
    Attach that event to the button on click event in .htm page.
    Regards,
    Bhushan

  • How to load function from derived class from dll

    Dear all,
    how to access extra function from derived class.
    for Example
    //==========================MyIShape.h
    class CMyIShape
    public:
    CMyIShape(){};
    virtual ~CMyIShape(){};
    virtual void Fn_DrawMe(){};
    // =========== this is ShapRectangle.dll
    //==========================ShapRectangle .h
    #include "MyIShape.h"
    class DLL_API ShapRectangle :public CMyIShape
    public:
    ShapRectangle(){};
    virtual ~ShapRectangle(){};
    virtual void Fn_DrawMe(){/*something here */};
    virtual void Fn_ChangeMe(){/*something here */};
    __declspec (dllexport) CMyIShape* CreateShape()
    // call the constructor of the actual implementation
    CMyIShape * m_Obj = new ShapRectangle();
    // return the created function
    return m_Obj;
    // =========== this is ShapCircle .dll
    //==========================ShapCircle .h
    #include "MyIShape.h"
    class DLL_API ShapCircle :public CMyIShape
    public:
    ShapCircle(){};
    virtual ~ShapCircle(){};
    virtual void Fn_DrawMe(){/*something here */};
    virtual void Fn_GetRadious(){/*something here */};
    __declspec (dllexport) CMyIShape* CreateShape()
    // call the constructor of the actual implementation
    CMyIShape * m_Obj = new ShapCircle();
    // return the created function
    return m_Obj;
    in exe there is no include header of of ShapCircle and ShapRectangle 
    and from the exe i use LoadLibrary and GetProcAddress .
    typedef CMyIShape* (*CREATE_OBJECT) ();
    CMyIShape*xCls ;
    //===================== from ShapeCircle.Dll
    pReg=  (CREATE_OBJECT)GetProcAddress (hInst ,"CreateShape");
    xCls = pReg();
    now xCls give all access of base class. but how to get pointer of funciton Fn_GetRadious() or how to get access.
    thanks in advance.

    could you please tell me in detail. why so. or any reference for it. i love to read.
    i don't know this is bad way.. but how? i would like to know.
    I indicated in the second sentence. Classes can be implemented differently by different compilers. For example, the alignment of member variables may differ. Also there is the pitfall that a class may be allocated within the DLL but deallocated in the client
    code. But the allocation/deallocation algorithms may differ across different compilers, and certainly between DEBUG and RELEASE mode. This means that you must ensure that if the DLL is compiled in Visual Studio 2010 / Debug mode, that the client code is also
    compiled in Visual Studio 2010 / Debug mode. Otherwise your program will be subject to mysterious crashes.
    is there any other way to archive same goal?
    Of course. DLL functionality should be exposed as a set of functions that accept and return POD data types. "POD" means "plain-ole-data" such as long, wchar_t*, bool, etc. Don't pass pointers to classes. 
    Obviously classes can be implemented within the DLL but they should be kept completely contained within the DLL. You might, for example, expose a function to allocate a class internally to the DLL and another function that can be called by the client code
    to free the class. And of course you can define other functions that can be used by the client code to indirectly call the class's methods.
    and why i need to give header file of ShapCircle and shapRectangle class, even i am not using in exe too. i though it is enough to give only MyIShape.h so with this any one can make new object.
    Indeed you don't have to, if you only want to call the public properties and methods that are defined within MyIShape.h.

  • How to call derived class to base class

    Hello everybody,
    I create a GUi application in java swing. Now i want to navigate between the screen but the timing between the screen is very slow bcoz i imported the class from package to another package. Now i want to extends one package to another package to reduce the navigation time but it saying error bcoz i cant able to call my derived class to base class. if anyone know the answer for this please answer this immediately.
    If any other method is there to optimise the navigation time please tell me
    by
    (kamal)

    Sorry, I've got major difficulties understanding your query:
    I create a GUi application in java
    ication in java swing. ok
    Now i want to navigate between
    the screenwhat? switch screens? display a different dialog?
    but the timing between the screen is very
    slowtiming? do you mean the time it takes to display a different dialog?
    bcoz i imported the class from package to
    another package.how did you come to the conclusion that that is the reason for the slowness? Did you do any profiling or is this just guess-work?

  • Set fields of derived class in base class constructor via reflection?

    Does the Java Language Specification explicitly allow setting of fields of a derived class from within the base class' constructor via reflection? The following test case runs green, but I would really like to know if this Java code is compatible among different VM implementations.
    Many thanks for your feedback!
    Norman
    public class DerivedClassReflectionWorksInBaseClassConstructorTest extends TestCase {
    abstract static class A {
        A() {
            try {
                getClass().getDeclaredField("x").setInt(this, 42);
            } catch (Exception e) {
                throw new RuntimeException(e);
    static class B extends A {
        int x;
        B() {
        B(int x) {
            this.x = x;
    public void testThatItWorks() {
        assertEquals(42, new B().x);
        assertEquals(99, new B(99).x);
    }

    why not just put a method in the superclass that the subclasses can call to initialize the subclass member variable?In derived classes (which are plug-ins), clients can use a field annotation which provides some parameter metadata such as validators and the default value. The framework must set the default value of fields, before the class' initializer or constructors are called. If the framework would do this after derived class' initializer or constructors are called, they would be overwritten:
    Framework:
    public abstract class Operator {
        public abstract void initialize();
    }Plug-In:
    public class SomeOperator extends Operator {
        @Parameter(defaultValue="42", interval="[0,100)")
        double threshold;
        @Parameter(defaultValue="C", valueSet="A,B,C")
        String mode;
        public void setThreshold(double threshold) {this.threshold = threshold;}
        public void setMode(String mode) {this.mode = mode;}
        // called by the framework after default values have been set
        public void initialize() {
    }On the other hand, the default values and other metadata are also used to create GUIs and XML I/O for the derived operator class, without having it instantiated. So we cannot use the initial instance field values for that, because we don't have an instance.

  • Base class/Derived class

    Hi all,
    I have
    class Base {
    int a;
    class Derived{
    int b;
    now if i do
    Base X = new Base();
    Derived D = new Derived();
    It Doesn't allow me to do D=X
    But it does allow me to do X=D.
    whats the reason behind it. And what actually happens when i do X=D , does the copy constructor gets called ?
    Thanx

    Manthana wrote:
    Hi, u said
    the value of X becomes the reference to the instance of Derived that you created when you called "new Derived()".
    So now i can access attributes of derived class from the reference X right X.b
    But i cant do X.b
    Why?Please spell out words like "you". It makes things easier to read. :)
    With Derived extending Base, you could say:
    X = D;
    X.a = 5;Because the compiler and runtime see X as a reference to a Base object, you can only access variables/methods defined in Base. Since X is declared as being a reference to Base, you always know that 'a' is defined. 'b' wouldn't be defined for X if you said:
    X = new Base();
    X.b = 52;So, in order to access the b, you'd have to access it with something declared as a reference to Derived, such as 'D':
    D.b = 10;You could say:
    X = D; // Line 1
    Derived d2 = (Derived)X;
    d2.b = 10;But, then you'll get a ClassCastException if X is only referring to a Base object [e.g., if Line 1 was "X = new Base();"], not to a Derived object.

  • When is a def assigned to his constant value in a derived class ?

    Hi ,
    I encountered some strange thing in my app when using a def in a derived class from abstract base class. (dived by zero exception)
    I point it out here using a small code snippet which reflects the problem in my app:
    public abstract class Base{
        public var varBase;
    public class BaseDerived extends Base{
        def const = 1;
        var temp : Double;
        public override var varBase on replace{
            temp = varBase / const;
            println("{const}");
    function run(){
           var test = BaseDerived {varBase:10};
           println ("{test.temp}");
    result is:
    0
    InfinityI assumed that all "defs" will already be assigned before any single use in the code when creating an object. If I put the "def" in the base class all works fine. But apparently this is not case when implementing an abstract class and use a def in that class.
    What am I missing here ?
    thanks
    Guy

    I changed the code to:
    public mixin class Base {
        public var varBase;
        init { println("Base Init"); }
        postinit { println("Base PostInit"); }
    public class BaseDerived extends Base {
        def constant = 1;
        var temp: Double;
        init { println("BaseDerived Init"); }
        postinit { println("BaseDerived PostInit"); }
        public function showVar(msg: String) {
            println("# BaseDerived ({msg})");
            println("VarBase: {varBase}");
            println("Constant: {constant}");
            println("Temp: {temp}");
        public override var varBase on replace {
            showVar("Before computation");
            temp = varBase / constant;
            showVar("After computation");
    function run() {
        var test = BaseDerived { varBase: 10 };
        test.showVar("Created test");
    }The output of abstract class:
    # BaseDerived (Before computation)
    VarBase: 10.0
    Constant: 0 --> BAD
    Temp: 0.0
    # BaseDerived (After computation)
    VarBase: 10.0
    Constant: 0
    Temp: Infinity
    Base Init
    BaseDerived Init
    Base PostInit
    BaseDerived PostInit
    # BaseDerived (Created test)
    VarBase: 10.0
    Constant: 1
    Temp: Infinity --> NOK and replace not newly triggeredWhile the mixin base class indeed solves it:
    # BaseDerived (Before computation)
    VarBase: 10.0
    Constant: 1 --> constant here already been assigned
    Temp: 0.0
    # BaseDerived (After computation)
    VarBase: 10.0
    Constant: 1
    Temp: 10.0
    Base Init
    BaseDerived Init
    Base PostInit
    BaseDerived PostInit
    # BaseDerived (Created test)
    VarBase: 10.0
    Constant: 1
    Temp: 10.0 --> OKThanks for the quick goodies !
    I just need to read something on what "mixin" differs from abstract.
    cheers
    Guy

  • Can I work with a derived class from u0093ApplicationClassu0094

    Hello, I want to create a derived class from “ApplicationClass” for use in my Application, the problem is the function “SAPbouiCOM.SboGuiApi.GetApplication(-1)”, it return a COM object. If I do a specific cast to my own class (that derive from ApplicationClass), the metod give a COM exception and say that I can’t do a specific cast with a COM object.
    Can I do that cast? And How can I do it?
    I’m programming in C#.
    Thanks.

    I think that you can´t assign an object of the base class
    to an object of the derived class. I don´t know why you need to do that. With more information we could help you

  • Overloaded methods in a derived class

    Hello to everyone. I'm starting to learn java with the help of "Thinking in Java". I just want something to make it clearer for me.
    Suppose I have a base class with a method, and a derived class which overloads the method:
    class Base {
      void method() {
        System.out.println("Base method");
    class Derived extends Base {
      void method() {
        System.out.println("Derived method");
    }Now, in another class somewhere I create an instance of Derived:
    Derived dv = new Derived();
    dv.method();There is no way that I can access the method from the Base class, right? The only way I can do that is through
    class Derived extends Base {
      void method() {
        super();
        System.out.println("Derived method");
    }As I said, I'm almost sure that this is correct, I just want a confirmation.

    You can change the class
    class Derived extends Base {
      void method() {
        super.method();
        System.out.println("Derived method");
      // calls Base.method()
      void baseMethod() {
        super.method();
    }

  • Invoking Derived Class Method

    Hi pls go through the below code, can any one give me solution how to access the Derived class method in this Point.
    Note: In the below code , only in runtime we will come to know which Derived class method is going to invoke(So in runtime we will get Derived class name in the form of String). So Iam trying to Use Class.forName("Clas name") to create the instance of the Derived class and then type casting to base class.
    Why iam casting to base class is , since only in the run time we are geting the Derived class name.
    Result : iam geting the compiletime error says that no valid method fond in Mybase though it contains the reference of derived.
    abstract class MyBase
    public void display(int i)
    System.out.println(" Base class Method");
    class MyDerived extends MyBase
    public void display(String str)
    System.out.println("Derived class Mthode");
    class MyMain
    public static void main(String arg[])
    String DrivObj=arg[0];
    MyBase baseObj=(MyBase) Class.forName("DrivObj").newInstance();
    baseObj.display("SomeString"); }
    }

    The problem is, can not have subclass reference bcoz
    iam geting the subclass name only in the runtime and
    one more thing is cant touch my base and subclass to
    do changes as u said Your design is then definately very bad.
    , is there any other way to do
    it.Yes, you can use reflection to invoke the method.
    Kaj

  • Force Derived Class to Implement Static Method C#

    So the situation is like, I have few classes, all of which have a standard CRUD methods but static. I want to create a base class which will be inherited so that it can force to implement this CRUD methods. But the problem is, the CRUD methods are static. So
    I'm unable to create virtual methods with static (for obvious reasons). Is there anyway I can implement this without compromising on static.
    Also, the signature of these CRUD methods are similar.
    E.g. ClassA will have CRUD methods with these type of Signatures
    public static List<ClassA> Get()
    public static ClassA Get(int ID)
    public static bool Insert(ClassA objA)
    public static bool Update(int ID)
    public static bool Delete(int ID)
    ClassB will have CRUD signatures like
    public static List<ClassB> Get()
    public static ClassB Get(int ID)
    public static bool Insert(ClassB objB)
    public static bool Update(int ID)
    public static bool Delete(int ID)
    So I want to create a base class with exact similar signature, so that inherited derived methods will implement their own version.
    For E.g. BaseClass will have CRUD methods like
    public virtual static List<BaseClass> Get()
    public virtual static BaseClassGet(int ID)
    public virtual static bool Insert(BaseClass objBase)
    public virtual static bool Update(int ID)
    public virtual static bool Delete(int ID)
    But the problem is I can't use virtual and static due to it's ovbious logic which will fail and have no meaning.
    So is there any way out?
    Also, I have few common variables (constants) which I want to declare in that base class so that I don't need to declare them on each derived class. That's why i can't go with interface also.
    Anything that can be done with Abstract class?

    Hi,
    With static methods, this is absolutely useless.
    Instead, you could use the "Singleton" pattern which restrict a class to have only one instance at a time.
    To implement a class which has the singleton pattern principle, you make a sealed class with a private constructor, and the main instance which is to be accessed is a readonly static member.
    For example :
    sealed class Singleton
    //Some methods
    void Method1() { }
    int Method2() { return 5; }
    //The private constructor
    private Singleton() { }
    //And, most importantly, the only instance to be accessed
    private static readonly _instance = new Singleton();
    //The corresponding property for public access
    public static Instance { get { return _instance; } }
    And then you can access it this way :
    Singleton.Instance.Method1();
    Now, to have a "mold" for this, you could make an interface with the methods you want, and then implement it in a singleton class :
    interface ICRUD<BaseClass>
    List<BaseClass> GetList();
    BaseClass Get(int ID);
    bool Insert(BaseClass objB);
    bool Update(int ID);
    bool Delete(int ID);
    And then an example of singleton class :
    sealed class CRUDClassA : ICRUD<ClassA>
    public List<ClassA> GetList()
    //Make your own impl.
    throw new NotImplementedException();
    public ClassA Get(int ID)
    //Make your own impl.
    throw new NotImplementedException();
    public bool Insert(ClassA objA)
    //Make your own impl.
    throw new NotImplementedException();
    public bool Update(int ID)
    //Make your own impl.
    throw new NotImplementedException();
    public bool Delete(int ID)
    //Make your own impl.
    throw new NotImplementedException();
    private CRUDClassA() { }
    private static readonly _instance = new CRUDClassA();
    public static Instance { get { return _instance; } }
    That should solve your problem, I think...
    Philippe

Maybe you are looking for

  • How Do I create a Modular Function for use with Event Listeners

    OK I'm very new to AS3 and I'm curious as to how to get modular functions to work in AS3. for instance if I have this code: function snowfall(snowflake:MovieClip, movement:Number):void snowflake.y = movement; snowfall(snowflake1_mc, 10); snowfall(sno

  • Power Point + Premiere Elements 12

    Is it possible to import a power point presentation into Premiere Elements??

  • Copy Command across dblink

    Hi, i am wanting to copy a few columns from a table in db1 into a new table in db2. I can get this to work using the copy command in sql, but would like to recreate this in pl/sql. can the execute immediate create over the dblink?

  • Identify the email sent by mobile phones using Transport Agent?

    Hi, Is there a way using Exchange Transport SDK to identify whether an email is sent by mobile device or not? We have a business proposition, where we are going to build a transport agent based on this identification. Thanks in anticipation. Regards,

  • Send data via PI to a proxy inside the same PI system?

    Hi, I want to transfer data send to PI to several other applications and in addition to the same PI system. Therefor I thought PI proxy technology would be the best but. When I send the data to the PI proxy I will get an infinity loop. So I want to d