Link to home
Start Free TrialLog in
Avatar of mguedes
mguedes

asked on

private dll install...........

the fact....
I have a project with a call to a private dll(in FORTRAN), and i have create an setup for my app(with the setup wizard). Ok, it´s work in the developper computer(where i have developped the app and the dll), but when i teste my installation in anover machine it doesn't work.....when i execute the app it tell´s me that it  can´t fount the external dll(i have tested to copy the dll to the system folder but it doesn't work anyway....)
what´s the problem? do i have to regiter the dl in each computer....? help´s me please........

Thanx in advance, :c)
Mário Guedes
Avatar of clifABB
clifABB

Make sure the dll's path isn't hard coded in the VB app:
  Wrong:
    Declare Function Foo Lib "c:\WinNY\System32\Mydll.dll" (ByVal hdc As Long) As Long
  Right:
    Declare Function Foo Lib "Mydll.dll" (ByVal hdc As Long) As Long

Also, you seem to have done so already, make sure your dll is in the Windows\System directory.

I submit this as a comment.  If it solves your problem, let me know and I'll resubmit it as an answer.
I'm going out on a limb, but I have experienced the same problem with one of my Visual C++ dlls, most likely you have built the dll as a debug version and do not have the necessary extra files on your other computer to run it in debug version. ReBuild a release version, this should fix your problems.
 
                                          Lonnie Brooke

Avatar of mguedes

ASKER

I have tested both solution, but it doesn't work anyway.......
Avatar of mguedes

ASKER

I have tested both solution, but it doesn't work anyway.......
what´s the original error message ? Have you registered the dll ?
Avatar of mguedes

ASKER

the original message was "Error:xxx foo.dll file not found". And no i don´t no if the dll was registered in the new machine....i just make the VB setup wizard...
You must register the dll file first.  To do that in the setup wizard, you must add the file at the end and make sure that it registers after any dependent files register.  IE shadow.dll is dependent on sun.dll so sun.dll must install and register in the setup list before the shadow.dll.  You might have to open up the setup list and do this manually because the setup wizard is crued as opposed to using install shield or another program of such sort.
Avatar of mguedes

ASKER

The setup Wizard detect the dependency and include my dll....and it is at the end of the list. How can i have sure that it registers my DLL? How can i regester my DLL manualy?
You can register your dll manually by opening a dos box, change directories to your system directory and typing the following:
  regsvr32 foo.dll

most dll's are self registering, though.
Avatar of mguedes

ASKER

do you no if a dll make with the Visual Fortran(in DevStudio) was self registering ?
I will test your tip and send you the results....
It doesn't matter what dependencies the wizard recognizes in the dependency section.  The truth of the matter is that it still doesn't mean that it will include the files or register them.  You need to add them at the very end where it shows you a list of files and you have a button that you can click to add more files.  If the files don't register when installing, you can register them by using regsvr32.  Go to the dos window, the directory the file is in, and then type regsvr32 the.dll.  If that doesn't work, your dll is being installed in the wrong place, is missing a dependent file (once again don't trust the setup wizard to include dependencies even if it says it recognizes them), or your program is not making the correct reference to the dll.
Avatar of mguedes

ASKER

But it copy the dll to the install folder in the setup wizard, and to the system(app path) after i run the setup.exe..........
Unless you add the file at the right time, it doesn't matter where the file is put.  First try just self-registering the dll with regsvr32.  If the program works after that, then your problem is in the setup wizard registering the program.  If not, then it's a problem in the dll or the way your calling it in your project.  Such problems can arise because running an exe and just running your project can sometimes produce two different results due to the fact that the VB compiler and the debugger run things differently IE the parrellel processing.  Anyways, if the file runs after self-registering it, you need to add the dll AT THE END of the setup wizard.. it's the last screen before the program starts building.  Anywhere else, and the dll will not self-register.  The setup wizard is very crued and stupid to say the least.  It's not a good tool for creating installs to distribute to other users.  You really need to use a 3rd party installation program such as install shield.
Did any of this work for you?
Avatar of mguedes

ASKER

thank´s ChrisH, i will try that....tomorow(because in my country , it's 10PM), and i comment to you......tomorow :c)
ASKER CERTIFIED SOLUTION
Avatar of chabaud
chabaud

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mguedes

ASKER

Thank´s for your help............i´m remenber that i have a prog. installed that add a tab in the dlls properties with the dependence of the dll analized.!!! ;c)