Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
AFAIK Having declared the sub you just need to pass the comma delimite
variables without brackets (either as hard code or variable names) This works with API calls. eg. MySubroutine 1,"Astring" If you want a returned value, you have to declare a function and us the form :- x = MyFunction MyNumberVariable, MyStringVariabl -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change 3 letter text string to a number string | Excel Discussion (Misc queries) | |||
Passing Query String into MS Excel | Excel Discussion (Misc queries) | |||
Passing string as array variable (Pivot VBA) | Excel Discussion (Misc queries) | |||
Property Let: assign return value of Double when passing String | Excel Discussion (Misc queries) | |||
PASSING A STRING VALUE | Excel Programming |