type TGagGraph = class(Tobject) type ImageInfo = record width : integer; height:integer; srcDC,bufDC: hdc; end; var imgInf:imageinfo; procedure repaint_dc; constructor Create; end; implementation constructor TGagGraph.Create; begin imginf.width:=0; // <------- Exception class EAccsesViolation with messgae 'Accses violation at adress 00435eaf in module re.exe'. end; //============================= var q: tgaggraph; begin q.create; end; 

what to do?

    1 answer 1

    Try to define class + entry like this:

      ImageInfo = record width : integer; height:integer; srcDC,bufDC: hdc; end; type TGagGraph = class(Tobject) imgInf:imageinfo; procedure repaint_dc; constructor Create; end; 

    And then call the constructor SO:

     ..... obj:TGagGraph; begin obj:=TGagGraph.Create; .... 

    Everything works !

    • Thank you very much! Everything works with a bang! - Ololo
    • Naughty =) - AseN