Directing to a site Topic is solved
-
- Earned some good credits
- Posts: 103
- Joined: Mon Apr 17, 2006 1:24 pm
- Location: Philippines
- Contact:
Directing to a site
Hi just wanna ask what if i want to direct to the website using a single wxButton. After clicking the button it will open the browser and direct it to the specific website. How to do this?
wxHyperlinkCtrl
thanks
wxHyperlinkCtrl
thanks
WinXP SP2, VS.NET
wxDev-C++ 4.9.9.2, wxWindows-2.4.2
Need4Speed!
wxDev-C++ 4.9.9.2, wxWindows-2.4.2
Need4Speed!
cyrixware wrote:Can you show me some example? thanks
something like this:
Code: Select all
void MyDialog::OnButtonClick()
{
const wxString url = _T('http://www.google.com');
wxLaunchDefaultBrowser(&url)
}
need to include wx/utils.h
Back to wxWidgets and c++, from long time with php projects
-
- Earned some good credits
- Posts: 103
- Joined: Mon Apr 17, 2006 1:24 pm
- Location: Philippines
- Contact:
i added your code:
the only displayed error:
also included this
i try this also
Code: Select all
void DialEntryPanel::OnClickButton(wxCommandEvent& event)
{
thePhoneApp->getFrame().setCallHistoryVisible(! thePhoneApp->getFrame().getCallHistoryVisible());
const wxString url = _T("http://www.google.com");
wxLaunchDefaultBrowser(&url);
}
Code: Select all
wxLaunchDefaultBrowser : identifier not found, even with the argument dependent lookup.
Code: Select all
#include "wx/utils.h"
Code: Select all
bool wxLaunchDefaultBrowser(&url);
WinXP SP2, VS.NET
wxDev-C++ 4.9.9.2, wxWindows-2.4.2
Need4Speed!
wxDev-C++ 4.9.9.2, wxWindows-2.4.2
Need4Speed!
wxHyperlinkCtrl is from wxHttpEngine libarycyrixware wrote:how to use this wxHyperlinkCtrl? thanks
http://wxcode.sourceforge.net/components/wxhttpengine/
try this
Code: Select all
void DialEntryPanel::OnClickButton(wxCommandEvent& event)
{
thePhoneApp->getFrame().setCallHistoryVisible(! thePhoneApp->getFrame().getCallHistoryVisible());
const wxString url = _T("http://www.google.com");
::wxLaunchDefaultBrowser(&url);
}
Back to wxWidgets and c++, from long time with php projects
I have totally no idea here....
you can use
wxExecute(_T("open ") + url, wxEXEC_ASYNC, NULL );
or
wxExecute(_T("explorer ") + url, wxEXEC_ASYNC, NULL );
I saw at sognature that you use wx 2.4.2, meybe its bug there ?
try with 2.6.3
edit:
I tested this
::wxLaunchDefaultBrowser(_T("http://www.google.com"));
and
wxLaunchDefaultBrowser(_T("http://www.google.com"));
both compiled without errors , VC++ 6.0, win 2k, wx 2.6.3
you can use
wxExecute(_T("open ") + url, wxEXEC_ASYNC, NULL );
or
wxExecute(_T("explorer ") + url, wxEXEC_ASYNC, NULL );
I saw at sognature that you use wx 2.4.2, meybe its bug there ?
try with 2.6.3
edit:
I tested this
::wxLaunchDefaultBrowser(_T("http://www.google.com"));
and
wxLaunchDefaultBrowser(_T("http://www.google.com"));
both compiled without errors , VC++ 6.0, win 2k, wx 2.6.3
Back to wxWidgets and c++, from long time with php projects
Don't use
but
The argument is a reference on a string, not a pointer.
Code: Select all
wxLaunchDefaultBrowser(&url);
Code: Select all
wxLaunchDefaultBrowser(url);