View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Christoph Wirz Christoph Wirz is offline
external usenet poster
 
Posts: 2
Default string passing to DLL

How can I pass a string to a DLL?

I have written a DLL with Fortran. I can pass integers and reals from Excel
to my DLL and back. When I try to pass a string I get an error message
"stack too small" or even worse my excel application is closed.
The Excel part looks as follows:

Declare Sub REG_A Lib "C:\Daten\RegAn.dll" (Polyg As Long, Nmess As Long,
XMess As Double, filnam As String, Leverage As Double)
Dim filnam$
filnam = "C:\Daten\dll_mldg.txt"

Call REG_A([Polyg], [Nmess], XMess(0), filnam, Leverage(0))

What is wrong with the above? How can I pass a string to a DLL?

Thanks for any help

Christoph