Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a DLL

Status
Not open for further replies.

alehawk

Programmer
Jun 18, 2003
332
0
0
AR
Hi!
I usually program in Visual Basic and I have to make an asp site but I found a problem. I got to use a DLL that doesnt have an entry point so I can copy it to my site root space and in visual basic I declare and call it like this:

Private Declare Function swe_calc Lib "swedll32.dll" _
Alias "_swe_azalt@40" ( _
ByVal tjd_ut As Double, _
ByVal calc_flag As Long, _
ByRef geopos As Double, _
ByVal atpress As Double, _
ByVal attemp As Double, _
ByRef xin As Double, _
ByRef xaz As Double _
) As Long

ret_flag = swe_calc(tjd_et, planet, iflag, x(0), serr$)

How do I do that in ASP?
Thank you!
 
You have to make that dll as an ActiveX object, or make an activeX object who calls methods from that DLL and returns you the result.
Onece you have the ActiveX you can use Server.CreateObject on that activeX.

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
Its not mecessary for the DLL to be in the same directory as the ASP pages or site root directory. Once compiled with VB the DLL will automatically be registered, if you want to register the DLL then Start->Run->regsvr32 c:\mydll.dll

Now its registered, call it in ASP like that:

Code:
Dim objCalc
Dim ret_flag

Set objCalc = Server.CreateObject("vbprojectname.classname")

ret_flag = objCalc.swe_calc(param1,param2,param3...)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top