Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Please help to fix an error

Hi,

I compiled my application in release mode and when I try to run it I get an error:

(this->get_Item(Index,(LPDISPATCH*)&RHS)) Error:C0000005 (-1073741819) @C:/program files/borland/cbuilder6/include/vcl/Excel_2k.h/9908

Here is my code:
...
try {
ExcelApplication1->Connect();
ExcelApplication1->set_Visible(true,true);
ExcelApplication1->set_DisplayAlerts(0,false);
ExcelWorkbook1->ConnectTo(ExcelApplication1->Workbooks->Add());
ExcelWorksheet1->ConnectTo(ExcelApplication1->Worksheets->get_Item(TVariant)1));
...

An error occurs while executing that last line. Any suggestion how to fix it? I can't understand why it isn't correct... :(
[749 byte] By [SpookyDescendan] at [2007-11-11 10:05:18]
# 1 Re: Please help to fix an error
What was the error?
jonnin at 2007-11-11 20:59:31 >
# 2 Re: Please help to fix an error
Maybe u missed the comma here :

get_Item(TVariant)1)

mst be :
get_Item(TVariant),1)

the error point exactly to this function so is that the problem ?
Amahdy at 2007-11-11 21:00:25 >
# 3 Re: Please help to fix an error
What was the error?

Hi, jonnin,

I posted that error message above.
SpookyDescendan at 2007-11-11 21:01:30 >
# 4 Re: Please help to fix an error
Maybe u missed the comma here :

get_Item(TVariant)1)

mst be :
get_Item(TVariant),1)

the error point exactly to this function so is that the problem ?

Hi, Amahdy,

it doesn't work. Problem is not a comma probably.
SpookyDescendan at 2007-11-11 21:02:35 >
# 5 Re: Please help to fix an error
check if TVariant is a suitabel index and 1 can be passed to your RHS , if all is correct so check into the function itself maybe the problem is there coz the error contains "this" ..
Amahdy at 2007-11-11 21:03:28 >
# 6 Re: Please help to fix an error
All I could find on the web were some references that say for error C0000005 to delete the .TDS file and try again, possible file corruption.
jonnin at 2007-11-11 21:04:28 >