How to Call CDialog in JNI?
I make a very Simple Program to Call CDialog.
But when I run this Program, I got a error message!!!
Is it impossible? or where are examples?
I just want to call CDialog Box... plz help me
Thank you...
Here is the C++ code
JNIEXPORT void JNICALL
Java_kctcta_MainFrame_show3D(JNIEnv *env, jobject obj) {
CShow3D s3d = new CShow3D;
s3d.DoModal();
p.s. CShow3D is dialog based Class
Suggestion:
You should include in your post what the error message was. Without that information, it's hard to know what the problem is unless we've actually tried to do this ourselves.
Similar Messages
-
How to call Collection.add(E o) from JNI?
Hi.
JNI + Generics ???
I just managed it to call methods like MyClass.f(String a) but i cannot figure out how to call methods with generics in its signatures.
The signature string i used for the former method is: "(Ljava.lang.String;)V" and it works well but what is the corresponding signature string for Collection.add(E o)??
Thanks in advance.Hi,
I think it's a compiler problem here is a Generic class :
public class test<T> {
public void add(T o) {
System.err.println(o);
public static void main(String[] args) {
new test<Integer>().add(5);
}I compiled it with javac (1.5.0_05)
Then decompile it with jad
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
// Source File Name: test.java
import java.io.PrintStream;
public class test
public test()
public void add(Object obj)
System.err.println(obj);
public static void main(String args[])
(new test()).add(Integer.valueOf(5));
}As you can see T is now Object
--Marc (http://jnative.sf.net) -
How to call a C program in java PACKAGE
am trying to call a method implemented in C from java.
I followed the instructions of sun.java.com tutorial for the simple example of HelloWorld. It works fine.
BUT, when I try to do the same in a package, I run into a lot of trouble. I did the following :
1. Created HelloWorld.java in a package GUI/ and compiled it
package GUI;
import java.io.*;
class HelloWorld {
public native void displayHelloWorld();
static {
System.loadLibrary("hello");
// Call native method through this from other classes
public void callinghello() {
callip();
public static void main(String[] args) {
new HelloWorld().displayHelloWorld();
2. javah -jni HelloWorld -- to create HelloWorld.h
3. wrote HelloWorldImp.c
4. g++ -Wall -shared -I/usr/lib/j2sdk1.3/include -I/usr/lib/j2sdk1.3/include/linux HelloWorldImp.c -o libhello.so
-- compiled and created .so file
5. Set the package directory in Classpath, path and LD_LIBRARY_PATH
6. When it is run java GUI.HelloWorld
I get this error
Exception in thread "main" java.lang.NoClassDefFoundError: OrionGUI/HelloWorld
Can anyone help me. If you have any links to how to call native methods in package, please let me know. Thanks.GOT IT !!!
I had to change the name of the method in .h file generated by javah command. On doing
javac -d ../../classes HelloWorld.java
go to the ../../classes directory (where you have the class file) and do
javah HelloWorld
I got a HelloWorld.h file in which I had
JNIEXPORT void JNICALL Java_HelloWorld_display(JNIEnv *, jobject);
I added the package name too:
JNIEXPORT void JNICALL Java_GUI_HelloWorld_display(JNIEnv *, jobject);
The HelloWorldImp.c file should have the same name (ie with package) and be in the same directory(ie ../../classes)
compile and build the shared library to get "libhello.so" file
gcc -c -fPIC -I/usr/lib/j2sdk1.3/include -I/usr/lib/j2sdk1.3/include/linux HelloWorldImp.c
gives .o file
gcc -shared -o libhello.so HelloWorldImp.o
gives .so file
then run java with the command in my first message. It works.
Thanks for the reply "thedracle". -
How to call webservices function - java importer 6i -Duncan?
I've imported methods of a webservice from salcentral following instructions in otn.
Now I need to figure out how to call the resulting function in forms
Here is the function, the pl/sql error is wrong number or type of arguments
Anyone done this and know how to get the function signature correct?
I want to call checkemail
PACKAGE BODY MXCheckerStub IS
-- DO NOT EDIT THIS FILE - it is machine generated!
cls ORA_JAVA.JCLASS;
fid ORA_JAVA.JFIELD;
mid ORA_JAVA.JMETHOD;
args JNI.ARGLIST;
-- Constructor for signature ()V
FUNCTION new RETURN ORA_JAVA.JOBJECT IS
BEGIN
cls := JNI.GET_CLASS('mypackage/MXCheckerStub');
mid := JNI.GET_METHOD(FALSE, cls, '<init>', '()V');
args := NULL;
RETURN (JNI.NEW_OBJECT(cls, mid, args));
END;
-- Method: CheckEmail (Lorg/w3c/dom/Element;)Ljava/util/Vector;
FUNCTION CheckEmail(
obj ORA_JAVA.JOBJECT,
a0 ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
BEGIN
cls := JNI.GET_CLASS('mypackage/MXCheckerStub');
mid := JNI.GET_METHOD(FALSE, cls, 'CheckEmail', '(Lorg/w3c/dom/Element;)Ljava/util/Vector;');
args := JNI.CREATE_ARG_LIST(1);
JNI.ADD_OBJECT_ARG(args, a0, JNI.GET_CLASS('org/w3c/dom/Element'));
RETURN JNI.CALL_OBJECT_METHOD(obj, mid, args);
END;I would try to take an aproach where I'll generate a stub for the WSDL in JDeveloper, and also write a
Java class that calls this stub and return a simple variable (String, int, or boolean).
Then I would call this class from Forms.
I believe this would make it easier. -
How TO CALL c++ EXECUTABLE FROM XI(VERY iMPORTANT)
hI ALL
pLEASE DO GIVE SUGGESTIONS AND DOCCUMENTATION LINKS THAT <b>HOW TO CALL c++ EXECUTABLE FROM XI</b> .THIS IS VERY IMPORTANT AND YOUR HELP WILL BE REWARDED.
WITH REGARDS
SUBRATO KUNDUHi Subrato,
AFAIK you can call C / C++ methods in Java using Java Native Interface (JNI).
Please refer the following links for how to do the same.
<a href="http://www.nag.com/IndustryArticles/CallingCLibraryRoutinesfromJava.pdf">For C:</a>
<a href="http://www.javaworld.com/javaworld/javatips/jw-javatip17.html">For C++:</a>
Regards,
Ananth -
How to call java implementations from C language
How to call java implementations from C language....
I know using JNI java can call C code....is the converse also possible????
-RamsHow to call java implementations from C language....
I know using JNI java can call C code....is the
converse also possible????Yes. -
How to call java method having array as argument from c++ ?
Hello sir,
how to call java method having array as arguments from c++;
here is java code which is called from c++
class PQR {
public void xyz(int[] ia) {
System.out.println("hi");
for (int i = 0; i < ia.length; i++)
System.out.println(ia);
suppose all jvm invocation is done...For someone well versed in java, C++ and JNI although tedious that should be obvious.
For someone not well versed in all three it is going to be very difficult.
Even for someone that does have knowledge in all of those areas coming up with a C++ interface that reflects that functionality in a dynamic way such that anyone is will to use it is going to be quite an adventure.
At any rate to start building it you do exactly the same thing that you would in java.
1. Extract everything in the jar via the zip package
2. For each found instance extract all of the methods, return types, parameters, etc and build a description tree for each class.
Doing all of that in C++ is going to take a LOT of code. If someone wanted an estimate from me it would take me 6 months to do it. And before I would even attempt it I would get them to explain to me in detail exactly how they thought they were going to use it when I was done because I can't see any reasonable way to do that.
I left out the description tree itself. I suppose you could duplicate the entire reflection api in C++.
Now perhaps if it was much, much more constrained, like to only those classes that implement a single interface then that would be more reasonable. -
How to call a Derived call fucntion with a base class object ?
Hi all
i am working on a JNI interface to Java, and in the process of simulating a C++ behaviour in java
so i need some help form you people, in this regard.
here is a c++ code, i need a equivalent fucntionality in java , to put it one word, the question is
how to implement the dynamic_cast functionality in java, as java also has virtual fucntions, i think
this should be possible, if it is not, what is the alternative
class Base
public:
Base()
~Base()
virtual void F1()
cout<<"The BASE::F1() is called"<<endl;
virtual void F2()
cout<<"The BASE::F2() is called"<<endl;
class Derived : public Base
public:
Derived()
~Derived()
virtual void F3()
cout<<"The Derived::F3() is called"<<endl;
virtual void F4()
cout<<"The Derived::F4() is called"<<endl;
Base * GetDerived()
return new Derived();
int _tmain(int argc, _TCHAR* argv[])
Base *ptr = NULL;
ptr = GetDerived();
Derived *dPtr = dynamic_cast<Derived *>(ptr);
dPtr->F3();
}regards
pradishJust to clarify a point that I consider important--the distinction between references and objects:
Your subject is: How to call a Derived call fucntion with a base class object ? The answer to that is: You cannot. It is completely impossible in Java. If you have a base class object, the derivced class' methods are not present. On the other hand, if you have a compile-time reference of the parent type, but at runtime it happens to point to an instance of the derived class, then, as pointed out, you can cast the reference. (Note that casting does not apply to objects.) -
How to call a maintenance view from a program
Hello Abapers,
Can anybody explain with some examples. How to call a mainetenance view from a program.
Thanks
Ranjith.Use FM 'VIEW_MAINTENANCE_CALL'.
REPORT zmaintaintest.
VARIABLES / CONSTANTS
CONSTANTS:
c_action(1) TYPE c VALUE 'U', "Update
c_viewname TYPE tabname value 'ZEMP_EXAMPLE', "View Name
c_field(6) TYPE c VALUE 'EMPNO'. "Field Name
INTERNAL TABLES
DATA: itab_rangetab TYPE STANDARD TABLE OF vimsellist,
v_empno TYPE zempno,
wa_rangetab TYPE vimsellist.
SELECTION SCREEN
PARAMETERS: p_empno TYPE zempno OBLIGATORY. "Emplyee ID
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
Chcking the existence of the user in EMPLOYEE table
PERFORM validate_employee.
START_OF_SELECTION
START-OF-SELECTION.
This will restrict the user view so that user can only view/change
Table data corresponding to his/her Employee ID
PERFORM define_limited_data_area.
Displaying table maintenance view for a particular employee ID
PERFORM call_view_maintenance.
*& Form validate_employee
Validate plant entered in the selection screen
FORM validate_employee.
SELECT SINGLE empno u201CEmployee ID
FROM zemp_example u201CEmployee Table
INTO v_empno
WHERE empno = p_empno.
IF sy-subrc <> 0.
MESSAGE 'Not an Valid User' TYPE 'I'.
ENDIF.
ENDFORM. "validate_employee
*& Form DEFINE_LIMITED_DATA_AREA
To restrict the user view so that user can see/change table data
corresponding to his employee ID. Here one internal table is
getting populated with field name as u201CEMPNOu201D (Key field of the table)
And value as given by user in Selection Screen and this is passed as
Parameter in function module 'VIEW_MAINTENANCE_CALL'
FORM define_limited_data_area.
CLEAR wa_rangetab.
wa_rangetab-viewfield = c_field.
wa_rangetab-operator = 'EQ'.
wa_rangetab-value = p_empno.
APPEND wa_rangetab TO itab_rangetab.
ENDFORM. "define_limited_data_area
*& Form CALL_VIEW_MAINTENANCE.
Displaying table maintenance view for a particular employee ID
FORM call_view_maintenance.
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
action = c_action
view_name = c_viewname
TABLES
dba_sellist = itab_rangetab.
ENDFORM. "call_view_maintenance
Regards,
Joy. -
How to call Subroutines,Standard Text & using Internal Table in SmartForm
Hi all,
need help in the following areas.Its very urgent!
1.How to CAll Subroutines in Smart Forms
2.How to CAll Standard Text in Smart Forms
Situation:
We have an Internal Table T_SALES with all the data which am going to display in the smartform,How to retrive data from an internal table in Smart forms
Any Help in this direction would be highly appreciated.
Regards
RamuHi,
When you are using quantity or currency fields, you have to mentiong the reference fileds in a tab called CURRENCY/QUANTITY FILEDS in the GLOBAL DATA node.
Specifying a Currency or Quantity Reference
Use
In the ABAP Dictionary, you can assign a currency or quantity field to a table field. In the output of these fields, the system can then insert the relevant currency or unit:
· If the value field is in the same table as the corresponding currency or quantity field, the system recognizes the reference automatically, and formats the value field according to the currency or unit in the assigned field.
· If the value field is in a different table from the currency or quantity field, the system cannot recognize this reference automatically.
In the second case, you must indicate this reference to the system in the form, to ensure that the value field is formatted correctly.
Procedure
You want to assign a currency or quantity field in one table (for example, CURTAB) to a value field in another table (for example, VALTAB).
1. Create the reference to the currency field by entering the following values:
- Field Name: VALTAB-VALUE, if this is the value field of VALTAB that you want to display.
- Reference Field: CURTAB-CURRENCY, which is the currency field of CURTAB.
2. Under Data Type, specify whether the data type is a currency or quantity.
Result
In the output of the PDF-based print form, the system formats the value field VALTAB-VALUE according to the assigned value in the currency or quantity field of the global variable CURTAB-CURRENCY.
Thanks and Regards,
Bharat Kumar Reddy.V
Message was Added by: Bharat Reddy V
Message was Added by: Bharat Reddy V -
How to call SAP Webservice in standalone java program
Hi,
In our Java application, we want to use the SAP Webservices. I dont know much about authentication mechanism used by SAP. Can any one please help me with any sample code how to Call SAP webservice in Standalone Jave Program. I searched alot on the web regarding this, but helpless. Please help me.
Thanks,
MohanHi Mohan,
You need an account for the ES Workplace. I'm afraid this is not free, e.g. check [SAP NetWeaver, Composition Subscription|https://www.sdn.sap.com/irj/sdn/subscriptions/composition].
But I thought you wanted to play with a WSDL [you already had at hand|Sample code to access BAPI Web services from JAVA required;? -
How to call a servlet in new window without toolbar from OA page
How to call a servlet in new window without toolbar from a OA page?Please provide sample code
I have tried with the way suggested in Mukul's blog using javascript in Destination URI property.
I tried to open a OA Page and from which forwarded it to a servlet..
It is showing the error:
Error Page
Exception Details.
oracle.apps.fnd.framework.OAException: The application id or shortname () you entered does not exist.
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1223)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1969)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
at oa_html._OA._jspService(_OA.java:86)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
at oracle.jsp.JspServlet.service(JspServlet.java:148)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175)
at oa_html._OA._jspService(_OA.java:96)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
at oracle.jsp.JspServlet.service(JspServlet.java:148)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
at org.apache.jserv.JServConnection.run(JServConnection.java:294)
at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
oracle.apps.fnd.framework.OAException: The application id or shortname () you entered does not exist.
at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getAppId(OAWebBeanFactoryImpl.java:5391)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:969)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
at oa_html._OA._jspService(_OA.java:86)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
at oracle.jsp.JspServlet.service(JspServlet.java:148)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175)
at oa_html._OA._jspService(_OA.java:96)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
at oracle.jsp.JspServlet.service(JspServlet.java:148)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
at org.apache.jserv.JServConnection.run(JServConnection.java:294)
at java.lang.Thread.run(Thread.java:534)
oracle.apps.fnd.framework.OAException: The application id or shortname () you entered does not exist.
at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getAppId(OAWebBeanFactoryImpl.java:5391)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:969)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
at oa_html._OA._jspService(_OA.java:86)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
at oracle.jsp.JspServlet.service(JspServlet.java:148)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175)
at oa_html._OA._jspService(_OA.java:96)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
at oracle.jsp.JspServlet.service(JspServlet.java:148)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
at org.apache.jserv.JServConnection.run(JServConnection.java:294)
at java.lang.Thread.run(Thread.java:534) -
How to Call Procedure or Function
Hi,
How to call a procedure or function in apex, Please let me know
Thanks
SudhirHi,
This post might help
Re: How to Call procedure In Processes
Regards,
Jari -
How to call a method in one JSP from another JSP?
say that I have 2 JSPs.
JSP one has a button.
JSP two has some method that, say, find the square root of the number passed from JPS one.
How to - when click - the button on page one call the method on page two?
Please note that I can not use object binding, but I want passing the actual parameter and call the method on page two.
Please note that this is an update of a previous post on the same topic called "Object scope".
Thank you all very much.No, i dont know how to call other than main methods from other classes
And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add Watch)......... -
How to call a view from another
Hello Experts,
I have embedded a view (let us call this view 'A') in standard homepage. This works fine. Now on click of a button on this embedded view I want to launch another view that is also created by me, in the same component in which I had created view A. But I do not know how to launch this second view
Could you please tell me how to call/launch a view from another on click of a button?
Regards,
PraffulHello Prafful,
I guess by launching you mean substituting one view by another. It can be achieved by declaring a navigational link in the runtime repository from one view to another. You have to create an event handler on the button and outbound plug in your view using the wizard. Then, on the event handler you call an outbound plug where you trigger a navigation using this navigational link and the view A will be replaced by view B.
A code which needs to be done in outbound plug:
me->view_manager->navigate(
source_rep_view = me->rep_view
outbound_plug = 'NAVLINKNAME'
data_collection = iv_data_collection ).
Best Regards,
Yevgen
Maybe you are looking for
-
Hi, using what abap func can i open txt file (i have its full path)? clarification: i want the Notepad to popup at user screen. Regards Uri
-
Error while creating user session from the DataProvider
hi I am getting a strange error oracle.express.idl.util.OlapiException: java.sql.SQLException: ORA-37158: Bad clob or varray IN-args: (case 6) ORA-06512: at "SYS.GENSERVERINTERFACE", line 2 ORA-06512: at line 1 at oracle.express.idl.ExpressConne
-
IE8 will not display web content like other browsers....Help!
Hello Everyone: I designed webpages in DW5. The pages view nicely in every browser (Firefox, Chrome, Safari) with the exception of INTERNET EXPLORER 8. That browser will display nothing but the page background image and no other content. I'm tired of
-
I just started taking a class in Flash CS4 and I have a basic program that I'm suppose to develop for my first project. My problem is that I'm not good at programming yet so I was wondering if anyone is able to help me out. Here is what I'm suppose t
-
Okay, I have a Mac Pro (two years old) with a 23" Apple Display. I have been thinking of connecting my old 17" Apple LCD Display in as a second monitor. I know I need to get a DVI to ADC adapter to work on the NVIDIA GeForce 7300 GT I have. So, my qu