C++ Builder 5 AddMethod with Object's

I'm a C++ Builder 5 user....

See this usation:
....
Script->AddMethod("procedure CopyToSDF(source :TDataSet; filename:String)",(this)->SettiStruCallMethod,"ctOther","Saves a dataset in TXT file...");
...

On SettiStruCallMethod, method.....

.....
if (MethodName == "COPYTOSDF")
{
CopyToSDF((TDataSet *)Params.GetElement(0).ArrayLock(),(AnsiString)Params.GetElement(1));
}

Compile, and run but ocours runtime error "Variant is not Array" when CopyToSDF is used in Script.
....
if (MethodName == "COPYTOSDF")
{
CopyToSDF((TDataSet *)Params.GetElement(0),(AnsiString)Params.GetElement(1));
}

Does not Compile, ocours a erro "Cannot convert a Variant to TDataSet *)

....
if (MethodName == "COPYTOSDF")
{
CopyToSDF((TDataSet *)&Params.GetElement(0),(AnsiString)Params.GetElement(1));
}

Compile, and run but ocours runtime error "Access Violation" when CopyToSDF is used in Script.

....
if (MethodName == "COPYTOSDF")
{
CopyToSDF((TDataSet *)(int)Params.GetElement(0),(AnsiString)Params.GetElement(1));
}

Does not Compile, ocours a erro "Cannot convert a Int to TDataSet *)

....
if (MethodName == "COPYTOSDF")
{
CopyToSDF((TDataSet *)(int *)Params.GetElement(0),(AnsiString)Params.GetElement(1));
}

Compile, and run but ocours runtime error "Access Violation" when CopyToSDF is used in Script.


Any Ideias????

Please help-me

[]'s from Brazil.

Egidio.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.