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: 5
Default C++ DLL from VBA

Hello all,
Trying to call a C++ function from VBA. Function is declared as
following in C++:

func(char[],int[],int)

The function reads the char*, does some manipulations on the data
within it, and writes the results to the int*. There are two things I
see as problems:
1) the int values in C++ are greater than the max value permitted in
VBA
2) not sure how to pass the parameters to the dll from VBA

I have been trying some combination of the following:

func(ByRef string, ByRef int(1), ByVal int)
i.e. sending down the address of the string, the address of the
first element of the integer array and the value of an integer which
corresponds to the number of iterations that are required for some
processing done in the C++ code. Can anyone suggest how to address the
two problems above? As it stands now, the code completely shuts down
Excel without even a warning. Some illegal memory addressing I guess
but not sure how to get around it. Thanks in advance.

 
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



All times are GMT +1. The time now is 11:10 PM.

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"