Pelles C forum

Pelles C => General discussions => Topic started by: Robert on October 04, 2004, 10:42:57 AM

Title: 'struct IScriptError * *' expected 'struct IScriptError * *'
Post by: Robert on October 04, 2004, 10:42:57 AM
I do not understand the following. I would appreciate any assistance.

snip.c(374): error #2140: Type error in argument 2 to a function;
found 'struct IScriptError * *' expected 'struct IScriptError * *'.

where line 374 is

HResult = pSC->lpVtbl->get_Error(pSC, &pScriptError);

and pScriptError is

  IScriptError* pScriptError;

Thank you

Robert Wishlaw
Title: 'struct IScriptError * *' expected 'struct IScriptError * *'
Post by: Pelle on October 04, 2004, 12:12:21 PM
Hm. I don't understand either. Some information seems to be lost in the error message.

Do you have some code I can test on, or at least the definitions for pSC, IScriptError, get_Error...?

Pelle
Title: 'struct IScriptError * *' expected 'struct IScriptError * *'
Post by: Robert on October 04, 2004, 07:45:38 PM
Thank you Pelle, attached is the problematic code snippet.

Robert Wishlaw
Title: 'struct IScriptError * *' expected 'struct IScriptError * *'
Post by: Pelle on October 04, 2004, 10:42:12 PM
The problem is that when declaring the IScriptControl structure (specifically get_Error) IScriptError is not yet known, so the type is incomplete. When you later define "IScriptError* pScriptError" in VBS_ERROR(), IScriptError *is* known. This is enough to upset the compiler. Will have to do something about this.

For the moment, putting:
DECLARE_INTERFACE_(IScriptError, IDispatch) ...
*before*:
DECLARE_INTERFACE_(IScriptControl, IDispatch) ...
seems to fix it.

Anyway, I need to modify the compiler. Thanks for the report.

Pelle
Title: 'struct IScriptError * *' expected 'struct IScriptError * *'
Post by: Robert on October 04, 2004, 11:18:05 PM
Thank you Pelle.

I will have a look at the BCX translator and see if the ordering routine can be easily rewritten. I suspect that this also is a problem with Pelle's C and the other VBS functions in BCX although I have not yet checked them out.

Robert Wishlaw
Title: 'struct IScriptError * *' expected 'struct IScriptError * *'
Post by: Pelle on October 05, 2004, 12:39:03 AM
OK.

I will post a new version of the compiler when I have fixed the problem. For the moment it's not working the way I want it to...

Pelle
Title: 'struct IScriptError * *' expected 'struct IScriptError * *'
Post by: Pelle on October 05, 2004, 04:33:28 PM
Attached is C compiler version 2.90.12 - it works for snip.c, and everything else I have tested so far. Can you please check if this works for you too...?

Pelle
Title: pocc_2_90_12.zip
Post by: Robert on October 05, 2004, 08:24:05 PM
pocc_2_90_12 does work for me.

Thank you for the repairs.

Robert Wishlaw