Results 1 to 1 of 1
- 12-24-2010, 07:52 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 5
- Rep Power
- 0
How can java call virtual method from C++?
Hi guys,
I have a C++ dll file, a C++ header file including all methods that I can use. But the methods from the header file are virtual, then how can I use it. I've tried many way, but unable to call virtual methods from my java program.
My header file is like this:
Java Code:class CManagerInterface { public: virtual int __stdcall Connect(LPCSTR server) =0; virtual int __stdcall Disconnect() =0; virtual int __stdcall IsConnected() =0; }
I use a tool named dllexp to view which methods the dll contains and I see that it doesn't contain any methods in the header file.
if I write my program in C++, I'd do something like this:
Everything works fine as I expected.Java Code:class CManager { ........ loadDLLfile(); CManagerInterface *manager; CManagerInterface* operator->() { return(manager); } }; int main(){ manager-Connect("myserver"); }
Now I wanna use the methods from the header file in my java program but I've found the way to do that.
I can load dll file, but then it says that it can't find the method.
What should I do?
Thx in advance.Last edited by hura; 12-24-2010 at 07:55 AM.
Similar Threads
-
call a JSP method
By sauravsinha in forum JavaServer Pages (JSP) and JSTLReplies: 4Last Post: 09-26-2011, 04:19 PM -
Call Java Method in MS SQL
By mexyz in forum New To JavaReplies: 19Last Post: 02-17-2010, 01:38 PM -
Call java method from jsp
By saiphani723 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 02-25-2009, 11:21 AM -
Call Java Method
By hussainzim in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 05-15-2008, 07:22 AM -
cannot call private method from static method
By jon80 in forum New To JavaReplies: 3Last Post: 05-07-2008, 08:37 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks