Problem with interfaces (FPC) 
Author Message
 Problem with interfaces (FPC)

I try to use interfaces in FPC 1.1 (today snapshot and 2001/12/16).

At all calls of QueryInterface I have "Access Violation" exception. Is it
implementation bug or my mistakes?

--
----------
      Ivan Shikhalev

http://www.*-*-*.com/
http://www.*-*-*.com/



Mon, 26 Jul 2004 23:51:03 GMT  
 Problem with interfaces (FPC)

Quote:

> I try to use interfaces in FPC 1.1 (today snapshot and 2001/12/16).

> At all calls of QueryInterface I have "Access Violation" exception. Is it
> implementation bug or my mistakes?

Hard to say without code ;-)


Tue, 27 Jul 2004 01:31:50 GMT  
 Problem with interfaces (FPC)

Quote:
> Hard to say without code ;-)

-------------- Code ---------------

{$apptype console}
{$longstrings on}
{$mode objfpc}
{$rangechecks off}

program Test;

uses
  Windows,
  SysUtils;

type
  ITest = interface
    procedure doTest;
  end;

  TTest = class(TInterfacedObject, ITest)
    destructor Destroy; override;
    procedure doTest;
  end;

destructor TTest.Destroy;
 begin
 WriteLn ('Destroy');
 end;

procedure TTest.doTest;
 begin
 WriteLn ('doTest');
 end;

var
  I :ITest;
  IU :IUnknown;
  I2 :ITest;

begin
I := TTest.Create;
IU := I;
IU.QueryInterface (ITest, I2);  // AV in this line
WriteLn (dword(I));
WriteLn (dword(IU));
WriteLn (dword(I2));
I2.doTest
end.

----------- End of Code ---------

--
----------
      Ivan Shikhalev

http://fpc.by.ru/
http://iws.by.ru/



Tue, 27 Jul 2004 02:06:06 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. fpc usb device interface available

2. FPC:problem with printing from fpc programs

3. FPC: translate execvp from c to FPC

4. Problems using the MS-DOS Real-time Compression Interface (MRCI)

5. Interrupt interface problem in TSR

6. Problem with include/Interface files

7. Problem: Remote interface not licenceed

8. Some problem with FPC and Gtk

9. FPC - Socket Problem

10. FPC problems!

11. FPC: no more linking problems

12. problems with Free Pascal Editor IDE for FPC

 

 
Powered by phpBB® Forum Software