View Full Version : dll?


03-27-2008, 05:36 PM
Hi all,

Will any version of alpha call a dll? i am not finding this answer.

03-27-2008, 05:44 PM

Are you referring to maybe an API call which uses methods in which to use Windows dlls? The code archive has a few references mostly made by Marcel K. I have done a very tiny bit with it but again mostly with Marcel's help....and he may very well be gone now unless the runtime pricing changes :( . There was a thread with some API references also. IF this is indeed even what you are referring to.

03-27-2008, 06:30 PM

Kinda and I guess it might work, but I was not thinking of an indirect way, but a way to directly call a dll that has functions like:

xzy = call."curdrive+"\"+curdir+"\"+puur.dll" -raster(132,368,y)

Raster being a function embedded in the purr.dll

Make sense? No, this probably would not be the right syntax, but an example.

Another way would be to include a dll at start of alphaDB and all the functions in the dll would show up like the aex files do now.

03-27-2008, 06:41 PM
I sorta thought it went beyond what has been discussed on the messageboard....but I think Marcel would be the one who could more definitively let you know what can and cannot be done and has a seemingly good background in VB so you would have common ground there as well...he is the only one so far I have seen that will spend the time to convert existing VB API calls into xBasic. And he has a few times stated that it is never for the faint of heart as can take a bit of time even for him.

03-27-2008, 06:53 PM
In clipper, we just included the function and dll name and when it was compiled, it all went together in the exe as an ovl file.

VB(my memory slips sometimes) I THINK we had to include the dll as a file and call the dll at runtime.

Most just call the runtime at runtime.

03-27-2008, 07:01 PM

Marcell has posted a simple script that can burn cd's using a dll. Take a look at it for some ideas on dll usage.

03-27-2008, 07:05 PM
that could get me on the right path.


Marcel Kollenaar
03-29-2008, 08:36 PM

What do you need? Can you show me the dll and function you want to use and the parameters? Does it looks like this?

declare hid HidD_FreePreparsedData LL

'Public Declare Function HidD_FreePreparsedData _
' Lib "hid.dll" _
' (ByRef PreparsedData As Long) _
'As Long

Link1 (http://www.robvanderwoude.com/rundll.html)

Link2 (http://www.ericphelps.com/batch/rundll/)

03-30-2008, 12:00 PM

Thank you. There is no exact one right now, but I have a dll on the way made in c that I would need to use some functions in. It is a win 32 function and doesn't use anything strange.

You just pass it a string with numbers and characters and it returns a number.

It works kind of like: pymtonapr(bal as n, term as n, apr as n, dtf as c) would work in alpha.

I think You gave me the answers in your post. Too bad we can't directly call dll's, but I guess we can't compile either. Oh well.

03-30-2008, 12:48 PM
Hi Dave,

Too bad we can't directly call dll's

Sure we can, unless your definition of calling a DLL is different than mine.

It just requires that you specify the correct declare statement (and possibly declarestruct) in XBasic. As long as you don't use variant parameters and a few other types, it works with most DLL's, particularly if you are generating the DLL and have control of the parameter types.

Marcel Kollenaar
03-30-2008, 01:38 PM
Hi Dave,

Ira is right.

declare hid HidD_FreePreparsedData LL

Is a declaration to hid.dll and an extrernal function in that dll with name HidD_FreePreparsedData and one parameter (second L). The functions returns (first L) a L (long 32 bit number).

You use it as:

dim T as N
dim P as N
T = HidD_FreePreparsedData(P)

Just an example.

03-30-2008, 03:21 PM
Thank both of you guys.