How to re-establish a C++ object through a loop of C++/Java/C++ ?

Hi, there:
My problem is a bit awkward. My application has two JNI components,
handling different aspects of low level computation. Each of the JNI
wraps up a C++ library with the java version APIs. The java code
calls one JNI to establish an object corresponding to a C++ class.
Then after some manipulation, I need to go back to C/C++ level to
use this object to do more low level work using the second JNI.
How can I put the jobject back to a C++ object, so that I can call
the C++ APIs of the first C++ library directly from my second JNI
and avoid go through the wrapped java APIs?
Hopefully, I didn't ask something obvious. Thanks.
Ligg

I wouldn't know about using JVM data copying operations to solve this problem. Because of my ignorance, it sounds just plain scary.
However:
o You are calling your first dll from java. That tells me that you have somehow defined a subroutine with C linkage. That subroutine ought to be able to grab the C++ object in question, and store the address in a globally-defined pointer.
o It sounds like the second dll knows about the C++ object definition from the first dll. (Otherwise it would make no sense trying to pass to it an object of the sort you mention.) So it sounds like the second dll ought to be able to declare that an external pointer exists to this desireable C++ object, and the loadLibrary call on the second dll ought to fill in the appropriate linkage for you - resolving the addresses.
I say "ought to". I haven't tried this, although in C I have certainly used external linkages before and let loaders do the fixup.

Similar Messages

  • How do you reference a Formular Object on a Crystal Report using Java

    Hi all,
    I am trying to reference an object on my report which contains a Formula field.
    I have read the following 2 threads, but they refer to textObjects:
    [How do you reference a textObject on a Crystal report using Java|Re: How do you reference a textObject on a Crystal report using Java?]
    [Changing the text of ITextObject programatically|Re: Changing the text of ITextObject programatically]
    But I cannot even get those to work. I can reference a object which refers to a database field but as soon as I try
    reference a textObject or reportObject I just get a NULL variable.
    Below is the code I am useing
    IReportObject dbField = reportClientDocument.getReportDefController().findObjectByName("BOB1");
    IReportObject textBob = reportClientDocument.getReportDefController().findObjectByName("BOB2");
    "BOB1" is the name of my DB field Object, and "BOB2" can be a Text box or a Formula item and I just get nothing.
    I have just tested it with a FieldHeadingObject and that returns a valid object, so clearly I am going about this the wrong way
    for objects I place on the reports which are not driven by the database items.
    Ultimately what I want to do is reference an object in the Report Footer which will contain the RecordCount of the number of
    records contained in the report, which I am them going to use to determine if the report holds data,
    if it does I will print it, else ignore it and move on the the next report. I am doing this so that I can at an extra filter to split
    a report up into groups and produce a sinlge PDF for each group instead of one massive PDF containing all the groups.
    So if someone has a solution to any of my problems I would be very greatful, and I dont mind being told Im an idiot and should
    rather do it another way, as long as you supply that other way
    Thanks for the help
    Darren
    Edited by: Darren Jackson on Dec 16, 2009 7:29 PM
    Forgot to add am using CR4Ev2 SP3

    Right I have made some headway.
    Firstly, Im an idiot. I was making changes and setting up test fields on my report, but then when running the app, I had it looking at
    the backup report, which would explain why all the new textbox fields were not being found.
    The stupiditity did force me to delve deep and work out a fair bit of how the reports work, so cant complain too much. BUT, I am still
    not able to return values of Formula fields and formulas extra. Could someone tell me if this is even possible. I get retrieve the formula field
    name, and properties but not its value once the report has been populated. Am I wasting my time?
    Well I will continue dismantling my reports till I find the answer, or someone points me in the right direction.
    If any one is interested this is the code I used to drill down to my text boxes:
    IReportObject recCount = reportClientDocument.getReportDefController().findObjectByName("TB1");
    ITextObject obj_RecCount = (ITextObject) recCount;
    System.out.println(obj_RecCount.getName());
    Paragraphs objP = obj_RecCount.getParagraphs();
    for (int i = 0; i < objP.size(); i++){
         ParagraphElements pE = objP.getParagraph(i).getParagraphElements();
         for (int j = 0;j < pE.size(); j++){
              IParagraphTextElement pEE = (ParagraphTextElement) pE.getParagraphElement(j);
              System.out.println(pEE.getText());
    Cheers

  • How can i reference a MIME object within a correspondence format through...

    how can i reference a MIME object within a correspondence format through TX oofo or se71?
    Hi, I need to put a MIME object within a correspondence's format that i've already done through Tx oofo. My problem is, that i don't know exactly how can i make the reference of that MIME object in the format? and What structure type do i have to use in order to make appear the MIME object in my correspondence's format? Does anybody can help me with this?   
    Regards    Hector

    Frank,
    I tried to find some examples/samples on how to create CollectionModel for a table component but not successful.
    Can you clarify the following ?
    1. "CollectionModel" is referenced only by af:table attributes "value", "selectedRowKeys" and "selectionListener".
    The rest of af:table attributes such as "rows", "fetchSize" used to reference the iterator binding in the binding container via the EL expression "#{bindings.VOIteratorBinding.xxx} .
    What should I replace that EL expression with?
    2. I heck out the bean method to create the CollectionModel as following, is it close to what you mean?
    public void initBusinessDataDashboardView() {
    OperationBinding operation = BeanUtils.getOperationBinding("getPanelBusinessData");
    Map params = operation.getParamsMap();
    Key panelKey = getPanelInfoView().getKey();
    params.put("panelKey", panelKey);
    params.put("maximizedView", false);
    panelView = (ViewObject)operation.execute();
    // Heck code to create CollectionModel
    RowSet rowSet = panelView.getRowSet();
    ArrayList rowList = new ArrayList();
    while (rowSet.hasNext()) {
    rowList.add(rowSet.next());
    model = new ChildPropertyTreeModel(rowList, null);
    // To be used to set up af:table value, selectRowKeys, selectionListener via EL expr #{backingBeanScope.MyBean.model.xxx}
    public CollectionModel getModel() {
    return model;
    Am I on the right track?
    Edited by: Pricilla on May 4, 2010 2:20 PM

  • How to send data to bam data object through java code

    how to send data to bam data object through java code

    I've made a suggestion in other thread: https://forums.oracle.com/thread/2560276
    You can invoke BAM Webservices (Using Oracle BAM Web Services) or use JMS integration using Enterprise Message Sources (http://docs.oracle.com/cd/E17904_01/integration.1111/e10224/bam_ent_msg_sources.htm)
    Regards
    Luis Fernando Heckler

  • How to create object through  transaction snro

    Hi ,
       I want to create an object through Snro transaction.
    I dont know how to use this transaction.
    Please Help.
    Thanks in advance.
    Nikita

    Nikita,
    Based on the transaction code, respective function consultant will create number range.
    If u want a number series for some other purpose in ur program u can create object in snro as below.
    1. Enter a object name and click 'CREATE' button
    2. In the next screen give relevant description
    3. In 'Number length domain' field u can specify the length of number .. example if u give char10, then it will be a ten digit number series.
    4.Enter warning percentage.. the purpose is to throw warning message 10 % before when ur number series about to exhaust.
    5. After entering those details --> press save button.
    6. Again come to main screen (SNRO initial screen) then click number raneg tab inthe application tool bar.it will take u to next screen.
    7. In that click internal change push button
    8. IN the resulting screen enter ur number range series,
    example
    01     00000001     09999999
    02     10000000     19999999 etc
    9. click save button..NOw ur number series is ready for use.
    Regards,
    Aswin.

  • How to access the LOB objects through databaselinks?

    How to access the LOB objects through databaselinks?

    Abhii wrote:
    How to access the LOB objects through databaselinks?You can refer to this link
    http://dbaforums.org/oracle/index.php?showtopic=4790
    I've found it by simple google-ing...
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • How to access the LOB objects through database links??????????????

    How to access the LOB objects through database links??????????????

    Hi
    See:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:52297289480186
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5322964030684
    And you also might want to get a new keyboard, your '?' seems to be stucked....

  • How to organize the context object through out the application process

    Hi,
    Here in my application is using the following steps for a process.
    - Login
    - Search
    - Update
    - Logout
    In those above steps, Login, Search, and Update actions are touching to database/LDAP every time. In each time, Im creating new Context object, I think this is a bad approach. When I hit the login, I need to get the connection object and use that for rest of the actions(search and update).
    So can we organize the single context object through out the application? And where do we need to close the Context object?

    Don't worry about it. The provider will reuse connections behind the scenes. They're not tied directly to Contexts.

  • How To Load a Project Budget Line Through API in R12 ?

    Hello
    Could you please let me know how to load the project budget lines through API in R12 system, I am trying with below script but it is not working.
    Could you please let me know if you have any solution.
    =========================================================================================================================================================================
    Script
    DECLARE
    --––variables needed for API standard parameters
       l_api_version_number     NUMBER                                 := 1.0;
       l_commit                 VARCHAR2 (1)                           := 'T';
       l_return_status          VARCHAR2 (1);
       l_init_msg_list          VARCHAR2 (1);
       l_msg_count              NUMBER;
       l_msg_data               VARCHAR2 (2000);
       l_data                   VARCHAR2 (2000);
       l_msg_entity             VARCHAR2 (100);
       l_msg_entity_index       NUMBER;
       l_msg_index              NUMBER;
       l_msg_index_out          NUMBER;
       l_encoded                VARCHAR2 (1);
       i                        NUMBER;
       a                        NUMBER;
    --––variables needed for Oracle Project specific parameters
       l_pm_product_code        VARCHAR2 (100);
       l_pa_project_id          NUMBER;
       l_pm_project_reference   VARCHAR2 (100);
       l_budget_type_code       VARCHAR2 (30);
       l_change_reason_code     VARCHAR2 (30);
       l_description            VARCHAR2 (255);
       l_entry_method_code      VARCHAR2 (30);
       l_resource_list_name     VARCHAR2 (60);
       l_resource_list_id       NUMBER;
       l_budget_lines_in        pa_budget_pub.budget_line_in_tbl_type;
       l_budget_lines_in_rec    pa_budget_pub.budget_line_in_rec_type;
       l_budget_lines_out       pa_budget_pub.budget_line_out_tbl_type;
       l_line_index             NUMBER;
       l_line_return_status     VARCHAR2 (1);
       l_user_id                NUMBER;
       l_responsibility_id      NUMBER;
       API_ERROR                EXCEPTION;
    BEGIN
       -- SET GLOBAL INFO
       SELECT user_id,
              responsibility_id
         INTO l_user_id,
              l_responsibility_id
         FROM pa_user_resp_v
        WHERE user_name = 'RAJU';
       PA_INTERFACE_UTILS_PUB.SET_GLOBAL_INFO (p_api_version_number      => 1.0,
    p_responsibility_id       => l_responsibility_id,
    p_user_id                 => l_user_id,
                                               p_msg_count               => l_msg_count,
    p_msg_data                => l_msg_data,
    p_return_status           => l_return_status
       IF l_return_status != 'S'
       THEN
          RAISE API_ERROR;
       END IF;
    --––PRODUCT RELATED DATA
       l_pm_product_code        := 'GMS';
    --––BUDGET DATA
       l_pa_project_id          := 6271;
       l_pm_project_reference   := NULL;--'ABC';
       l_budget_type_code       := 'FC';
       -- l_change_reason_code := 'INITIAL';
       l_description            := 'New description –> 2';
       l_entry_method_code      := 'PA_TASKLVL_BASELINE';
       l_resource_list_id       := 1001;
    --––BUDGET LINES DATA
       a                := 1;
       FOR i IN 1 .. a
       LOOP
          l_budget_lines_in_rec.pa_task_id := 405156;
          l_budget_lines_in_rec.pm_task_reference       := NULL;
          l_budget_lines_in_rec.resource_alias          := 'Labor';
          l_budget_lines_in_rec.resource_list_member_id := '1034';
          -- l_budget_lines_in_rec.budget_start_date        := '01-Jan-13';
          -- l_budget_lines_in_rec.budget_end_date          := '31-Dec-14';
          -- l_budget_lines_in_rec.period_name          := 'JUL-10FY2011';
          l_budget_lines_in_rec.description             := 'Some Text';
          l_budget_lines_in_rec.quantity := 100.00;
          l_budget_lines_in_rec.raw_cost := 300.00;
          l_budget_lines_in (i)                         := l_budget_lines_in_rec;
       END LOOP;
    --––INIT_BUDGET
       pa_budget_pub.init_budget;
    --––LOAD_BUDGET_LINE
       FOR i IN 1 .. a
       LOOP
          pa_budget_pub.load_budget_line
                            (p_api_version_number           => l_api_version_number,
    p_return_status                => l_return_status,
                             p_pa_task_id                   => l_budget_lines_in (i).pa_task_id,
    p_pm_task_reference            => l_budget_lines_in (i).pm_task_reference,
    p_resource_alias               => l_budget_lines_in (i).resource_alias,
    p_resource_list_member_id      => l_budget_lines_in (i).resource_list_member_id,
    p_budget_start_date            => l_budget_lines_in (i).budget_start_date,
                             p_budget_end_date              => l_budget_lines_in (i).budget_end_date,
    p_period_name                  => l_budget_lines_in (i).period_name,
    p_description                  => l_budget_lines_in (i).description,
                             p_raw_cost                     => l_budget_lines_in (i).raw_cost,
    p_burdened_cost                => l_budget_lines_in (i).burdened_cost,
    p_revenue                      => l_budget_lines_in (i).revenue,
    p_quantity                     => l_budget_lines_in (i).quantity
       END LOOP;
       IF l_return_status != 'S'
       THEN
          RAISE api_error;
       END IF;
    --––EXECUTE_CREATE_DRAFT_BUDGET
        pa_budget_pub.execute_create_draft_budget (p_api_version_number        => l_api_version_number,
    p_msg_count                 => l_msg_count,
    p_msg_data                  => l_msg_data,
    p_return_status             => l_return_status,
    p_pm_product_code           => l_pm_product_code,
                                                  p_pa_project_id             => l_pa_project_id,
    p_pm_project_reference      => l_pm_project_reference,
    p_budget_type_code          => l_budget_type_code,
    p_change_reason_code        => l_change_reason_code,
    p_description               => l_description,
                                                  p_entry_method_code         => l_entry_method_code,
    p_resource_list_name        => l_resource_list_name,
    p_resource_list_id          => l_resource_list_id
       IF l_return_status != 'S'
       THEN
          NULL; --––RAISE API_ERROR;
       END IF;
    --––FETCH_LINE
       FOR l_line_index IN 1 .. pa_budget_pub.g_budget_lines_tbl_count
       LOOP
          pa_budget_pub.fetch_budget_line (p_api_version_number      => l_api_version_number,
    p_return_status           => l_return_status,
    p_line_index              => l_line_index,
    p_line_return_status      => l_line_return_status
          IF l_return_status != 'S' OR l_line_return_status != 'S'
          THEN
             RAISE api_error;
          END IF;
       END LOOP;
    --––CLEAR_BUDGET
       pa_budget_pub.clear_budget;
       IF l_return_status != 'S'
       THEN
          RAISE api_error;
       END IF;
    --––HANDLE EXCEPTIONS
    EXCEPTION
       WHEN api_error
       THEN
          FOR i IN 1 .. l_msg_count
          LOOP
             pa_interface_utils_pub.get_messages (p_msg_data           => l_msg_data,
    p_data               => l_data,
    p_msg_count          => l_msg_count,
    p_msg_index_out      => l_msg_index_out
             DBMS_OUTPUT.put_line ('Error Mesg ' || l_data);
             DBMS_OUTPUT.put_line ('Error Mesg ' || l_msg_data);
          END LOOP;
       WHEN OTHERS
       THEN
          FOR i IN 1 .. l_msg_count
          LOOP
             pa_interface_utils_pub.get_messages (p_msg_data           => l_msg_data,
    p_data               => l_data,
                                                  p_msg_count          => l_msg_count,
    p_msg_index_out      => l_msg_index_out
             DBMS_OUTPUT.put_line ('error mesg ' || l_data);
          END LOOP;
    END;
    =========================================================================================================================================================================

    Not knowing how its embedded...  you will need to get the report instance from the dll and cast it as a ReportDocument object.
    Given the info so far, that is all we can say.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to send SMARTFORMS output as attachment through?

    how to send SMARTFORMS output as attachment through e-mail?
    after executing SMARTFORMS how to send that output via e-mail.
    Help me.
    thanks
    surya.
    Moderator Message: Please search for available information first
    Edited by: kishan P on Nov 7, 2010 7:19 PM

    hi Vinod,
    Can you please tell me how you have zipped the file.
    I am having a text file in application server. I need to zip that file. Then the middleware moves it to Legacy system.
    I used the following code. With this I am having the data in Binary format which my midleware cannot understand.
    What I need on the whole is just to reduce the size of the file.
    form ZIP_FILE .
    DATA: lt_data TYPE TABLE OF x255,
          lt_textdata TYPE TABLE OF x255.
    DATA: ls_data LIKE LINE OF lt_data.
    DATA: lv_dsn1(100) VALUE '/ECD/120/GIS/FTP/IB/DNBPAYDEX.TXT'.
    DATA: lv_dsn3(100) VALUE '/ECD/120/GIS/FTP/IB/DNBPAYDEXZIP.zip'.
    *DATA: lv_dsn3(100) VALUE '/interfaces/SM5/test.zip'. " Contains sample1.xls and sample2.xls
    DATA: lv_file_length TYPE i.
    DATA: lv_content TYPE xstring.
    DATA: lo_zip TYPE REF TO cl_abap_zip.
    CREATE OBJECT lo_zip.
    Read the data as a string
    clear lv_content .
    OPEN DATASET lv_dsn1 FOR INPUT IN BINARY MODE.
    READ DATASET lv_dsn1 INTO lv_content .
    CLOSE DATASET lv_dsn1.
    lo_zip->add( name = 'sample.TXT' content = lv_content ).
    lv_content = lo_zip->save( ).
    *clear lv_content .
    Conver the xstring content to binary
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
    buffer = lv_content
    IMPORTING
    output_length = lv_file_length
    TABLES
    binary_tab = lt_data.
    OPEN DATASET lv_dsn3 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    LOOP AT lt_textdata INTO ls_data.
    TRANSFER ls_data TO lv_dsn3.
    ENDLOOP.
    CLOSE DATASET lv_dsn3.
    IF sy-subrc EQ '0'.
        MESSAGE s999(zfi_ap_gl) WITH text-t10.
      ENDIF.
    Can you please help.
    Thanks Aravind

  • How to list an array of objects using struts in jsp and ActionForm

    I am using the struts ActionForm and need to know how to display an Array of objects. I am assuming it would look like this in the ActionForm:
    private AddRmvParts addRmv[];
    But I am not sure how the getter and setter in the ActionForm should look. Should it be a Collection or an Iterator?
    I am thinking I need to use an iterator in the jsp page to display it.
    I am also wondering if the AddRmvParts class I have can be the same class that gets populated by the retrieval of data from the database. This class has 10 fields that need to display on the jsp page in 1 row and then multiple rows of these 10 fields.
    Thanks.

    Most probably the easiest way to make it accessible in your page is as a collection.
    ie
    public Collection getAddRmvParts()
    You can use the <logic:iterate> or a <c:forEach>(JSTL) tag to loop through the collection
    As long as the individual items in the collection provide get/set methods you can access them with the dot syntax:
    Example using JSTL:
    <c:forEach var="addRmvPart" items="${addRmvParts}">
      <c:out value="${addRmvPart.id} ${addRmvPart.name} ${addRmvPart.description}"/>
    </c:forEach>

  • Objects through servlet

    How to pass the object through servlet?

    I can venture a guess that the OP wants to 'send' an object as a request parameter or a form field.
    You'd have to turn the object into some data representation that can later on be translated back into the object; serialization comes to mind. It might be easier to just send the properties of the object as seperate request/form fields though!

  • Hi friends, How to send any data (even binary) through XI, without using

    1) How to send any data (even binary) through XI, without using the Integration Repository .?

    hi ganga,
    Yes; 
    1. we can test adapters very easily and quickly without any IR development.
    2. we can send any formatted data without having to convert it to XML and back again, e.g. file->XI->file.
    3. we can send any document from 1 sender to multiple receivers using XI to guarantee delivery.
    /people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
    the process integration layer of the NetWeaver  define/reuse interface objects for the SAP Integration Repository. These objects include Business Scenarios, Business Processes, Message Interfaces, Message Types, Data Types, Message Mappings, and Interface Mappings. The application developer refers to these objects in defining the interactive flow between applications for the SAP Integration Directory.
    regards,
    nikhil

  • How can we establish an integration between OM,Rec and PA

    Hi Guys
    Could you please let me know
    How we can  establish an integration between
    Oraganizationla module ,recruitment and Personnel adminstration?
    Thanks in advance

    u can see the integration values in table V_T77SO
    u can see it through SM 30
    and the values for OM and PA are PLOGI ORGA make the value as X
    Edited by: Sikindar on Feb 4, 2008 8:25 AM
    Edited by: Sikindar on Feb 4, 2008 9:41 AM

  • Transport of PCD and Content objects through JDI.

    Hi all,
    Pls share the views about the trasport procedure for PCD and Content objects.
    Is it possible to transport PCD and Content objects through JDI?
    If it is possible, could you pls share how to configure the JDI setup?
    Thanks in advance,
    Kishore.

    Hi Kishroe,
    First, there is no supported, out of the box way to handle content objects in the JDI (now NWDI- NetWeaver Development Infrastructure) With that said, since it is a repository you could export your content package. Make it a zip file or something like that and add it to the repository.
    Again, I believe this is theoretically possible. I'm sure some of the other SDN members can provide an automated approach to do this.
    Good luck,
    John

Maybe you are looking for