Board index » cppbuilder » olesyserror (unknown interface)

olesyserror (unknown interface)


2003-12-23 03:52:25 PM
cppbuilder54
I'm using the chart FX with C++builder 6.
My ChartFX->OpenDataEx(COD_VALUES,5,2) does not work. I get a Unknown
interface. Does anyone have solution to this problem?
here attached the code:
[...]
#include "chartfx.hpp"
#include "chartfx3.hpp"
[...]
[...]
Chartfx1->OpenDataEx(COD_VALUES,1, 25);
Chartfx1->ThisSerie=0;
for (k=0;k==25;k++)
{
Chartfx1->Value[k]=9;
}
[...]
 
 

Re:olesyserror (unknown interface)

On my machine, building with runtime packages
(Project->Options->Packages->Build with runtime packages ticked) doesn't
produce the error.
Is this the case for you?
BTW your for loop in incorrect...
void __fastcall TForm1::Button1Click(TObject *Sender)
{
try
{
Chartfx1->OpenDataEx(COD_VALUES, 1, 25);
Chartfx1->ThisSerie = 0;
for (int k = 0;k < 25; ++k)
Chartfx1->Value[k] = 9;
}
__finally
{
Chartfx1->CloseData(COD_VALUES);
}
}
Stew
"BG" < XXXX@XXXXX.COM >wrote in message
Quote
I'm using the chart FX with C++builder 6.
My ChartFX->OpenDataEx(COD_VALUES,5,2) does not work. I get a Unknown
interface. Does anyone have solution to this problem?

here attached the code:

[...]
#include "chartfx.hpp"
#include "chartfx3.hpp"
[...]

[...]
Chartfx1->OpenDataEx(COD_VALUES,1, 25);
Chartfx1->ThisSerie=0;
for (k=0;k==25;k++)
{
Chartfx1->Value[k]=9;
}
[...]


 

Re:olesyserror (unknown interface)

Thank you!
runtime packages unticked was the problem...
Have a nice day!
"Big Stew" < XXXX@XXXXX.COM >ha scritto nel messaggio
Quote
On my machine, building with runtime packages
(Project->Options->Packages->Build with runtime packages ticked) doesn't
produce the error.
Is this the case for you?

BTW your for loop in incorrect...

void __fastcall TForm1::Button1Click(TObject *Sender)
{
try
{
Chartfx1->OpenDataEx(COD_VALUES, 1, 25);
Chartfx1->ThisSerie = 0;
for (int k = 0;k < 25; ++k)
Chartfx1->Value[k] = 9;
}
__finally
{
Chartfx1->CloseData(COD_VALUES);
}
}

Stew



"BG" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>I'm using the chart FX with C++builder 6.
>My ChartFX->OpenDataEx(COD_VALUES,5,2) does not work. I get a Unknown
>interface. Does anyone have solution to this problem?
>
>here attached the code:
>
>[...]
>#include "chartfx.hpp"
>#include "chartfx3.hpp"
>[...]
>
>[...]
>Chartfx1->OpenDataEx(COD_VALUES,1, 25);
>Chartfx1->ThisSerie=0;
>for (k=0;k==25;k++)
>{
>Chartfx1->Value[k]=9;
>}
>[...]
>
>


 

{smallsort}

Re:olesyserror (unknown interface)

Well, there is still a problem, because the component should still work
without runtime packages, but it doesn't.
I have managed to get around this problem by creating a new component (I
called mine TMyChartfx).
Do this via the Project->Import Type Library menu and tick "Generate
component wrapper".
You will have to rename the class (from TChartfx to TMyChartfx for example),
and I installed it into the dclusr package.
The component then works whether you build with runtime packages or not.
However, you then run into the type library bug, mentioned a few posts ago,
that makes properties read only!
So you need to manually edit the ChartfxLib_OCX.h for all property
declarations as follows
// __property double Value[short index]={ read=get_Value };
__property double Value[short index]={ read=get_Value , write =
set_Value};
Once you've done that, everything should work OK :)
Stew
"BG" < XXXX@XXXXX.COM >wrote in message
Quote
Thank you!

runtime packages unticked was the problem...

Have a nice day!
 

Re:olesyserror (unknown interface)

Quote
So you need to manually edit the ChartfxLib_OCX.h for all property
declarations as follows

// __property double Value[short index]={ read=get_Value };
__property double Value[short index]={ read=get_Value , write =
set_Value};

Once you've done that, everything should work OK :)

Stew

i've done that, but i encountered an error about the modified line:
__property _DChartfxDisp ControlInterface={ read=GetDefaultInterface,
write=SetDefaultInterface };
with the message: "SetDefaultInterface is not a member of TMyChartfx"
without modify this property the component Chartfx cause the same error
(unknown interface)
could you help me? (one more time)
Thanks a lot.
bye.
 

Re:olesyserror (unknown interface)

ControlInterface is a read only property, so there is no
SetDefaultInterface();
Stew
"BG" < XXXX@XXXXX.COM >wrote in message
Quote
i've done that, but i encountered an error about the modified line:

__property _DChartfxDisp ControlInterface={ read=GetDefaultInterface,
write=SetDefaultInterface };

with the message: "SetDefaultInterface is not a member of TMyChartfx"