All,
I am trying to write a C wrapper for a function. I've used the DLL command successfully for most of the functions however this function I think is going to require a C wrapper. I do have the lib for this function as well.
This particular function populates a C structure with values. I need to call the function and then return the values in C structure to my .prg. I found a sample on the forum and tried to duplicate it but have not been successful.
The error I'm getting is:
xLINK: error: Unresolved external symbol '_SMSGETPROVIDER referenced from (Testsms.obj)'.xLINK: error: Unresolved external symbol '_SMSGETPROVIDER referenced from (Testsms.obj)'.
This is a communications library named SocketTools. I've been using the DLL command version for sending emails via smtp for a few years and it works very well. I am using xHarbour. Below is my code.
Definition of function from help file.
/*
INT WINAPI SmsGetProvider(
LPCTSTR lpszPhoneNumber,
LPSMSPROVIDER lpProvider
);
*/
#INCLUDE "fivewin.ch"
FUNCTION TestSms
SmsGetProvider( )
RETURN NIL
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
#define SMS_MAXPROVIDERGUIDLEN 38
#define SMS_MAXPROVIDERNAMELEN 128
#define SMS_MAXCOMPANYNAMELEN 128
#define SMS_MAXDOMAINNAMELEN 128
typedef struct tagSMS_PROVIDER
{
int nProviderId;
int nCountryCode;
int nRegionCode;
int nMessageLength;
char szGuid[SMS_MAXPROVIDERGUIDLEN];
char szName[SMS_MAXPROVIDERNAMELEN];
char szCompany[SMS_MAXCOMPANYNAMELEN];
char szDomain[SMS_MAXDOMAINNAMELEN];
} SMS_PROVIDER ;
HB_FUNC ( SMSGETPROVIDER )
{
SMS_PROVIDER aProvider ;
aProvider.nProviderId = hb_parnl( 1, 1 );
aProvider.nCountryCode = hb_parnl( 1, 2 );
aProvider.nRegionCode = hb_parnl( 1, 3 );
aProvider.nMessageLength = hb_parnl( 1, 4 );
hb_retnl( SMSGETPROVIDER(&aProvider) );
}
#pragma ENDDUMP
Here is the .DEF contents if it helps.
LIBRARY "CSTXTAV8.DLL"
EXPORTS
SmsInitializeA @1
SmsInitializeW @2
SmsUninitialize @3
SmsEnableTraceA @4
SmsEnableTraceW @5
SmsDisableTrace @6
SmsEnumProvidersA @7
SmsEnumProvidersW @8
SmsGetErrorStringA @9
SmsGetErrorStringW @10
SmsGetFirstProviderA @11
SmsGetFirstProviderW @12
SmsGetGatewayA @13
SmsGetGatewayW @14
SmsGetLastError @15
SmsGetNextProviderA @16
SmsGetNextProviderW @17
SmsGetProviderA @18
SmsGetProviderW @19
SmsSendMessageA @20
SmsSendMessageW @21
SmsSetLastError @22
Any help greatly appreciated.
Thanks,
Randal