Link to home
Start Free TrialLog in
Avatar of Cyber-Drugs
Cyber-DrugsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Calling a Function

Hi guys,

I have this function:

ExecuteScriptFunction(const CString strFunc,  const CStringArray& paramArray)


How would I call it?


String value, Array
String value, lots of string values


?


Cheers!
ASKER CERTIFIED SOLUTION
Avatar of Axter
Axter
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cyber-Drugs

ASKER

Sorry Axter,

I suppose what I meant was...

How do I populate a CStringArray?


Cheers!
why not to use VARIABLE ARGUMENT FUNCTION with which you can pass unlimited no. (varaible) of arguments to function....just like printf().. as you know you may pass any no. of arguments to printf().. you may also have such type of function...

so that in function itself you may pass any no. strings  as parameters like :
ExecuteScriptFunction(const CString strFunc, strArg1,strArg2,strArg3......)

Look here for how to declare and define them :
http://www.codeproject.com/cpp/argfunctions.asp
http://www.codeguru.com/cpp/cpp/cpp_mfc/functions/article.php/c4025/

-MAHESH
more simple example related to variable argument is here :
http://www.codeproject.com/cpp/C___Variable_Arguments.asp

-MAHESH
Hi Mahesh,

Thank you for all the detailed links, and I will be reading them to learn a few new tricks, but for this question I'm basically looking for something I can cut and paste into C++ to test if the function works properly...

As you helped write the function, maybe you could show me how to use it?

Cheers!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial