Solved

Calling a Function

Posted on 2006-11-29
6
249 Views
Last Modified: 2013-11-20
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!
0
Comment
Question by:Cyber-Drugs
6 Comments
 
LVL 30

Accepted Solution

by:
Axter earned 250 total points
ID: 18038239
Hi Cyber-Drugs,
> How would I call it?

You need a CStringArray object to call this function.

Example:
CStringArray MyStrArray;
//Then populate above array

//Then call the function
ExecuteScriptFunction("foofoo", MyStrArray);



David Maisonave (Axter)
Cheers!
0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 18038312
Sorry Axter,

I suppose what I meant was...

How do I populate a CStringArray?


Cheers!
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 18038417
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
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 22

Expert Comment

by:mahesh1402
ID: 18038461
more simple example related to variable argument is here :
http://www.codeproject.com/cpp/C___Variable_Arguments.asp

-MAHESH
0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 18038488
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!
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 250 total points
ID: 18039223
CStringArray ar;

ar.Add("string1");
ar.Add("string2");
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question