Advertisement

HELP!! Open a HTML-File with C++ Builder??

Started by January 17, 2002 02:06 PM
4 comments, last by hewlett 22 years, 10 months ago
Hello I''m working with C++ Builder 5.0 and I would like to open a HTML-File. I tried it like: ShellExecute(NameFormular->Handle,"open", "C:\\index.html" ,NULL,NULL,SW_SHOWNORMAL); But I doens''t work! Whats the error?? Can you help me?? Thank you very much!! Hewlett
Try putting "" where you have those two NULL''s.

[Resist Windows XP''s Invasive Production Activation Technology!]
Advertisement
How''s about you try this:
HINSTANCE hSE_Return = ShellExecute(/*same parameters here*/);if(hSE_Return <= 32){  // error  switch(hSE_Return)  {    // do error handling here.  }} 

[MSDN] ShellExecute for function and return values descriptions.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
NULL is a valid value for arguments 4 and 5. See documentation referred to above.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
Hi

Thanks for your replies.

I doensn''t work. I don''t know, where''s the bug!! I tried it again like this:

void __fastcall TFormName::HelpClick(TObject *Sender)
{

int value =(int)ShellExecute(FormName->Handle,"open", "C:\\index.html", NULL,NULL,SW_SHOWNORMAL);
if(value<32)
Application->MessageBox("Error","Help",MB_APPLMODAL|MB_ICONSTOP|MB_OK);
}

I don''t get a message error from the compiler. It compile ; but when I click on the Object (menu), nothing happens.

Do you have any ideas?

hewlett
I get it!! I made two functions...



void __fastcall TFormName::HelpClick(TObject *Sender)
{
Help() ;
}

void __fastcall TFormName::Help()
{
int value =(int)ShellExecute(FormName->Handle,"open", "C:\\index.html", NULL,NULL,SW_SHOWNORMAL);
if(value<32)
Application->MessageBox("Error","Help",MB_APPLMODAL|MB_ICONSTOP|MB_OK);

}

Thanks!

hewlett




This topic is closed to new replies.

Advertisement