Hi

I've a java application which calls DLL created in Managed C++.
I could successfully make a call to C++ Method. But when I try calling a class (which resides in a different DLL) inside the same method (in c++), it gives error "System.IO.FileNotFoundException: Could not load file or assembly...."

This is what I've done.
1. Created a Java application which calls the C++ function.
2. Created the header file using javah
3. Implemented the method in the C++ DLL.
4. In the same method tried to instantiate a C++ Class (gives error at runtime).

**************
System.IO.FileNotFoundException: Could not load file or assembly 'Util, Version=2.0.3.4, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Util, Version=2.0.3.4, Culture=neutral, PublicKeyToken=null'
at <Removed for posting in public forum>.Execute(String[] args)
at Java_Test_Execute(JNIEnv_* je, _jobject* jo, _jobjectArray* joa) in <Removed for posting in public forum>.cpp:line 40

=== Pre-bind state information ===
LOG: User = <Removed for posting in public forum>
LOG: DisplayName = Util, Version=2.0.3.4, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Java/jdk1.5.0_14/bin/
LOG: Initial PrivatePath = <Removed for posting in public forum>
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Java/jdk1.5.0_14/bin/Util.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Java/jdk1.5.0_14/bin/Util/Util.DLL.
LOG: Attempting download of new URL file:///<Removed for posting in public forum>/3d3fce08/java.exe/Util.DLL.
LOG: Attempting download of new URL file:///<Removed for posting in public forum>/3d3fce08/java.exe/Util/Util.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Java/jdk1.5.0_14/bin/Util.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Java/jdk1.5.0_14/bin/Util/Util.EXE.
LOG: Attempting download of new URL file:///<Removed for posting in public forum>/3d3fce08/java.exe/Util.EXE.
LOG: Attempting download of new URL file:///<Removed for posting in public forum>/3d3fce08/java.exe/Util/Util.EXE.


**************

If I copy all the dlls to "C:/Program Files (x86)/Java/jdk1.5.0_14/bin", it works without any error.

I tried the following
1. Setting the folder name using "AppendPrivatePath"
2. Setting the folder name using "SetDynamicBase"

Still .Net does not seem to find the dll file.

How to fix it? I don't want to copy the application to Java/Bin folder

Thanks and Regards,
Unni