![]() |
Datenmodul Zugriffsproblem
Hallo!
Ich habe folgenden Code:
Delphi-Quellcode:
Beim Aufruf von "POP3ServerStop" oder von "POP3ServerIsRunning" bekomme ich eine Speicherzugriffsverletzung...
unit uMailConnectionDataModule;
interface uses SysUtils, Classes, IdSMTPServer, IdSMTP, IdTCPServer, IdPOP3Server, IdComponent, IdTCPConnection, IdTCPClient, IdMessageClient, IdPOP3, IdBaseComponent, IdMessage, Sockets, IdThreadMgr, IdThreadMgrDefault; type TMailConnectionDataModule = class(TDataModule) POP3Client: TIdTCPClient; POP3Server: TIdTCPServer; private { Private-Deklarationen } ... public { Public-Deklarationen } function POP3ServerIsRunning : Boolean; ... procedure POP3ServerStop; ... end; var MailConnectionDataModule: TMailConnectionDataModule; implementation function TMailConnectionDataModule.POP3ServerIsRunning : Boolean; begin Result := POP3Server.Active end; procedure TMailConnectionDataModule.POP3ServerStop; begin POP3Server.Active := False end; end. Aber das hier funktioniert:
Delphi-Quellcode:
Wenn ich nicht die Variable voranstelle (wie im 1ten Code-Ausschnitt) bekomme ich eine Speicherzugriffsverletzung beim Aufrufen einer der Methoden... was mache ich falsch? Normalerweise sollte der Code aus dem 1ten Beispiel doch auch funktionieren, oder!?
...
function TMailConnectionDataModule.POP3ServerIsRunning : Boolean; begin Result := MailConnectionDataModule.POP3Server.Active end; procedure TMailConnectionDataModule.POP3ServerStop; begin MailConnectionDataModule.POP3Server.Active := False end; ... Gruß, Steffen |
Re: Datenmodul Zugriffsproblem
Eigentlich sollte es gehen. Versuche mal Self. anstatt der Form-Variable voranzustellen.
...:cat:... |
Re: Datenmodul Zugriffsproblem
Self geht nicht, das ist ja das komische...
|
Hilfe!
Kann mir hier bei keiner weiterhelfen? :?
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:44 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz