Re: [BLACKBOX] Calling DLL's

From: [at]} <Bernhard>
Date: Tue, 12 Jan 2010 20:34:56 +0100

----boundary-LibPST-iamunique-458055050_-_-
Content-type: text/plain

Dear Rainer,

as far as I know, you cannot modify the environment (i.e. the Path) from
within an application, but I am happy to learn how you did it.

You should do that globally via:

Right click on: My computer (Arbeitsplatz)
then: Properties (Eigenschaften)
Tab: ? (Erweitert)
Button: Environment Variables? (Umgebungsvariablen)
If there is Path: modify it (add your settings to it)
Otherwise: create a new Path variable under ? (Benutzervariable for <login>)


Optionally you could call BlackBox from the commandline after having set the
path variable before calling BlackBox

regards
   Bernhard


----- Original Message -----
From: Rainer Neubauer
To: BLACKBOX{([at]})nowhere.xy
Sent: Tuesday, January 12, 2010 9:30 AM
Subject: Re: [BLACKBOX] Calling DLL's


A call to "apiInit" (being exported from ew.dll) returns the error message
"JNI,initVM,JNI_CreateJavaVM,"


I guess the DLL ew.dll in turn calls some java DLL's to start up a java
virtual machine and the java DLL runs into a problem. But this is just a
guess because I am not experienced in all this java stuff and windows
programming as well.


I will try to contact the vendor of ew.dll to ask for the precise meaning of
the error message but I guess he will tell me his test application
"testClient.exe" works and he does not know what BlackBox is at all.


What I am concerned about is the fact that the java stuff gets started
without any problem when the call to "apiInit" is executed within the test
application "testClient.exe". This is a compiled and linked .exe-file. Could
there be any difference in the way of calling DLL*s from .exe-files and from
BlackBox ?




Some more information, which could be of interest:


ew.dll exports services having parameters of complex types (arrays of
records which contain integers, strings, etc).
To make the handling of these types easier a colleague of mine has developed
an "interface dll", say trace.dll.
trace.dll is intended to sit on top of ew.dll and he built a small dos
application for testing trace.dll.


Running this test application calls trace.dll which in turn calls "apiInit".
Everything works fine.


I tried to do the same with BlackBox. I am able to call trace.dll within
BlackBox; trace.dll in turn calls "apiInit" and "apiInit" fails with the
same error message.




This confuses me because I have no idea where the difference is. Everything
works when calling "apiInit" from a compiled and linked C program. On the
other side "apiInit" gets an internal problem when being called from
BlackBox in spite of the fact parameter passing between BlackBox and
"apiInit" seems to work.


My colleague told he has linked ew.lib to his program. He told, in windows
programming dll files come together with lib files.
These lib files are intended to be linked statically to the application and
their purpose is to make references to procedures within dll's easier. Could
this result in a different mechanism of calling dll's from .exe files and
from BlackBox ?


Some paths need to be added to the environment variable "path" in order to
get the java stuff working. I modified the setting of "path" from within
BlackBox (via calling WinApi) to make sure the process "blackbox.exe" is
able to see the correct setting. But this did not help either.




Does anybody have an idea what the problem is ?
Does anybody have a hint where to look or what to look for ?




Best regards,
Rainer




Am 11.01.2010 um 18:55 schrieb Alexander Iljin:


Hello!


 When I call "apiInit" from BlackBox, the DLL is found by the system,
 "apiInit" starts, takes its input parameter (options file), reads
 this file, writes a log file specified in the options file and
 terminates delivering an error code and an error message.


  What is the error message?


---=====---
 Alexander




----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to 
LISTSERV{([at]})nowhere.xy---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to 
LISTSERV{([at]})nowhere.xy----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-458055050_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIERlYXIgUmFpbmVyLFxwYXINClxwYXINCmFzIGZh
ciBhcyBJIGtub3csIHlvdSBjY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X0AMGFHbHVheUI1
YjM=
----boundary-LibPST-iamunique-458055050_-_---
Received on Tue Jan 12 2010 - 20:34:56 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:37 UTC