Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: User clicks Pin
llp00na8-May-06 8:37
llp00na8-May-06 8:37 
GeneralRe: User clicks Pin
David Crow8-May-06 8:51
David Crow8-May-06 8:51 
GeneralRe: User clicks Pin
llp00na8-May-06 9:14
llp00na8-May-06 9:14 
GeneralRe: User clicks Pin
David Crow8-May-06 9:25
David Crow8-May-06 9:25 
GeneralRe: User clicks Pin
llp00na8-May-06 9:29
llp00na8-May-06 9:29 
GeneralRe: User clicks Pin
David Crow8-May-06 9:33
David Crow8-May-06 9:33 
GeneralRe: User clicks Pin
llp00na8-May-06 12:47
llp00na8-May-06 12:47 
QuestionPassing the FP Struct from Excel to C++ Pin
Sameday10008-May-06 6:25
Sameday10008-May-06 6:25 
Hello,

I am writing Win32 DLL that exports functions to Excel. I use the Floating Point
Array Structure in C to pass Excel ranges :

typedef struct _FP
{
unsigned short int rows;
unsigned short int columns;
double array[1];
} FP;

I want to call the exported function from the dll directly in the Excel cells as an array formula via a declaration of the function in a VBA module as opposed to using an .XLL:

extern __declspec(dllexport) void __stdcall SimpleExample(FP *arr){
for(int j=1;j<=5;j++){
arr->array[j]=arr->array[j]*2;
}
}
(the range of cells is 5 long)

Public Declare Function DLLFunction Lib "Mydll.dll" Alias
"?SimpleExample@@YGXPAU_FP@@@Z"(ByRef outarr As double) As Double

However Excel needs to know that the argument passed in is to be "modified in
place" and returned to the calling cells using the Return Type, in this case "1K" - the first and only argument is a FP struct and is to be used as the return parameter.

If the function is registered in VBA -where does this return type code information code go? - in the ".def"
file?

Many thanks in advance for any assistance.
AnswerRe: Passing the FP Struct from Excel to C++ Pin
Andy Moore8-May-06 7:01
Andy Moore8-May-06 7:01 
GeneralRe: Passing the FP Struct from Excel to C++ Pin
Sameday100010-May-06 7:13
Sameday100010-May-06 7:13 
QuestionADS Users Pin
e-DJ8-May-06 6:16
e-DJ8-May-06 6:16 
AnswerRe: ADS Users Pin
David Crow8-May-06 8:16
David Crow8-May-06 8:16 
GeneralRe: ADS Users Pin
e-DJ9-May-06 6:30
e-DJ9-May-06 6:30 
QuestionRe: ADS Users Pin
David Crow10-May-06 3:53
David Crow10-May-06 3:53 
QuestionHow to read File Attributes Pin
e-DJ8-May-06 6:14
e-DJ8-May-06 6:14 
AnswerRe: How to read File Attributes Pin
David Crow8-May-06 8:13
David Crow8-May-06 8:13 
QuestionHow to get Lan Speed? Pin
nagamohan_p8-May-06 5:47
nagamohan_p8-May-06 5:47 
AnswerRe: How to get Lan Speed? Pin
David Crow8-May-06 8:08
David Crow8-May-06 8:08 
GeneralRe: How to get Lan Speed? Pin
nagamohan_p8-May-06 20:26
nagamohan_p8-May-06 20:26 
Questiondecimal numbers conversion Pin
marmosha8-May-06 4:49
marmosha8-May-06 4:49 
AnswerRe: decimal numbers conversion Pin
Cedric Moonen8-May-06 4:55
Cedric Moonen8-May-06 4:55 
GeneralRe: decimal numbers conversion Pin
marmosha8-May-06 5:03
marmosha8-May-06 5:03 
GeneralRe: decimal numbers conversion Pin
Cedric Moonen8-May-06 5:35
Cedric Moonen8-May-06 5:35 
AnswerRe: decimal numbers conversion Pin
David Crow8-May-06 5:38
David Crow8-May-06 5:38 
GeneralRe: decimal numbers conversion Pin
Eytukan8-May-06 6:34
Eytukan8-May-06 6:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.