Autor Beitrag
kaiserbert
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Fr 28.05.04 16:55 
Hallo,

Habe ein Eingabefeld vom Typ TMaskedit in dem ich meinen Namen eintragen will, danach will ich auf den ok-Button klicken vom Typ TButton und er soll den Eintrag in dem Eingabefeld in meine onklcick Procedur vom Ok-Button(da wo jetzt bert steht in dem Procedure Code, s.u.) verwenden. Wie mache ich das?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
//hier meine OnKlick Procedure:

procedure TForm1.general_okClick(Sender: TObject);
begin
  ner.dwType       := RESOURCETYPE_DISK;
  ner.lpLocalName  := 'H:';
  ner.lpRemoteName := '\\feld-server\log';
  ner.lpProvider   := nil;

  res              := WNetAddConnection2(ner,
    'Password',
    'bert',
    0);

  if(res = NO_ERROR) then ShowMessage('Super, klappt ja!')
    else ShowMessage(Format('Fehler %d',[res]));

end;




mfg bert

Moderiert von user profile iconPeter Lustig (17:59, 28.05.2004): Delphi-Tags hinzugefügt
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Fr 28.05.04 19:33 
so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
res              := WNetAddConnection2(ner,
    'Password',
    PChar(MaskEdit1.Text),
    0);

(ich nehm einfach mal an, dass PChar gebraucht wird, wenn nicht, dann lass das PChar() weg)

raziel

_________________
JSXGraph
kaiserbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Fr 28.05.04 22:38 
Danke schön für den Tip.
Hat super hingehauen.


mfg bert