PDA

View Full Version : Sony FireWire Add-On - sprop.dll not found



Unregistered
July 31, 2002, 17:38:32
I am using IC Imaging Control 1.3 with the Sony Add-on on a XP machine to control a Sony DFW-X700 camera. When I run your sample VB code (firstapp.vbp) in Sonydemoapp folder, I get an error "File not found: sprop.dll". However, the sprop.dll is in the Sonydemoapp folder.

Can you please help to fix this problem?


This message was originally posted by Suresh Marapane in the old IC Imaging Control Support Forum.

Unregistered
August 1, 2002, 09:07:29
Hello,

Visual Basic is loading DLLs from the current working directory or the search path directories. If in the file "SonyDCam.bas" the DLL is referenced by an absolut path ("C:\sprop.dll"), the library would be found in any case. Also you could copy the "sprop.dll" in the windows\system32 directory to use the search path.

Opening and saving a file with the file open dialog in the application and in the Visual Basic IDE changes the current working path of the application.

Please refer to
http://www.imagingcontrol.com/ic/support/forum/read.php?f=2&i=321&t=321
( Same problem by Mr. Ole Jakobsen) to get more information about how to use DLLs in Visual Basic.

Best regards
Stefan
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.

Unregistered
August 6, 2002, 16:36:31
Hello,

we found a second solution for the problem.
In the main form of the Visual Basic application the "sprop.dll" must be loaded with "LoadLibrary" in the "Form_Load" sub. In the "Form_Unload" sub it has to be unloaded again.
Following functions must be declared in the form:

Private Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" _
(ByVal Name As String) As Long

Private Declare Function FreeLibrary Lib "kernel32.dll" _
(ByVal Handle As Long) As Boolean

Also a long variable "hDLL" is declared, that holds the handle of the loaded "sprop.dll":

Dim hDLL As Long

In the "Form_Load" sub, the DLL is loaded now:

Private Sub Form_Load()
hDLL = LoadLibrary("sprop.dll")
End Sub

In the "Form_Unload" sub, the DLL must be unloaded:

Private Sub Form_Unload(Cancel As Integer)
FreeLibrary hDLL
End Sub

Now, the application can change the directories, as it needs. The "sprop.dll" is already loaded.

Best regards
Stefan
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.