Solved

Cant Find Entry point to DLL ?

Posted on 1997-06-11
13
433 Views
Last Modified: 2013-11-08
The error 'Cant find entry point to xxxxx.dll ' comes up when I run my VB program. the file xxxxx.dll is created from Fortran Power Station - in fact I am just trying to get the example they give for using Fortran DLL's in VB to work. Any Ideas ?
0
Comment
Question by:sl311
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +1
13 Comments
 
LVL 5

Expert Comment

by:y96andha
ID: 1427106
Check the exported names table of the DLL by right-clicking it in the explorer and selecting quickview. Make sure that the function that you have created is listed there.
0
 
LVL 4

Expert Comment

by:Chizl
ID: 1427107
Your calling a 16 bit call with a 32 bit machine..  ExitWindows for example is no longer in Win95 and will give you this error.  The new function is ExitWindowsEx with the same params..
0
 

Author Comment

by:sl311
ID: 1427108
Fortran Power Station is only 32 bit and the example I am doing is as follows :

In Fortran :

SUBROUTINE ARRAYTEST(arr)
   !MS$ATTRIBUTES DLLEXPORT :: ARRAYTEST
   REAL(4)  arr(3, 7)
   INTEGER i, j
   DO i = 1, 3
      DO j = 1, 7
         arr (i, j) = 11.0 * i + j
      END DO
   END DO
END SUBROUTINE

This compiles fine to a .dll and a .lib file which I then call from VB as follows :

VB Module :

Declare Sub ARRAYTEST Lib "c:\mark\dlltest" (Myarray As Single)

Then I call it from a subroutine :

Static arr(1 To 3, 1 To 7) As Single
Call ARRAYTEST(arr(1, 1))

When I dont get the path right it says cannot find dll, but as I no longer get that message I assume it is finding the dll. The error then is 'Cant find dll entry point ARRAYTEST in C:\path\dlltest.dll"

As fortran is 32 bit it cant be that it is calling a 16 bit dll so what can I do to make this work. Is it something to do with DLLMAIN or my dll linking options ?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:y96andha
ID: 1427109
This is when you should do what I suggested, to verify that it is really exported as ARRAYTEST. Sometimes functions get a suffix or prefix when exported.
0
 

Author Comment

by:sl311
ID: 1427110
I right clicked it in Explorer and used quickview but could not see an 'Exported names table' or even the word arraytest with or without prefixes or suffixes.
0
 
LVL 5

Expert Comment

by:y96andha
ID: 1427111
What did appear when you quickviewed it? The exact header of the section I'm interested in is "Export table". If you would like, you could e-mail your DLL to andreas.hansson@mbox303.swipnet.se, and I could try to see if I can work anything out.
0
 

Author Comment

by:sl311
ID: 1427112
Adjusted points to 200
0
 
LVL 4

Accepted Solution

by:
Chizl earned 230 total points
ID: 1427113
In stead of :
Declare Sub ARRAYTEST Lib "c:\mark\dlltest" _
      (Myarray As Single)
Try:
Declare Function ARRAYTEST Lib "c:\mark\dlltest.dll" _
      (Myarray As Single)

I also have a VB4 (16bit) and a VC1.52 (DLL) example on my site if you want to check it out.  Arrays are not really a good thing for VB.  That is straight from the MS mouth.  Strings and Integers are the best and they told me that Strings really were not that great, but I had no problems with them..

L8r,
Chizl
0
 
LVL 4

Expert Comment

by:Chizl
ID: 1427114
I tried removing the .dll extension but I still go the 'can't find entry point' error message. Surely most people would not be content with just passing integers to and from dll's. Is there no way arrays can be passed without writing to a data file, then shelling to the fortran executable which reads the data file. - Slow and cumbersome.
0
 

Author Comment

by:sl311
ID: 1427115
I know I am comming in on the tail end here but I do have a thought.
Since you are using 32 bit, the function or sub names are
case aware.
If the DLL exports the function as ArrayTest and you call it
ARRAYTEST, this WILL NOT work.
If the case is not correct, you will get the error that you are getting.
0
 
LVL 6

Expert Comment

by:BenClark
ID: 1427116
A lot has happened since I posted the last comment..   Ben your right and should be given the points if that's the problem..   Also if your trying to pass in an Array as single I dont believe this will work either..  The thing your looking for is "Array as Variant"..  This is the 32 bit thing is now well know as the way to pass VB arrays..  I use VC5 as the backend to pass my VB arrays into and it catches the VB arrays with SafeArrays..  I don't know about Fortran and don't know if Fortran even has SafeArrays, but you might want to look into it..

L8r,
Chizl
chizl@karland.com
http://www.karland.com/
0
 
LVL 4

Expert Comment

by:Chizl
ID: 1427117
Thanks guys - it was the case sensitive issue that I got wrong - schoolboy error on my part I'm afraid.
0
 

Author Comment

by:sl311
ID: 1427118
That should of been Ben's points..  Sorry Ben!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question