Click here to Skip to main content
15,921,990 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMFC App needs to call routine from a DLL made using JNI -- Urgent Pin
a1prashant@yahoo.com23-Mar-06 16:54
a1prashant@yahoo.com23-Mar-06 16:54 
QuestionRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
Nibu babu thomas23-Mar-06 18:30
Nibu babu thomas23-Mar-06 18:30 
AnswerRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
a1prashant@yahoo.com23-Mar-06 19:24
a1prashant@yahoo.com23-Mar-06 19:24 
GeneralRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
Nibu babu thomas23-Mar-06 19:34
Nibu babu thomas23-Mar-06 19:34 
GeneralRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
a1prashant@yahoo.com24-Mar-06 0:30
a1prashant@yahoo.com24-Mar-06 0:30 
QuestionRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
Nibu babu thomas24-Mar-06 0:41
Nibu babu thomas24-Mar-06 0:41 
GeneralRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
Nibu babu thomas23-Mar-06 19:39
Nibu babu thomas23-Mar-06 19:39 
GeneralRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
a1prashant@yahoo.com24-Mar-06 1:14
a1prashant@yahoo.com24-Mar-06 1:14 
I included the jni.h and jni_md.h files.
However I wonder if following is okay?
The JVM passes JNIEnv and jobjects to the DLL.
Don't know how JVM treats these two parameters before passing. Frown | :(

hInst = ::LoadLibrary("D:\\win_dll.dll");<br />
if( hInst )<br />
{<br />
AfxMessageBox("Loaded win_dll.dll");<br />
typedef void * (__stdcall *fpProc)(JNIEnv *env , jobject obj);<br />
fpProc pfnProc = (fpProc)GetProcAddress hInst, "Java_gui_Win_getCurrFirmware");<br />
if( fpProc )<br />
{<br />
AfxMessageBox("Got Java_gui_Win_getCurrFirmware");<br />
<br />
JNIEnv env;<br />
jobject obj;<br />
VOID * jstr = (fpProc)(&env, obj); // Passing w/o initializing<br />
<br />
<br />
AfxMessageBox("Called!");


Thanks!
GeneralRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
Nibu babu thomas24-Mar-06 1:15
Nibu babu thomas24-Mar-06 1:15 
GeneralRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
a1prashant@yahoo.com24-Mar-06 1:23
a1prashant@yahoo.com24-Mar-06 1:23 
GeneralRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
Nibu babu thomas24-Mar-06 1:29
Nibu babu thomas24-Mar-06 1:29 
GeneralRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
a1prashant@yahoo.com26-Mar-06 16:40
a1prashant@yahoo.com26-Mar-06 16:40 
GeneralRe: MFC App needs to call routine from a DLL made using JNI -- Urgent Pin
Nibu babu thomas26-Mar-06 17:04
Nibu babu thomas26-Mar-06 17:04 
QuestionWhat happens if an ActiveX control's property page is clicked? Pin
Sstar23-Mar-06 15:16
Sstar23-Mar-06 15:16 
QuestionSearching binary file Pin
delta3223-Mar-06 14:50
delta3223-Mar-06 14:50 
AnswerRe: Searching binary file Pin
Stephen Hewitt23-Mar-06 15:46
Stephen Hewitt23-Mar-06 15:46 
GeneralRe: Searching binary file Pin
PJ Arends23-Mar-06 16:20
professionalPJ Arends23-Mar-06 16:20 
GeneralRe: Searching binary file Pin
Stephen Hewitt23-Mar-06 16:28
Stephen Hewitt23-Mar-06 16:28 
GeneralRe: Searching binary file Pin
delta3223-Mar-06 17:50
delta3223-Mar-06 17:50 
GeneralRe: Searching binary file Pin
Stephen Hewitt23-Mar-06 18:30
Stephen Hewitt23-Mar-06 18:30 
GeneralRe: Searching binary file Pin
delta3223-Mar-06 18:54
delta3223-Mar-06 18:54 
QuestionFor What reason AFX_GETMODULE_STATE macro is used? Pin
charpointer23-Mar-06 14:38
charpointer23-Mar-06 14:38 
AnswerRe: For What reason AFX_GETMODULE_STATE macro is used? Pin
_AnsHUMAN_ 23-Mar-06 16:37
_AnsHUMAN_ 23-Mar-06 16:37 
Questionunsolved external symbol Pin
zms41323-Mar-06 13:46
zms41323-Mar-06 13:46 
AnswerRe: unsolved external symbol Pin
Stephen Hewitt23-Mar-06 15:01
Stephen Hewitt23-Mar-06 15:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.