[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.pdt] Re: Calling c++ dll within my eclipse plugin

I think you meant the CDT (C/C++) newsgroup, not the PDT (php) newsgroup. Cross-posting this there.

oren barzilai wrote:
Hello,

I am trying to call a c++ function from dll within my eclipse plugin, and I am using jni to that (i don't know any other way to call c++ functions from java).
The code for invoking the c++ functions works on a regular java application but what I am trying to use that code within my plugin I get the following error message on the console:


#

# An unexpected error has been detected by Java Runtime Environment:

#

# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d892b63, pid=9900, tid=10632

#

# Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode)

# Problematic frame:

# V [jvm.dll+0xd2b63]

#

# An error report file with more information is saved as hs_err_pid9900.log

#

# If you would like to submit a bug report, please visit:

# http://java.sun.com/webapps/bugreport/crash.jsp

#

I have succeeded to bypass this problem in some cases by writing a class which implements "IWorkbenchWindowActionDelegate" and invoking my c++ function within the run(IAction) function in new thread.
however, it's not always possible to use "IWorkbenchWindowActionDelegate" because it's ment for gui events, I have also tried to create new thread not within "IWorkbenchWindowActionDelegate" and it doesn't work.
Is there another class similar to "IWorkbenchWindowActionDelegate" but for invoking within the code? or maybe some one know different solution ?


Thanks

Oren Barzilai