J
jliu1971
Hi,
I have written a DLL in C++ and was able to call it successfully from
a C++ program. However I am having a bit of problem calling it from a
Excel macro. The function is declared in the DLL as
extern "C" __declspec(dllexport) char* __stdcall SayHello(char
*infile);
and in VBA as
Declare Function SayHello Lib "TestHello.dll" (ByVal sin As String,
lenX As Long) As String
The SayHello function reads the lines from the input file, concat into
a long string and returns it as a char*. When the char* is shorter
than 20,000 the function runs fine. But when the file is large, I am
getting a gpf error. Is it becuase there is a limit on char*?
Thanks,
Jenn
I have written a DLL in C++ and was able to call it successfully from
a C++ program. However I am having a bit of problem calling it from a
Excel macro. The function is declared in the DLL as
extern "C" __declspec(dllexport) char* __stdcall SayHello(char
*infile);
and in VBA as
Declare Function SayHello Lib "TestHello.dll" (ByVal sin As String,
lenX As Long) As String
The SayHello function reads the lines from the input file, concat into
a long string and returns it as a char*. When the char* is shorter
than 20,000 the function runs fine. But when the file is large, I am
getting a gpf error. Is it becuase there is a limit on char*?
Thanks,
Jenn