Autor Beitrag
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Fr 21.02.03 14:41 
boa heute iss ma wieder einer der tage an dem am besten im bett geblieben wäre :(

kann mir ma einer sagen was da falsch ist??



ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TfrmInfD.BitBtn1Click(Sender: TObject);
var   ExcelD,ExcelP  : String;
begin
  ExcelP:= ExtractFilePath(Paramstr(0))+'\Files\';
  ExcelD:= ExtractFileName(ExtractFilePath(Paramstr(0))+'\Files\Db.xls');
  If FileExists(ExtractFilePath(Paramstr(0))+'\Files\Db.xls') then
    Begin
      If IstObjectActiv('Excel.Application') then ShowMessage('Excel ist activ!!!');
      ShellExecute(Application.Handle, 'open' ,PChar(ExcelD),nil,PChar(ExcelP),sw_ShowNormal);
    end
  else
    ShowMessage('Datei nicht vorhanden!');


speziell shellexecute ... er bringt keinen fehler .. er öffnet nur eben excel nicht :?
der dateinamen und pfad stimmt habe ich per breakpoints schon überprüft ... die file exsitiert er kommt auch bis in die zeile von shellexecute, nur er öffnet eben nich das programm ...

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
Popov
Gast
Erhaltene Danke: 1



BeitragVerfasst: Fr 21.02.03 14:50 
Nur so als Info:

ExtractFilePath liefert den Pfad mit einem "\" am Ende;

ExtractFileDir liefert den Pfad ohne ein "\" am Ende.

Überprüfe deinen Code auf diese Punkte. Vielleicht war es das schon.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Fr 21.02.03 19:36 
das application.handle kannst du auch rauslassen und durch 0 ersetzten und das open würd ich durch nil ersetzten !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 22.02.03 00:47 
matze hat folgendes geschrieben:
das application.handle kannst du auch rauslassen und durch 0 ersetzten und das open würd ich durch nil ersetzten !

Gibt es dafür irgendeine Begründung, die geforderten Parameter weg zu lassen? :roll:
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 22.02.03 12:00 
nicht wirklich, aber ich mach es immer so, denn in der OH ist auch nicht wirklich beschrieben, was die bringen !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 22.02.03 17:48 
Na dann versuch mal mit Shellexecute eine Textdatei zu drucken, das geht nämlich auch, ohne Hilfe des zweiten Parameters.

Zitat:

hwnd
[in] Handle to a parent window. This window receives any message boxes that an application produces, such as error reporting.
lpOperation
[in] Pointer to a null-terminated string, referred to in this case as a verb, that specifies the action to be performed. ...
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 23.02.03 11:01 
aha danke !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: So 23.02.03 16:46 
jaja habs geht scho danke ;)

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)