Autor Beitrag
Minime
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Fr 20.10.06 21:35 
Jo also hallo erstmal

ich hab für mein kleines programm ein plugin geschrieben
(Chat Plugin) und das geht auch hervorragend
das einzige problem ist nur das mit dem jetzigen code die
in der Dll gespeicherte Form extrem hakt
ich nehme mal an das das von der TCommunicate Class abhängt

jemand eine idee?

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
library cl_chat;
uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, ComCtrls, ToolWin, StdCtrls,
  ChatUnit in 'ChatUnit.pas' {ChatForm};

type
  TCommunicate = class
    procedure KeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);
    procedure ButtonClick(Sender: TObject);
   end;

var SendData : procedure(pName,pText:pchar);
    Communicator : TCommunicate;
{$R *.res}

procedure SendText(Name,Text:string);
begin
  if @SendData <> nil then
    begin
      SendData(pchar(Name),pchar(Text));
    end;
end;

function GetUser:string;
var
  buffer : array[0..MAX_PATH] of Char;
  Size: DWORD;
begin
  Size := sizeof(buffer);
  GetUserName(buffer, size);
  SetString(Result, buffer, lstrlen(buffer));
end;



procedure StartChat(SendAddr:pointer);
begin
try
SendData := SendAddr;
Application.CreateForm(TChatForm, ChatForm);
ChatForm.RichEdit2.OnKeyDown := Communicator.KeyDown;
ChatForm.SpeedButton2.OnClick := Communicator.ButtonClick;
finally
ChatForm.Show;
end;
end;

procedure GetChatText(pName,pText:pchar);
begin
ChatForm.RichEdit1.Lines.Add('{b'+string(pName)+'}'+':'+' '+string(pText));
end;

//=======INTERFACE=================================
//=================================================

[color=red]procedure TCommunicate.KeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);
begin
if key = 13 then
  begin
    SendText(GetUser,ChatForm.RichEdit2.Text);
    ChatForm.RichEdit2.Clear;
  end;
end;

procedure TCommunicate.ButtonClick(Sender: TObject);
begin
SendText(GetUser,ChatForm.RichEdit2.Text);
ChatForm.RichEdit2.Clear;
end;

exports GetChatText,StartChat;

begin
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 20.10.06 23:40 
user profile iconMinime hat folgendes geschrieben:
die in der Dll gespeicherte Form extrem hakt


Kannst du "hakt" genauer definieren? Ich kann mir nichts drunter vorstellen.

AXMD
Minime Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Sa 21.10.06 08:45 
lol naja das das programm wenn ich in das richedit etwas eingebe die buchstaben exzrem verzögert erscheinen
ich gebe zb ein "hallo" und nach 1 sek H 2sek a usw.

das richedit hat als OnKeyDown den Communicate.OnKeyDown event
Minime Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Sa 21.10.06 20:07 
mhhh application.peocessmessages funktioniert auch nicht dann braucht das nur mehr zeit zum laden ..
verzweifelt

hat niemand mal forms in einer dll gespeichert?