Advice on DLL parameters please

N

News

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
 
P

Phlip

News said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,918
Members
47,458
Latest member
Chris#

Latest Threads

Top