By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,820 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,820 IT Pros & Developers. It's quick & easy.

Advice on DLL parameters please

P: n/a
Hi,

I have an Excel spreadsheet that contains a VBA macro. However, this runs
slowly! I have written the code in C++ which works. Currently the
interface between the VBA / Excel system and the C++ program is via a file.
i.e. data is exported in Excel & read into the C++ program, processed &
written out to a file by C++ & them imported into Excel.

I know I can use a DLL written in C++ & callable from VBA (i've already done
that). I've mastered the problems of calling a DLL with an array parameter
sucessfully too. My question is, is there a maximum amount of data that I
can pass through a DLL call? Either a physical maximum limit, or an
advisable maximum.

Any advice / explanation would be greatly appreciated.

Thanks

Simon
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
News wrote:
I have an Excel spreadsheet that contains a VBA macro.
For best results, use Google Groups to find newsgroups that cover VBA. We'l
try to help, but only if you promise to follow up on a better group.
However, this runs
slowly! I have written the code in C++ which works. Currently the
interface between the VBA / Excel system and the C++ program is via a file. i.e. data is exported in Excel & read into the C++ program, processed &
written out to a file by C++ & them imported into Excel.
That's slow simply because the data thread thru import systems tuned to
databases, not flat text files.
I know I can use a DLL written in C++ & callable from VBA (i've already done that). I've mastered the problems of calling a DLL with an array parameter
sucessfully too. My question is, is there a maximum amount of data that I
can pass through a DLL call? Either a physical maximum limit, or an
advisable maximum.


Call the DLL over and over again. That's still going to be faster.

The number of elements allowed in a C++ array is implementation-defined, but
it's not worth knowing. If you tried to put in thousands, they'd force the
stack to re-page, so you'd be slow again.

Next time you do this, learn ActiveX. The ATL library makes building quicky
little wrappers very easy.

--
Phlip
http://www.xpsd.org/cgi-bin/wiki?Tes...UserInterfaces
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.