Thread overview
wxHtmlWindow::OnLinkClicked() Definition Different ?
May 18, 2005
graceindustries
May 18, 2005
W³odzimierz Skiba
May 18, 2005
Bob Paddock
May 18, 2005
I am using DMC43 and wxWindows 2.5.3, when I include the following
in my .cpp file it will not compile, saying the diffinition is different
than the header file, where it is defined as virtual.

How do I fix this? Below is the complete error output.

#include <wx/html/htmlwin.h>
contains:
// Called when user clicked on hypertext link. Default behavior is to
// call LoadPage(loc)
virtual void OnLinkClicked(const wxHtmlLinkInfo& link);

My code has:

#include <wx/html/htmlwin.h>
void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
{
wxString uri = link.GetHref();

wxLogVerbose( "{[%s/%u]:: wxHtmlWindow::OnLinkClicked} \"%s\"",
__FILE__, __LINE__,  uri.c_str() );

LoadPage( uri );
}


C:\wx253\lib\dmc_lib\wxmsw25d_html.lib(htmlwin)  Offset 0110DH Record Type 0091
Error 1: Previous Definition Different :
?OnLinkClicked@wxHtmlWindow@@UAEXABVwxHtmlLinkInfo@@@Z (void syscall
wxHtmlWindow::OnLinkClicked(wxHtmlLinkInfo const &))
C:\DM\lib\shell32.lib(shguid)
Warning 160: MS Precompiled TYPES not supported
C:\DM\lib\shell32.lib(shguid)
Warning 161: Unknown CV version, ignored

--- errorlevel 1
Done.


May 18, 2005
graceindustries@gmail.com wrote in news:d6fd54$25ao$1@digitaldaemon.com:
>  #include <wx/html/htmlwin.h>
>  void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)

Here seems the problem.
You seem to duplicate function which is already in library. You have to derive from
wxHtmlWindow, not duplicate it.

> C:\DM\lib\shell32.lib(shguid) Warning 160: MS Precompiled TYPES not supported C:\DM\lib\shell32.lib(shguid) Warning 161: Unknown CV version, ignored

These warnings are unrelated to wxWidgets. I already reported it here. Have no idea what's the reason an have no idea what's is the status of fixing it in DMC.

ABX
May 18, 2005
On Wed, 18 May 2005 12:53:35 +0000 (UTC), W³odzimierz Skiba <abx@abx.art.pl> wrote:

>>  #include <wx/html/htmlwin.h>
>>  void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)

I thought it would do The Right Thing because the header declarers the
function as virtual?  BCC did not complain about it, which is where I'm porting
the code from.