For Microsoft and PellesC, please replace _export with __declspec(dllexport) and try to build it again, thanks

Code: Select all | Expand
#INCLUDE "Fivewin.CH"
#pragma BEGINDUMP
// Declare Sub WCAPRegisterReceive Lib "wcap.dll" _ (ByVal lpRcvProcedure As Long)
#include <windows.h>
void __declspec(dllexport) RcvProcedure( char * szXML, LONG lSize );
{
MessageBox( 0, "It is working", szXML, 0 );
}
HB_FUNC( REGISTER )
{
WCAPRegisterReceive( ( LONG ) RcvProcedure );
}
#pragma ENDDUMP
FUNCTION main // wpac
LOCAL pFunc := HB_FuncPtr( "CalledBack" )
//PRIVATE wcap := LoadLibrary( "wcap.dll" )
PRIVATE cXMLDoc := ""
// Register the procedure
Register( )
// Connect to the server
WCAPConnectAs( 'localhost', 17943, 1 )
WCAPConnected()
MsgInfo( "Got Here" )
WCAPDisconnect( )
FreeLibrary( wcap )
QUIT
RETURN NIL
FUNCTION CalledBack( PC )
cXMLDoc := PC
RETURN NIL
Code: Select all | Expand
Type: C >>>xhb.exe -o"WPAC\wPac.c" -m -n -pOWPAC\ -q -gc0 -I"C:\fwh\include" -I"C:\xHB\include" -I"C:\xHB\include\w32" "C:\xHB\ASW90\wPac.prg"<<<
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6726)
Copyright 1999-2010, http://www.xharbour.org http://www.harbour-project.org/
Generating object output to 'WPAC\wPac.obj'...
C:\\xHB\\ASW90\\wPac.prg(10): error: Unrecognized declaration.
C:\\xHB\\ASW90\\wPac.prg(11): warning: Missing type specifier.
C:\\xHB\\ASW90\\wPac.prg(11): error: Syntax error; found '0' expecting ')'.
C:\\xHB\\ASW90\\wPac.prg(11): error: Redeclaration of 'MessageBoxA' previously declared at C:\xHB\c_include\win\winuser.h(4283): found 'int __cdecl function' expected 'int __stdcall function(struct HWND__ *, const char *, const char *, unsigned int)'.
C:\\xHB\\ASW90\\wPac.prg(12): error: Unrecognized declaration.
C:\\xHB\\ASW90\\wPac.prg(16): warning: Missing prototype for 'WCAPRegisterReceive'.
Type: C >>>Couldn't build: wPac.obj<<<
Type: C >>>TMAKEOBJECT<<<
Type: C >>>TMAKEOBJECT:REFRESH<<<
Type: N >>> 1423<<<
Code: Select all | Expand
void WCAPConnectAs( char *, LONG, LONG ); // I have assumed this prototype, please check that it is correct
HB_FUNC( WCAPCONNECTAS )
{
WCAPConnectAs( hb_parc( 1 ), hb_parnl( 2 ), hb_parnl( 3 ) );
}
Code: Select all | Expand
#INCLUDE "Fivewin.CH"
#pragma BEGINDUMP
#include <windows.h>
void __declspec(dllexport) RcvProcedure( char * szXML, LONG lSize )
{
MessageBox( 0, "It is working", szXML, 0 );
}
// Declare Sub WCAPRegisterReceive Lib "wcap.dll" _ (ByVal lpRcvProcedure As Long)
void WCAPRegisterReceive( LONG);
HB_FUNC( REGISTER )
{
WCAPRegisterReceive( ( LONG ) RcvProcedure );
}
// Function: WCAPConnectAs( Host:LPSTR, Port :UINT, Autostart :UINT ) :Bool
void WCAPConnectAs( LPSTR, LONG, LONG );
HB_FUNC( WPCONNECTAS )
{
WCAPConnectAs( hb_parc(1), hb_parl(2), hb_parl(3) );
}
// Function: WCAPConnected :BOOl
void WCAPConnected( );
HB_FUNC( WPCONNECTED )
{
WCAPConnected( );
}
// Function: WCAPDisconnect
void WCAPDisconnect( );
HB_FUNC( WPDISCONNECT )
{
WCAPDisconnect( );
}
// Function: WCAPSend(XMLDoc :LPSTR)
void WCAPSend( LPSTR );
HB_FUNC( WPSEND )
{
WCAPSend( hb_parc(1) ) ;
}
#pragma ENDDUMP
FUNCTION main // wpac
LOCAL pFunc := HB_FuncPtr( "CalledBack" )
PRIVATE cXMLDoc := ""
// Register the procedure
Register( )
// Connect to the server
WConnectAs( 'localhost', 17943, 1 )
// WCAPConnected()
MsgInfo( "Got Here" )
// WCAPDisconnect( )
QUIT
RETURN NIL
FUNCTION CalledBack( PC )
cXMLDoc := PC
RETURN NIL
Code: Select all | Expand
#INCLUDE "Fivewin.CH"
#pragma BEGINDUMP
#include <windows.h>
void __declspec(dllexport) RcvProcedure( char * szXML, LONG lSize )
{
MessageBox( 0, "It is working", szXML, 0 );
}
// Declare Sub WCAPRegisterReceive Lib "wcap.dll" _ (ByVal lpRcvProcedure As Long)
void WCAPRegisterReceive( LONG );
HB_FUNC( REGISTER )
{
WCAPRegisterReceive( ( LONG ) RcvProcedure );
}
// Function: WCAPConnectAs( Host:LPSTR, Port :UINT, Autostart :UINT ) :Bool
BOOL WCAPConnectAs( LPSTR, LONG, LONG );
HB_FUNC( WPCONNECTAS )
{
hb_retl( WCAPConnectAs( ( char * ) hb_parc( 1 ), hb_parnl( 2 ), hb_parnl( 3 ) );
}
// Function: WCAPConnected :BOOl
BOOL WCAPConnected( );
HB_FUNC( WPCONNECTED )
{
hb_retl( WCAPConnected() );
}
// Function: WCAPDisconnect
void WCAPDisconnect();
HB_FUNC( WPDISCONNECT )
{
WCAPDisconnect();
}
// Function: WCAPSend(XMLDoc :LPSTR)
void WCAPSend( LPSTR );
HB_FUNC( WPSEND )
{
WCAPSend( ( char * ) hb_parc( 1 ) );
}
#pragma ENDDUMP
FUNCTION main // wpac
LOCAL pFunc := HB_FuncPtr( "CalledBack" )
PRIVATE cXMLDoc := ""
// Register the procedure
Register( )
// Connect to the server
WConnectAs( 'localhost', 17943, 1 )
// WCAPConnected()
MsgInfo( "Got Here" )
// WCAPDisconnect( )
QUIT
RETURN NIL
FUNCTION CalledBack( PC )
cXMLDoc := PC
RETURN NIL
Code: Select all | Expand
HB_FUNC( REGISTER )
{
MessageBox( 0, "before", "register", 0 );
WCAPRegisterReceive( ( LONG ) RcvProcedure );
MessageBox( 0, "after", "register", 0 );
}