Forum > General

The EnumChildWindows compilation error

(1/2) > >>

yazigegeda:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls,   windows; type   { TForm1 }   TForm1 = class(TForm)    Label1: TLabel;    ListBox1: TListBox;    ListView1: TListView;     procedure FormCreate(Sender: TObject);     function WindowsToList(_para1:HWND; _para2:LPARAM):WINBOOL;stdcall;   private   public   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin     EnumChildWindows(Form1.Handle,@WindowsToList,0);end; function TForm1.WindowsToList(_para1: HWND; _para2: LPARAM):WINBOOL;stdcall;begin end;   end.[size=10pt][/size]   

unit1.pas(44,49) Error: Incompatible type for arg no. 2: Got "<procedure variable type of function(QWord;Int64):LongBool of object;StdCall>", expected "<procedure variable type of function(QWord;Int64):LongBool;StdCall>"




I don't know what's wrong. Help me :'(

Bart:
Your function must not be part of a class (being a method of a class makes it "of object").

Bart

yazigegeda:

--- Quote from: Bart on May 14, 2024, 09:54:08 am ---Your function must not be part of a class (being a method of a class makes it "of object").

Bart

--- End quote ---


Oh, he bothered me for a long time. Thank you so much! O:-)

KodeZwerg:
User 440x has made some Windows Api examples, also for EnumChildWindows usage. Search on forum for his sources.

yazigegeda:

--- Quote from: KodeZwerg on May 14, 2024, 10:13:33 am ---User 440x has made some Windows Api examples, also for EnumChildWindows usage. Search on forum for his sources.

--- End quote ---


I'll check it out :'(

Navigation

[0] Message Index

[#] Next page

Go to full version