HELP!!! why derived class's function  be called twice?

I am a newbie to java.
Recently I encounter a problem.
I run the below file,the output is:
output begin
B.f called !!!!
A.A called
B.f called !!!!
B.B called
output end-
My Question is :
why B's f() be called twice?
(In C++, A.f() will be called one time!)
class A
A()
f();
System.out.println("A.A called");
int f()
System.out.println("A.f called !!!");
return 123;
class B extends A
B()
f();          
System.out.println("B.B called");
int f()
System.out.println("B.f called !!!!");
return 456;
public class Demo
public static void main(String args[])
B bobj = new B();
-----------------------------------

Hi,jsalonen:
In the following code, variable i cann't be initialized properly.
    class A
         int i=0;
        A()
            f();
            System.out.println("A.A called");
            System.out.println("i="+i);
        int f()
            i=11;
            System.out.println("A.f called !!!");
            return 123;
    class B extends A
         int j;
        B()
            f();                  
            System.out.println("B.B called");
            System.out.println("j="+j);
            System.out.println("i="+i);
        int f()
            j=12;
            System.out.println("B.f called !!!!");
            return 456;
    public class Demo
        public static void main(String args[])
            B bobj = new B();
output begin
B.f called !!!!
A.A called
i=0 // BAD here
B.f called !!!!
B.B called
j=12
i=0 // BAD here
output end -
Although the question can be solved! I am still confused: why Java do this? when A's constructor call f(), B is still incomplete!!
Java is a good language,but I dislike it on this
Regards.
Sunway

Similar Messages

  • Why is the ActionForms validate-Method called twice?

    Hello forum,
    I'm new to struts and want to develop a form, where an internetuser can leave a comment to an article. Just like most sides, an image with an text is displayed, the text has to be written into an inputfield before the comment is commited in order to be saved.
    When an user puts in no text or a wrong one, a errormessage is displayed, the old image is deleted and an new one is created and shown to the user. His input still stays in the fields.
    I proof the correctness of the word in the validate-Method of the ActionForm and it works fine.
    Now I've the following problem:
    If the user puts in the correct text, the comment is saved and the side is displayed again including his comment.. But also all the input of the form should be erased. But for some reason, its not and the validate method is called again and since there is a new wordvarifyingimage and a new text to be inserted, it throws an error which is displayed again. Also, all the input of his last message is present!
    So, I guess I miss a big point about the ActionForm handling. Why is the ActionForm called twice and why doesn't it erase the old input? I try to do this in the Action class after saving the comment, setting all the formparameters to "" or null.
    Can anybody give me a hint?
    Would be a big big help since I've not found anything googling about this issue.
    If you need code, just tell me which part I put in here (ActionForm, Action, struts-config or jsp-file)
    Thanxs in advance,
    strutsnewbytopro

    my jsp:
    <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="struts/html-el" prefix="html" %>
    <%@ taglib uri="jstl/c" prefix="c" %>
    <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <style type="text/css" title="currentStyle" media="screen">
              @import "../library/css/blog.css";     
         </style>
    <script language="javascript">
         function sendMail(){
              document.forms[0].formaction.value ='mail';
              document.forms[0].submit();
         function saveComment(){
              document.forms[0].formaction.value ='comment';
              document.forms[0].submit();
         </script>
    </head>
    <body>
    <html:form action="/blog">
    <div id="container">
         <div id="leftside">
              <logic:messagesPresent>
                   <div id="errors">
                        <div style="color:#CC3333; ">
                        <p><span id="errorHeaders"><bean:message key="errors.validation.header"/></span>
                             <html:messages id="error">
                             <c:out value="${error}"/>
                             </html:messages>
                        </p></div>
                     </div>
              </logic:messagesPresent>
                 .... show blogentry ...          
              <logic:present name="comments">
                   <div id="divblogcomment">
                   <logic:iterate name="comments"  id="com">
                   <div class="breaker10" style="clear:left; "></div>
    <div class="rowblogcommentdate" style="width:150px;"<a href="<bean:write name="com" property="website" />"><bean:write name="com" property="username" /></a> am <bean:write name="com" property="postdate" /></div>
                   <div class="rowblogcomment"><bean:write name="com" property="comment" /></div>
                   </logic:iterate>
                   <div class="breaker10" style="clear:left; "></div>
    </div>
              </div>
                             </logic:present>
                             <logic:notPresent name="savedcomment">
                                  <div id="writeblogcomment">
                                  <div class="topbig"><div class="headsmall">enter Comment</div></div>
                                  <div id="bginhaltwriteblogcomment">
                                       <div class="breaker10" style="clear:left; "></div>
                                       <div align="center">
                                            <table cellpadding="0" cellspacing="0" border="0">
                                                 <tr>
                                                      <td>Name:</td>
                                                      <td>  </td>
                                                      <td><html:text size="50" name="blogForm2" styleClass="inputtext" property="username"/></td>
                                                      <td>  </td>
                                                      <td>Web:</td>
                                                      <td>  </td>
                                                      <td><html:text size="50" name="blogForm2" styleClass="inputtext" property="webaddress"/></td>
                                                 </tr>
                                                 <tr>
                                                      <td>Enter Code:</td>
                                                      <td>  </td>
                                                      <td><html:text size="66" name="blogForm2" styleClass="inputtext" property="commentword"/></td>
                                                      <td>  </td>
                                                      <td >Code:</td>
                                                      <td>  </td>
                                                      <td><img src="<bean:write name="entry" property="commentpicurl" />"></td>
                                                 </tr>
                                                  <tr>
                                                      <td colspan="7">Comment<br><html:textarea name="blogForm2" styleClass="comment" property="comment" /></td>
                                                 </tr>
                                                 <tr>
                                                      <td colspan="7"><html:submit styleClass="inputtext" onmousedown="javascript:saveComment();"><bean:message key="button.save"/></html:submit></td>
                                                 </tr>                                        
                                            </table>
                                       </p>
                                       </div>
                                       <div class="bottombig"></div>
                                  </div>
                             </div>
                             </logic:notPresent>
                             <logic:present name="savedcomment">
                             <div id="writeblogcomment">
                                  <div class="topbig">Comment saved<div class="headsmall">Kommentar gespeichert</div></div>
                                  <div id="bginhaltwriteblogcomment">
                                       <div class="breaker10" style="clear:left; "></div>
                                       <div align="center">
                                            <table cellpadding="0" cellspacing="0" border="0">
                                                 <tr>
                                                      <td>Comment saved</td>
                                                 </tr>
                                            </table>
                                       </p>
                                       </div>
                                       <div class="bottombig"></div>
                                  </div>
                             </div>
                             </logic:present>
                             </div>
    </div>
    <html:hidden name="blogForm2" property="formaction"/><br>
    <html:hidden name="blogForm2" property="id"/><br>
    <% session.removeAttribute("savedcomment"); %>
    </html:form>
    </body>
    </html>

  • Printing function gets called twice..!

    The following is my class that prints a string array which sometimes goes into multiple pages.. The code in which i create the multiple pages is below this class.. the problem is each time i append a new page to the book the print function in the class PaintC is called twice.. so if I write some additional code inside the print function to edit the strings .. it ends up running twice and the formatting i try to do gets messed up.. !! do you guys know why this is happening..? Please help.. ive been trying to find out since a very long time..!!
    The code in which i call this function is also shown below
    CLASS FOR PRINTING
    class PaintC
        implements Printable {
      String ad[];
      public PaintC(String ac[]) {
        System.out.println("Print Class Called 1");
        this.ad = ac;
      public int print(Graphics g, PageFormat pf, int pageIndex) throws
          PrinterException {
        System.out.println("Print Function Called 1");
        Graphics2D g2 = (Graphics2D) g;
        g.setFont(new java.awt.Font("Trebuchet MS", Font.PLAIN, 8));
        int xo = 60;
        int yo = 36;
        for (int y = 0; y < 76; y++) {
          try {
            g2.drawString(ad[y], xo, yo);
            yo += 9;
          catch (Exception r) {
            y = 76;
        return Printable.PAGE_EXISTS;
    CODE FOR CREATING MULTIPLE PAGES USING ABOVE CLASS
    void dotheprint() {
        PrinterJob printerJob = PrinterJob.getPrinterJob();
        PageFormat format = new PageFormat();
        Printable painter1;
        format = printerJob.defaultPage(format);
        Paper paper = format.getPaper();
        paper.setImageableArea(60, 36, 500, 756);
        format.setPaper(paper);
        // try storing in a string array each line
        Book bk = new Book();
        String ab = jTATRRep.getText();
        int i, j, lc = jTATRRep.getLineCount();
        String ac[] = new String[lc + 3];
        String ad[] = new String[78];
        ac = ab.split("\n");
        //System.out.println("Number of Lines = " + lc);
        //setting up pages as string arrays..
        // setting up first page
        //Assuming 76 lines per page
        for (i = 0; i < 76 && i < lc; i++) {
          try {
            ad[i] = ac;
    catch (Exception ex) {
    bk.append(new PaintC(ad), format);
    ad = null;
    // setting up second page if neccessary
    // //System.out.println("Number of Lines /76= "+lc/76);
    int pagec = lc / 76;
    int modul = lc % 76;
    int k;
    if (modul > 0) {
    pagec++;
    // //System.out.println("Number of pages : "+pagec);
    j = 76;
    while (pagec > 1) {
    ad = new String[76];
    k = 0;
    for (i = j; i < (lc - 1) && k < 76; i++) {
    // //System.out.println("ac[i]= "+ac[i]);
    ad[k] = ac[i];
    k++;
    bk.append(new PaintC(ad), format);
    ad = null;
    j += 76;
    pagec--;
    printerJob.setPageable(bk);
    boolean doPrint = printerJob.printDialog();
    if (doPrint) {
    try {
    System.out.println("Print Called 1");
    printerJob.print();
    System.out.println("Print Called 2");
    catch (PrinterException exception) {
    System.err.println("Printing error: " + exception);
    CODE IN WHICH THE PRINT FUNCTION IS CALLED
    void jBPrint_actionPerformed(ActionEvent e) {
        dotheprint();
    class ContactManager_jBPrint_actionAdapter
        implements java.awt.event.ActionListener {
      ContactManager adaptee;
      ContactManager_jBPrint_actionAdapter(ContactManager adaptee) {
        this.adaptee = adaptee;
      public void actionPerformed(ActionEvent e) {
        adaptee.jBPrint_actionPerformed(e);

    You might want to check out the [url http://forum.java.sun.com/thread.jsp?forum=57&thread=500687&tstart=0&trange=15]crosspost in the swing forum before spending your time answering this question.

  • HELP-Why won't this function return a value

    I want to get this XML data OUT of the function, but it just
    won't work. What I am doing wrong??? Tracing "xmlList" gives me the
    output i want IN the function, but if I can't get it OUT. If i set
    the function to "String", I still can't get the function to return
    a value or anyway to get this data OUT of the function. Please
    help.
    var xml:XML;
    var xmlList:XMLList;
    var xmlLoader:URLLoader = new URLLoader;
    xmlLoader.load(new URLRequest("data/imagesT.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    function xmlLoaded(event:Event):String
    xml = XML(event.target.data);
    xmlList = xml.children()[0].child(2);

    It won't though. Tracing xmlList outside (i.e. after it runs)
    the function produces null with the function set to void. Inside
    the function tracing producing the correct data.

  • JavaScript Function Calls it is called twice only when add the component

    Hi,
    I am developing a SAP Design Studio Extension and I noticed that when I add the component on Application, SAP Design Studio calls the JavaScript SDK Functions twice only when I drag and drop the component.
    I found out about this just put an alert message in which JavaScript Function (init, beforeUpdate and afterUpdate).
    Is it ok to work this way?
    I am really curious if anyone else has come across this issue.
    Thank you,
    Fabio Almeida

    Hi Fabio,
    Yes, there does appear to be an issue with SDK component functions being called twice.  Mike Howles has implemented a workaround in this Toolbar example code. Refer to the code in the this.init function at the end.
    Regards,
    Mustafa.

  • Osr calls from bpel are getting called twice in case of error

    Hi,
    I have a child process that does simple cancatenation of input and a string and reply back.
    I have deployed it and published its wsdl in OSR.
    I created another bpel process parent that will call the child process through OSR.
    When there is error in child process, the parent process is invoking the child process twice.
    oracle weblogic server version : 10.3.4
    OSR: 11.1.1.4
    soa suite: 11.1.1.4
    I'm not able to understand why the child process is getting called twice. Ideal scenario should be to raise an error and exit. Also if there are multiple calls like parent1 process have osr call to parent process and parent process have osr call to child process,repetition is happening in a 2x ratio.
    Please provide some solution for this.
    Thanks.

    Hi Vijay,
    Fault management is not implemented explicitly.
    Also, i do not observe this issue when there is no OSR i.e if I have direct wsdl call to child process other than OSR, this issue of repeating twice is not coming.
    Is there any configuration changes required in OSR?
    Thanks,
    Indu

  • 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.

  • Warning :: Derived class hides the base class virtual function

    We are porting from CC5.3 to CC5.8 compiler with Sun Studio one compiler. After plenty of hurdles we are in the final stage of removing the warning messages... Amoung the plenty the following one is very common and in different files. Why am I getting this error in 5.8 and not in 5.3 compiler....
    Warning: derived_Object::markRead Hides the virtual function base_Object::markRead(ut_SourceCodeLocation&) const in a virtual base
    From this it is easily understandable that the base class mark read was hidden by derived class markRead... when we drive and override the derived class function.... It is all over the place....
    Thank you,
    Saravanan Kannan
    //public: using xx_Object :: markRead;
    virtual void markRead() const;

    The Sun C++ FAQ discusses the warning message:
    http://developers.sun.com/prodtech/cc/documentation/ss11/mr/READMEs/c++_faq.html#Coding1
    Notice that warnings are not necessarily errors. But I applaud your desire to fix the code so that it generates no warnings. I wish more of our customers could be persuaded to do the same. :-)
    C++ 5.3 issues this warning, by the way. Example:
    struct B { virtual int foo(int); };
    struct D : B { virtual int foo(double); }; // line 2
    D d;
    line 2: Warning: D::foo hides the virtual function B::foo(int).
    If for your particular code you do not see a warning with C++ 5.3, it would be due to a bug in C++ 5.3 that was later fixed.

  • Why cannnot derived class pointer point to a base class object?

    Hi,
    Pleaseeee... explain me why cannot the derived class pointer point to a base class object.
    I know that Base class pointer can point to a derived class object.
    Thanks & Regards,
    Vig....

    Example:
    class Base
    { public: void foo(); } * pBase;
    class Derived : public Base
    { public: void bar(); } * pDerived;
    Now, what would happen if you assign pDerived = new Base() and then call pDerived->bar()?By forbidding such an assignment, compiler prevents you from writing error-prone code.

  • Calling a object of class from other class's function with in a package

    Hello Sir,
    I have a package.package have two classes.I want to use object of one class in function of another class of this same package.
    Like that:
    one.java
    package co;
    public class one
    private String aa="Vijay";  //something like
    }main.java:
    package co;
    import java.util.Stack;
    public class main extends Stack
    public void show(one obj)
    push(obj);
    public static void main(String args[])
    main oo=new main();
    }when I compile main class, Its not compile.
    Its give error.can not resolve symbol:
    symbol: class one
    location: class co.main
    public void show(one obj)
                              ^Please help How that compile "Calling a object of class from other class's function with in a package" beacuse I want to use this funda in an application

    kumar.vijaydahiya wrote:
    .It is set in environment variable.path=C:\bea\jdk141_02\bin;.,C:\oraclexe\app\oracle\product\10.2.0\server\bin;. command is:
    c:\Core\co\javac one.javaIts compiled already.
    c:\Core\co\javac main.javaBut it give error.
    Both java classes in co package.Okay, open a command prompt and execute these two commands:
    // to compile both classes:
    javac -cp c:\Core c:\Core\co\*.java
    // to run your main-class:
    java -cp c:\Core co.main

  • 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?

  • Can i call non -abstract method in abstract class into a derived class?

    Hi all,
    Is it possible in java to call a non-abstract method in a abstact class from a class derived from it or this is not possible in java.
    The following example will explain this Ques. in detail.
    abstract class A
    void amethod()
    System.out.println(" I am in Base Class");
    public class B extends A
    void amethod()
    System.out.println(" I am in Derived Class");
    public static void main (String args[])
    // How i code this part to call a method amathod() which will print "I am in Base Class
    }

    Ok, if you want to call a non-static method from a
    static method, then you have to provide an object. In
    this case it does not matter whether the method is in
    an abstract base class or whatever. You simply cannot
    (in any object oriented language, including C++ and
    JAVA) call a nonstatic method without providing an
    object, on which you will call the method.
    To my solution with reflection: It also only works,
    if you have an object. And: if you use
    getDeclaredMethod, then invoke should not call B's
    method, but A's. if you would use getMethod, then the
    Method object returned would reflect to B's method.
    The process of resolving overloaded methods is
    performed during the getMethod call, not during the
    invoke (at least AFAIK, please tell me, if I'm wrong).You are wrong....
    class A {
        public void dummy() {
             System.out.println("Dymmy in A");
    class B extends A {
         public void dummy() {
              System.out.println("Dymmy in B");
         public static void main(String[] args) throws Exception {
              A tmp = new B();
              Class clazz = A.class;
              Method method = clazz.getDeclaredMethod("dummy", null);
              method.invoke(tmp, null);
    }Prints:
    Dymmy in B
    /Kaj

  • Constructor of derived-class has to call constructor  of super-class?

    In java, constructor of derived-class has to call constructor of super-class? there is no way to omit this step?

    Correct. If you do not explicitly call the constructor, a call to the no-arg c'tor, super(), is automatically inserted.
    It would be a mess to have it any other way. You'd be creating objects that are not completely initialized. They'd be in an invalid state.
    Constructor rules:
    1) Every class has at least one ctor.
    1.1) If you do not define an explicit constructor for your class, the compiler provides a implicit constructor that takes no args and simply calls super().
    1.2) If you do define one or more explicit constructors, regardless of whether they take args, then the compiler no longer provides the implicit no-arg ctor. In this case, you must explicitly define a public MyClass() {...} if you want one.
    1.3) Constructors are not inherited.
    2) The first statement in the body of any ctor is either a call to a superclass ctor super(...) or a call to another ctor of this class this(...) 2.1) If you do not explicitly put a call to super(...) or this(...) as the first statement in a ctor that you define, then the compiler implicitly inserts a call to super's no-arg ctor super() as the first call. The implicitly called ctor is always super's no-arg ctor, regardless of whether the currently running ctor takes args.
    2.2) There is always exactly one call to either super(...) or this(...) in each constructor, and it is always the first call. You can't put in more than one, and if you put one in, the compiler's implicitly provided one is removed.

  • How to call class os functions defined in share/vm/runtime/os.hpp?

    HI. I haven't coded in C for some time, and no experience with JNI
    I dabbled a bit in JNI and creating native functions.
    I would like to know, how can I call Java VM os functions from my own libraries without much hassle? e.g. os::javaTimeMillis(), or os::active_processor_count() ?
    #include "HelloWorld.h"
    JNIEXPORT void JNICALL Java_HelloWorld_sayHi
      (JNIEnv *env, jclass clazz) {
      printf("Hello\n");
    long x = os::javaTimeMillis(); // HOW TO DO THAT?
    Including src/share/vm/runtime/os.hpp seems overkill with lot of dependencies?
    http://hg.openjdk.java.net/jdk8/jdk8/hotspot/file/87ee5ee27509/src/share/vm/runtime/os.hpp
    Could I create a custom header file copy-pasting parts from os.hpp to make some functions known?
    And I don't want to java-call the native java methods that mapped to these os functions, but call C functions directly.

    Two parts
    1. How do you write C code.
    2. How do you use JNI to interface between java and C code.
    1 is independent from 2 but 2 requires 1 because you can't do it if you don't know how to write C code.
    If you want to do JNI then you start by writing C code and debugging the C code.  No JNI at all in that process.
    After you complete that then you write wrappers around the C code which are JNI.
    JNI code tends to make Java unstable because bugs in JNI code will cause the VM to crash.  So it is often better to find an executable that does what one wants and then use Java Runtime.exec to manage that executable.  That is going to be true even if one is writing the executable (like in C.)
    To learn C you should start with a C site.

  • 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

Maybe you are looking for

  • Need advice on Office 2013 Corrupt Install

    A client of mine recently purchased, downloaded and installed MS Office 2013 Home and Business. The installation didn't work correctly from the first use. He opened Outlook the first time to have it crash repeatedly. As well as all the other correspo

  • Is there any way to decrease latency other than changing the I/O buffer

    Hello, I'm recording with two presonus firepods linked together. which allow for me to record up to 16 track at a time. I'm noticing some latency that makes it somewhat hard to record with. I do not want to lower the buffer for fear of intruducing di

  • Manage Portal data ?   best practice type thing

    Hello, I am looking how best do set up a Portal System on Production, in particular a good process to back-up and re-create an Portal systems. I list some possibilities below. Does anyone know if this is how it is typically done ? Does this cover all

  • Multiple  section in ALV

    Hi Guys, My exiting program displays an ALV in Grid form. One my requirement is to display an ALV grid with 3 different sections with seprate headers and data and subheadings for each. Is it possible?? If so how??... Please help.... Answers will be s

  • Getting the desired Output

    Hi ALl, I have a table as Listed below. SQL> CREATE  TABLE T1 (c1 varchar2(10),c2 varchar2(10),c3 varchar2(10), c4 var ar2(10),audit1 number); Table created. SQL> DESC T1 Name                                      Null?    Type C1