Click here to Skip to main content
15,892,298 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Linked Lists in C++ Pin
Mark Salsbery7-Aug-07 17:46
Mark Salsbery7-Aug-07 17:46 
GeneralRe: Linked Lists in C++ Pin
ThatsAlok7-Aug-07 23:03
ThatsAlok7-Aug-07 23:03 
AnswerRe: Linked Lists in C++ Pin
David Crow7-Aug-07 17:25
David Crow7-Aug-07 17:25 
QuestionOpening Webfolder files - storing their paths Pin
anujpshah7-Aug-07 10:30
anujpshah7-Aug-07 10:30 
QuestionPassing a 2 Dim Array to a DLL written in C++ Pin
CK9387-Aug-07 9:44
CK9387-Aug-07 9:44 
QuestionRe: Passing a 2 Dim Array to a DLL written in C++ Pin
David Crow7-Aug-07 10:20
David Crow7-Aug-07 10:20 
AnswerRe: Passing a 2 Dim Array to a DLL written in C++ Pin
CK9387-Aug-07 12:07
CK9387-Aug-07 12:07 
QuestionRe: Passing a 2 Dim Array to a DLL written in C++ Pin
CK9387-Aug-07 12:13
CK9387-Aug-07 12:13 
Sorry...I posted the question as an answer

Well I would call my function in Excel as

=temp1(A1:C3)

So bascially taking in a 3 by 3
/-+-+-\
|0|1|2|
|3|4|5|
|6|7|8|
\-+-+-/

VBA:
Public Function temp1(ByRef weightArr As Variant) As Double

Dim wArr() As Double

ReDim wArr(0 To 2, 0 To 2) As Double

For i = 0 To 2
For j = 0 To 2

wArr(i, j) = weightArr(i + 1, j + 1)

Next j
Next i

temp1 = Func1(wArr(0, 0))

End Function


C++ DLL code:
double __declspec (dllexport) __stdcall Func1(double **WeightArray)
{
return WeightArray[0][0];
}



I tried calling =temp1(A1:C3) on my excel sheet and it crashed.
I'm pretty sure my DLL code is where the problem is, but I'm not sure how the parameter should be written. Do I use the ** or is there another way to write the function?

Thanks
GeneralRe: Passing a 2 Dim Array to a DLL written in C++ Pin
David Crow7-Aug-07 17:07
David Crow7-Aug-07 17:07 
QuestionRe: Passing a 2 Dim Array to a DLL written in C++ Pin
CK9388-Aug-07 3:38
CK9388-Aug-07 3:38 
QuestionClear the debug output window Pin
bob169727-Aug-07 9:15
bob169727-Aug-07 9:15 
AnswerRe: Clear the debug output window Pin
Jim Crafton7-Aug-07 9:34
Jim Crafton7-Aug-07 9:34 
AnswerRe: Clear the debug output window Pin
Mark Salsbery7-Aug-07 9:44
Mark Salsbery7-Aug-07 9:44 
GeneralRe: Clear the debug output window Pin
bob169727-Aug-07 10:12
bob169727-Aug-07 10:12 
GeneralRe: Clear the debug output window Pin
David Crow7-Aug-07 10:22
David Crow7-Aug-07 10:22 
GeneralRe: Clear the debug output window Pin
bob169727-Aug-07 19:21
bob169727-Aug-07 19:21 
GeneralRe: Clear the debug output window Pin
Mark Salsbery7-Aug-07 10:28
Mark Salsbery7-Aug-07 10:28 
GeneralRe: Clear the debug output window Pin
bob169727-Aug-07 19:44
bob169727-Aug-07 19:44 
AnswerRe: Clear the debug output window Pin
Hans Dietrich7-Aug-07 15:46
mentorHans Dietrich7-Aug-07 15:46 
GeneralRe: Clear the debug output window Pin
bob169727-Aug-07 19:31
bob169727-Aug-07 19:31 
GeneralRe: Clear the debug output window Pin
Hans Dietrich8-Aug-07 2:50
mentorHans Dietrich8-Aug-07 2:50 
GeneralRe: Clear the debug output window Pin
bob169728-Aug-07 3:18
bob169728-Aug-07 3:18 
GeneralRe: Clear the debug output window Pin
Mark Salsbery8-Aug-07 4:57
Mark Salsbery8-Aug-07 4:57 
Questionerror C2051: case expression not constant Pin
Cuziyq7-Aug-07 8:25
Cuziyq7-Aug-07 8:25 
AnswerRe: error C2051: case expression not constant Pin
Mark Salsbery7-Aug-07 8:40
Mark Salsbery7-Aug-07 8:40 

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.