Making DLL calls with output parameters in Classic ASP

Viewed 70

Struggling with passing parameters to the external third-party DLL, that is supposed to accept one of the parameters as a value to return.

Code:

  Dim InputData 
  Dim ReturnData
  Dim PDF417
  Set PDF417 = Server.CreateObject("IDAuto.PDF417")
  DataToEncode = "test data"
  ReturnData = ""
  PDF417.FontEncode (InputData, 0,0,0,0,0,0, ReturnData )

This gives an error that parameter type is wrong.

This works, but doesn't return anything, obviously.

  PDF417.FontEncode (InputData, 0,0,0,0,0,0, "" )

I suspect that all parameters are passed ByVal in Classic ASP (I'm fixing ancient code), so how can an asp page interact with a DLL call that expects one of the parameters to be an output?


UPDATE upon feedback from Mark et al: Apologies for the delay, the abundance of syntax options is really confusing.

  ' does not feed ReturnData with values
  ReturnData = PDF417.FontEncode (InputData, 0,0,0,0,0,0, "")
  ' error: wrong nunber of arguments
  ReturnData = PDF417.FontEncode (InputData, 0,0,0,0,0,0)
  ' Type mismatch 
  PDF417.FontEncode InputData, 0,0,0,0,0,0, ReturnData 
  ' Type mismatch 
  Call PDF417.FontEncode (InputData, 0,0,0,0,0,0, ReturnData)
  ' Type mismatch 
  Dim x(1)
  x(1) = ""
  Call PDF417.FontEncode (InputData, 0,0,0,0,0,0, x(1))

  ' However, this worked in ASP.NET
  Dim ReturnData
  ' the line below is required to work
  ReturnData = ""
  PDF417.FontEncode (InputData, 0,0,0,0,0,0, ReturnData )
  ' ReturnData contains the encrypted value if run as a .aspx script.
0 Answers
Related