HTMLHelp

HTMLHelp

Postby PeterHarmes » Tue Jun 08, 2010 9:28 am

Hi,

I'm trying to upgrade both xHarbour (Commercial Jan 2010) & FW (10.05) and when i try to recompile my app i get the following error:

Type error in argument 2 to a function; found 'const char *' expected 'char *'.
Type error in argument 4 to a function; found 'const char *' expected 'char *'.

the line it is refering to is: pHTMLHelp( ( HWND ) hb_parnl( 1 ), hb_parc( 2 ), hb_parnl( 3 ), hb_parc( 4 ) );

full function below:

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

typedef LONG PASCAL ( * PHTMLHELP ) ( HWND, LPSTR, LONG, LPSTR );

HB_FUNC( HTMLHELP )
{
HINSTANCE hDLL = LoadLibrary( "hhctrl.ocx" );
PHTMLHELP pHTMLHelp = ( PHTMLHELP ) GetProcAddress( hDLL, "HtmlHelpA" );

if( pHTMLHelp )
pHTMLHelp( ( HWND ) hb_parnl( 1 ), hb_parc( 2 ), hb_parnl( 3 ), hb_parc( 4 ) );

FreeLibrary( hDLL );
}

#pragma ENDDUMP


Is this an xHarbour compiler problem or do i need to change something in the above?

Thanks in advance

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: HTMLHelp

Postby PeterHarmes » Tue Jun 08, 2010 10:01 am

I think i may have fixed the compiling problem by using this instead:

DLL32 Function HTMLHelp( ;
hWnd As LONG, cChmFile As LPSTR, nCommand As LONG, nTopic As LPSTR) ;
As LONG PASCAL From "HtmlHelpA" Lib "hhctrl.ocx"

I copied this from the \FWH\source\winapi\help32.prg but had to change the nTopic section as it was originally:

DLL32 Function HTMLHelp( ;
hWnd As LONG, cChmFile As LPSTR, nCommand As LONG, nTopic As LONG ) ;
As LONG PASCAL From "HtmlHelpA" Lib "hhctrl.ocx"

by making my change, calling help topics work

Regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests