Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default string passing to DLL

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
Passing Query String into MS Excel napval Excel Discussion (Misc queries) 0 June 19th 07 06:04 AM
Passing string as array variable (Pivot VBA) klingongardener Excel Discussion (Misc queries) 2 December 23rd 06 07:58 PM
Property Let: assign return value of Double when passing String Tetsuya Oguma Excel Discussion (Misc queries) 1 March 3rd 06 08:01 AM
PASSING A STRING VALUE Sirron Excel Programming 2 August 26th 03 06:40 PM


All times are GMT +1. The time now is 02:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"