LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Problem using DLL written in C++

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




 
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
Deployment problem with Excel WorkbookProject written in C# Dr. Patrick Havel Excel Programming 0 October 16th 06 08:13 AM
Deployment problem with ExcelWorkbook Project written in C# Dr. Patrick Havel Setting up and Configuration of Excel 0 October 16th 06 08:13 AM
Problem with VBA code written in Excel 2002 working in Office 2003 [email protected] Excel Programming 2 July 11th 06 08:44 PM
xla written in C# Torben Laursen[_2_] Excel Programming 4 August 4th 05 08:45 PM
How do i calculate Written Down value Suresh Gagrani Excel Worksheet Functions 0 February 4th 05 07:29 AM


All times are GMT +1. The time now is 09:09 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"