PDA

Click to See Complete Forum and Search --> : DDL Entry Point gone missing !!


Voldemort
Feb 1st, 2002, 06:43 PM
I have created a DLL that I want to use to work data in an array of types. All of the types (there are several ) are singles and there are no sub arrays.

When I make the dll, XP automatically registers the dll - ta very much Bill. I can check this out using the OLEViewer. It all looks OK.

The array is defined as a SAFEARRAY and the type is visible and correct.

I can run the dll by attaching it as a reference to my calling project and get at my subroutine (its a SUB call not a FUNCTION by the way) by using the structure ...

dllname.sub array(),t,p

Where t and p are a couple of extra singles that I pass into the dll.

When I try and access the dll using a declare statement calling the sub directly in my program I get the message

Run-Time error '453'
Can't find entry point FilterTheCPs in CP_Filter

FilterTheCPs is my subroutine name
CP_Filter is my dll name

Spelling and type structures all look OK and my declare statement is..

Public Declare Sub FilterTheCPs Lib "CP_Filter" (ByRef CPInfo() As CardinalPoint2, ByVal NoOfTemps2 As Single, ByVal NoOfPowers2 As Single)

CardinalPoint2 refers to an identical type structure (defined in my calling program) as that used in the dll.

Where am I going wrong? Can anybody help me out on this one?

-----------------------------
Trouble at the mill

Edneeis
Feb 1st, 2002, 08:50 PM
That's because VB only makes ActiveX DLLs or COM DLLS so you can't use the Declare bit with them. They work like objects instead of exposing only certain functions via Declare statements.

So instead you go like this (after making the reference):

dim TestObj as new ClassNameFromDLL

TestObj.FunctionName AnyArguments

Voldemort
Feb 2nd, 2002, 06:04 AM
Job Done then.

I was trying to create an ordinary DLL to allow some third party code to interface to my routines. They can read activeX dlls but they were having a problem passing data.

When I tried it for myself I apeared to be having the same problem.

I can access my DLL in the way that you outlined so I will now pass the buck back to them.

Thanks for clearing that up for me Edneeis. I'm not going mad after all.

Well, maybe just a little.

------------------

:)