Recent

Author Topic: definition problem in activex.pp  (Read 1289 times)

440bx

  • Hero Member
  • *****
  • Posts: 6350
definition problem in activex.pp
« on: July 07, 2025, 01:28:56 pm »
Hello,

the following definitions appear in activex.pp:
Code: Pascal  [Select][+][-]
  1.   { OLE 1.0 conversion APIS  }
  2.   {**** OLE 1.0 OLESTREAM declarations ************************************ }
  3.  
  4.   type
  5.      LPOLESTREAM = ^_OLESTREAM;
  6.      _OLESTREAMVTBL = record
  7.        Get : function (p : POleStr;out o;dw : DWORD) : DWORD;
  8.        Put : function (p : POleStr;const o;dw : DWORD) : DWORD;
  9.      end;
  10.      OLESTREAMVTBL =  _OLESTREAMVTBL;
  11.  
  12.      LPOLESTREAMVTBL = OLESTREAMVTBL;
  13.  
  14.      _OLESTREAM = record
  15.           lpstbl : LPOLESTREAMVTBL;
  16.        end;
  17.      OLESTREAM = _OLESTREAM;
  18.  
the functions Put and Get are CALLBACK functions, as such they should be declared as "stdcall". 
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Zvoni

  • Hero Member
  • *****
  • Posts: 3355
Re: definition problem in activex.pp
« Reply #1 on: July 07, 2025, 01:44:05 pm »
Your line 12 is also wrong
Code: C  [Select][+][-]
  1. typedef struct _OLESTREAM* LPOLESTREAM;
  2. typedef struct _OLESTREAMVTBL {
  3.         DWORD   (CALLBACK *Get)(LPOLESTREAM,LPSTR,DWORD);
  4.         DWORD   (CALLBACK *Put)(LPOLESTREAM,LPSTR,DWORD);
  5. } OLESTREAMVTBL;
  6. typedef OLESTREAMVTBL*  LPOLESTREAMVTBL;
  7. typedef struct _OLESTREAM {
  8.         LPOLESTREAMVTBL lpstbl;
  9. } OLESTREAM;
Line 6 is a Pointer

should be
Code: Pascal  [Select][+][-]
  1. LPOLESTREAMVTBL = ^OLESTREAMVTBL;
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

440bx

  • Hero Member
  • *****
  • Posts: 6350
Re: definition problem in activex.pp
« Reply #2 on: July 07, 2025, 01:45:51 pm »
Your line 12 is also wrong
You're right, I didn't notice that one.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12770
  • FPC developer.
Re: definition problem in activex.pp
« Reply #3 on: July 07, 2025, 01:52:12 pm »
Done, both.

 

TinyPortal © 2005-2018