There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Visual Basic 6 - Failing to find called dll's


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
Niessen's Avatar
Junior Member with 7 posts.
 
Join Date: Jul 2005
Experience: Intermediate
19-Aug-2005, 12:19 AM #1
Visual Basic 6 - Failing to find called dll's
I am upgrading a VB3 program to VB6. I wrote a Fortran dll to receive and crunch data, generate and print files . . .which was called, found and worked in the VB3 version. In the VB6 attempt, I get an Error 48 (can't find the dll).

I used Fortran 5.1 to create the dll so the dll itself should be OK (protected mode, Windows); I was careful to create and name the file in lower case and use lower case for the "lib" calll-out in the (Public) DECLARE statement in the .bas module; and I checked to be sure the dll was present in the same sub-directory where the VB forms and modules reside. I tried copying the dll to the root directory of the D drive where VB6 and the files are located and defining it as "D:\hs4.dll" to test if the problem was with a long subdirectory string.

I can't figure why the program can't find the file . . . nor do I know how to track the cause for the error other than getting the Error number.

I certainly would appreciate a new avenue of investigation or a way to track what is happening.

Operating under XP-Home with VB 6.0 with Service Patches 5 and 6.

Last edited by Niessen : 19-Aug-2005 01:22 PM.
MustBNuts's Avatar
Senior Member with 1,930 posts.
 
Join Date: Aug 2003
Location: Nevada
21-Aug-2005, 02:36 AM #2
Have you tried registering the .dll?

regsvr32 c:\path\file.dll obviously, change the drive, path, and file to yours.

Hope this helps,

MBN
Niessen's Avatar
Junior Member with 7 posts.
 
Join Date: Jul 2005
Experience: Intermediate
21-Aug-2005, 05:05 PM #3
Quote:
Originally Posted by MustBNuts
Have you tried registering the .dll?

regsvr32 c:\path\file.dll obviously, change the drive, path, and file to yours.

Hope this helps,

MBN
Thank you for the suggestion . . . I entered the appropriate code and got an "error message" indicating that "d:\hs4.dll is not an executable file and no registration helper is registered for this file type." I really hoped that your idea would work. . . but I still await THE SOLUTION.

Walt
Niessen's Avatar
Junior Member with 7 posts.
 
Join Date: Jul 2005
Experience: Intermediate
21-Aug-2005, 05:08 PM #4
Quote:
Originally Posted by Niessen
I am upgrading a VB3 program to VB6. I wrote a Fortran dll to receive and crunch data, generate and print files . . .which was called, found and worked in the VB3 version. In the VB6 attempt, I get an Error 48 (can't find the dll).

I used Fortran 5.1 to create the dll so the dll itself should be OK (protected mode, Windows); I was careful to create and name the file in lower case and use lower case for the "lib" calll-out in the (Public) DECLARE statement in the .bas module; and I checked to be sure the dll was present in the same sub-directory where the VB forms and modules reside. I tried copying the dll to the root directory of the D drive where VB6 and the files are located and defining it in the Declaration statement as "D:\hs4.dll" to test if the problem was with a long subdirectory string (it wasn't).

I can't figure why the program can't find the file . . . nor do I know how to track the cause for the error other than getting the Error number.

I certainly would appreciate a new avenue of investigation or a way to track what is happening.

Operating under XP-Home with VB 6.0 with Service Patches 5 and 6.
MustBNuts's Avatar
Senior Member with 1,930 posts.
 
Join Date: Aug 2003
Location: Nevada
22-Aug-2005, 07:59 PM #5
After you moved to VB 6, did you make sure that the dll was in your project (Project>Rerences, find your dll or browse for it, and make sure there's a checkmark on it)?

MBN
Niessen's Avatar
Junior Member with 7 posts.
 
Join Date: Jul 2005
Experience: Intermediate
24-Aug-2005, 10:58 AM #6
Quote:
Originally Posted by MustBNuts
After you moved to VB 6, did you make sure that the dll was in your project (Project>Rerences, find your dll or browse for it, and make sure there's a checkmark on it)?

MBN
I looked in the References window but hs4.dll (my DLL) was not there . . . no surprise . . . so I "browzed" to where it was located and tried to add it to the Referenced Files list . . . whereupon VB6 told me that it "Can't add a reference to the specified file." Note, if it makes a difference, that the file was not referenced in the VB3 or VB4 versions of the program.
Niessen's Avatar
Junior Member with 7 posts.
 
Join Date: Jul 2005
Experience: Intermediate
06-Sep-2005, 10:27 PM #7
Quote:
Originally Posted by Niessen
I am upgrading a VB3 program to VB6. I wrote a Fortran dll to receive and crunch data, generate and print files . . .which was called, found and worked in the VB3 version. In the VB6 attempt, I get an Error 48 (can't find the dll).

I used Fortran 5.1 to create the dll so the dll itself should be OK (protected mode, Windows); I was careful to create and name the file in lower case and use lower case for the "lib" calll-out in the (Public) DECLARE statement in the .bas module; and I checked to be sure the dll was present in the same sub-directory where the VB forms and modules reside. I tried copying the dll to the root directory of the D drive where VB6 and the files are located and defining it as "D:\hs4.dll" to test if the problem was with a long subdirectory string.

The DECLARE statement was:

Declare Sub DATAPASS Lib "D:\hs4.dll" (ByVal S0 As String, ByVal S1 As String, ByVal S2 As String, CON As Single, RMAX As Integer, D As Single, OUT1 As Single, OUT2 As Single, OUT3 As Single, ISEGTOT As Integer)

and the CALL statement was:

Call DATAPASS(DIRECTOR, DATAFILE, ProjectName, CON(0), RMAX, D(1, 1), OUT1(1, 1), OUT2(1, 1), OUT3(1, 1), ISEGTOT)

I can't figure why the program can't find the file . . . nor do I know how to track the cause for the error other than getting the Error number.

I certainly would appreciate a new avenue of investigation or a way to track what is happening.

Operating under XP-Home with VB 6.0 with Service Patches 5 and 6.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:59 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.