NO

Author Topic: 'struct IScriptError * *' expected 'struct IScriptError * *'  (Read 6076 times)

Offline Robert

  • Member
  • *
  • Posts: 245
'struct IScriptError * *' expected 'struct IScriptError * *'
« 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

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
'struct IScriptError * *' expected 'struct IScriptError * *'
« Reply #1 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
/Pelle

Offline Robert

  • Member
  • *
  • Posts: 245
'struct IScriptError * *' expected 'struct IScriptError * *'
« Reply #2 on: October 04, 2004, 07:45:38 PM »
Thank you Pelle, attached is the problematic code snippet.

Robert Wishlaw

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
'struct IScriptError * *' expected 'struct IScriptError * *'
« Reply #3 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
/Pelle

Offline Robert

  • Member
  • *
  • Posts: 245
'struct IScriptError * *' expected 'struct IScriptError * *'
« Reply #4 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

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
'struct IScriptError * *' expected 'struct IScriptError * *'
« Reply #5 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
/Pelle

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
'struct IScriptError * *' expected 'struct IScriptError * *'
« Reply #6 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
/Pelle

Offline Robert

  • Member
  • *
  • Posts: 245
pocc_2_90_12.zip
« Reply #7 on: October 05, 2004, 08:24:05 PM »
pocc_2_90_12 does work for me.

Thank you for the repairs.

Robert Wishlaw