PDA

View Full Version : sprop.dll file not found



Unregistered
July 25, 2002, 19:53:53
Hello,
I just installed your new Sony_addon. When I try to run the following vb project:

"C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 1.3\Samples\VB6\Sonydemoapp"

I get this error: "Run-time error '53': File not found: sprop.dll". Now there IS a "sprop.dll" file in the SonydemoApp directory, so why can't the program find it?

On the other hand, both the SonyDCamvb.exe plus the Sonydemoapp.exe works fine when run from this directory (this directory contains both "sprop.dll" as well as "ICImagingControl.ocx"):

C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 1.3\Bin

How do I resolve this problem?

Regards,
Ole


PS. PLEASE respond to this before you go home for the weekend! - I need to work overtime this weekend to get my program up and runnig 'till monday. In advance: Thanks! :-)


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

Unregistered
July 26, 2002, 11:08:56
Hello,

the problem consists of how Visual Basic handles directories. If you change in your Visual Basic application a directory by saving or opening a file, the working directory changes too. This happens also if you open a file with the Visual Basic's "File" menu.
If a DLL is located in the applications directory, the Visual Basic application would not find it, after you changed the directory.

There are two ways to solve this problem:
1. The easy way:
Copy the "sprop.dll" to your Windows directory. This works in every case, because there should be a search path set to your Windows directory.

2. Programming way:
Before you perform any directory operations like show the "Fileopen" dialog, save your current directory in a local string variable:

Dim ExePath As String
ExePath = CurDir$

Now, perform your file and directory operations. The "sprop.dll" will not be found in this time. After finishing your file and directory operations, change back to the saved path:

ChDir ExePath

Now, your applications workdir is set back and the "sprop.dll" will be found.

Best regards
IC Support


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

Unregistered
July 26, 2002, 14:12:37
Hello again.

I tried to run the the FirstApp.vbp in the Sonydemoapp directory once again: I checked the current directory before calls to the functions in the "sprop.dll" and the current directory remained the same throughout the program:

"C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 1.3\Samples\VB6\Sonydemoapp"

The above directory contains ONLY a copy of the "sprop.dll" file.

However if I add this line of code to the top of the frmMain Form_Load event:

ChDir "C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 1.3\Bin"

then the program executes flawlessly! The Bin directory contains a copy of the "sprop.dll" AS WELL AS the ICImagingControl.ocx. It seems that in order for an application to reckognize the "sprop.dll" file the applications current (working) directory must be set to point to a directory that contains both the ICImagingControl.ocx AND the "sprop.dll". This can't be right - or? Perhaps you have a problem with the automated installation package?

Thanks,
Ole


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

Unregistered
July 29, 2002, 16:14:50
Hello,
I still have a problem here: It can't be right that I have to change the workingdirectory of all of my programs to:

"C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 1.3\Bin"

in order for me to be able to use the "sprop.dll" functions. I have tried to install the Sony_addon on other computers containing (trialversions of) ImagingControl - the problem stays the same. Have you checked if there is a problem with your Sony_addon installation package?

As I told you in my previous letter the Sonydemoapp applications working directory:

"C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 1.3\Samples\VB6\Sonydemoapp"

remains unchanged during program run: So this isn't the problem. The application simply won't use the "sprop.dll" in the Sonydemoapp directory.

I also face a problem when I distribute my application here.

Please help,
Ole


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

Unregistered
July 30, 2002, 09:13:53
Hello Ole,

the problem you have, consists of how Visual Basic loads DLLs. If Visual Basic wants to load a DLL, the DLL must reside in the current working directory of the application or in one of the directories that are included in the search path of Windows, like "Windows\System32".

If your application is developed in a directory named "c:\source\test" and it is working there, then it would not find the "sprop.dll" except you would copy it into this directory.

The OCX can be found, because it is registered with its location in the registry. This is part of the OLE automation. It is not the same as using DLLs.

If you look into the file "sonydcam.bas", you can see the declarations of the functions, that are implemented in the "sprop.dll". There is a statement "lib "sprop.dll"" in every declaration. You could change this to an absolute path like
"c:\sony\sprop.dll". If the directory exists and the dll resides in there, this would work in every case:

Declare Function SetDevProperty Lib "c:\sony\sprop.dll" _
(ByVal Device As String, ByVal Property As Long, ByVal Value As Long) As Long

If you install your application on your customers computer, you would need to create this directory and copy the "sprop.dll" in it.

Best regards

IC Support


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