views:

143

answers:

1

I'm writing an app (C++ with VS20050 for Windows Mobile, which wraps the HTML Control (that is, I'm creating a DISPLAYCLASS window).

I want to be able to create a HTML page, and by using JavaScript on the page, cause a function in my app to be executed. Almost like JNI in Java.

What I have been doing is, on the page, executing the line

document.location.href="myapp:myfunc";

and my app looks for "myapp:" when my app receives NM_BEFORENAVIGATE from the control. This seems to work (emphasis on the word "seems.") Something that breaks as a result of this is that the javascript code on the page breaks at the point that I attempt to submit the form on the page.

I'd appreciate any advice.

Regards, Brian

A: 

Are you trying to call JS->Java ? If so, you can start with an ActiveXControl which can use JNI to call Java.

No, he states his app is written in C++, so JNI wouldn't work.
tomlog
Then JS->ActiveXControl->C/C++ Method without the JNI part. I have done this. We need to make sure that ActiveXControl's DLL refers to the C/C++ method DLL.I was even able to merge them into one DLL.