Calling convention of overriden methods

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
baramuse
Posts: 98
Joined: Tue Nov 29, 2022 8:31 am
Location: France

Calling convention of overriden methods

Post by baramuse »

Hi,

I'm trying to target Vo as dialect, code is Vulcan.net for now
But I have two last errors I can't figure out :

Code: Select all

Error	XS9041	Override of virtual method 'SetFilter' in child class has STRICT calling convention but overridden method in parent class is CLIPPER.	Locasyst.WebServices.Lib.XSharp	Serveurs Definitions.prg	618	
and that's the code :

Code: Select all

  PUBLIC METHOD SetFilter( cFiltre AS USUAL ) AS USUAL // AS STRING ) AS LOGIC
  // Interception du filtre pour gérer le filtre FTS, "Contains" n'est pas trouvé par la MacroCompiler Vulcan
  LOCAL lOk       AS LOGIC
  // LOCAL nHnd      AS IntPtr
  LOCAL pszFilter AS PSZ

    IF SELF:IsAds .AND. cFiltre = "Contains( *, '"                  // Filtre FTS
      // nHnd := SELF:Info( DBI_GET_ACE_TABLE_HANDLE2 )             // Handle ADS de la table
      pszFilter := String2Psz( cFiltre )
      AdsSetFilter( SELF:AdsHandle, pszFilter )  // nHnd
      lOk := TRUE
    ELSE
      lOk := SUPER:SetFilter(cFiltre)
    ENDIF

  RETURN lOk
what am I missing ?
User avatar
robert
Posts: 4551
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Calling convention of overriden methods

Post by robert »

Basile,
If the class is a DbServer subclass then it has to be:

Code: Select all

PUBLIC METHOD SetFilter( cFiltre  ) AS USUAL 
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
baramuse
Posts: 98
Joined: Tue Nov 29, 2022 8:31 am
Location: France

Re: Calling convention of overriden methods

Post by baramuse »

robert wrote: Mon Nov 18, 2024 2:44 pm Basile,
If the class is a DbServer subclass then it has to be:

Code: Select all

PUBLIC METHOD SetFilter( cFiltre  ) AS USUAL 
Robert
I tried that but then it's complaining about not having a type :
Severity Code Description Project File Line Suppression State
Error XS1031 Type expected Locasyst.WebServices.Lib.XSharp Serveurs Definitions.prg 618
User avatar
robert
Posts: 4551
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Calling convention of overriden methods

Post by robert »

Basile,

Try this then

PUBLIC METHOD SetFilter( cFiltre ) AS USUAL CLIPPER

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
LeoFreskos
Posts: 1
Joined: Mon Nov 18, 2024 8:02 am
Location: USA

-

Post by LeoFreskos »

Of course its possible that this was based on a different version of the .lib file which does use the C calling convention. If not, you should fold this change in.
Post Reply