[CCC DEV] JNI - Native Calls to WinSparkle.dll
Dave Gilmore
gilmorenator at gmail.com
Wed Jul 14 15:39:30 BST 2010
On 14 July 2010 15:05, Matt Jadud <matt at jadud.com> wrote:
> Christian, are we able to call WinSparkle from an external app?
Calling an exe from java is pretty straight forward
> Instead of using JNI, can we just call an external, command-line-based
> C++ app that does the Sparkle work?
We would still get the sparkle UI if we chose this route
> That said, the native glue code is really just a C/C++ function that
> "looks right" to JNI (I suspect... again, haven't played with the Java
> Native Interface since forever). Your wrapper function then calls the
> same code you would call in your C++ app. So, really, the difference
> is minimal between these a small stand-alone app and the wrapper. (Put
> another way, your working C++ program is already, I suspect, 90% of
> the way to having a working JNI wrapper for WinSparkle.)
So just to explain what happens in the C++ world to get this working,
In my source file all I need to include the winsparkle header:
#include <winsparkle.h>
Because the compiler is Visual C++ then this is all I have to do the
compiler picks up the import library etc.
I can then use a resource file to setup the relevant metadata about
the application
To Initialize Winsparkle all I need to do is call the following two methods:
win_sparkle_set_appcast_url("url"); - The url can be set in the resource file
and
win_sparkle_init();
And it all just works - Very simple!
No wrappers etc required :)
Thanks,
Dave
More information about the developers
mailing list