Originally posted by: SystemAdmin
Hi,
I want use the library method of the EXIT function on the platform Windows XP. But when I run the map containing a rule where I call the function stringlength of the library WCD.dll:
=EXIT("WCD.dll", "stringlength", "Just Another WTX Mapper!")
I got no response from the Map Designer and I must shutdown the application.
This method called from an other program written in C works fine. Here's an sample output:
codeInput to DLL: Just Another WTX Mapper!
Message from DLL: Successful completion
Length of input: 24[/code]
My software/development configuration:
Windows XP SP2
Eclipse 3.2.2 -> Managed Make C Project
Build as Shared Library (Gnu on Windows)
WTX Design Studio 8.1 Build 11
The coding:
dllsample.c:
code#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <windows.h>
#include <windowsx.h>
#include "dllsample.h"
#include "exitparm.h"
void stringlength (LPEXITPARAM lpep) {
lpep->lpDataFromApp = GlobalAllocPtr(GMEM_FIXED, 1024);
sprintf (
lpep->lpDataFromApp,
"%d",
strlen(lpep->lpDataToApp)
);
lpep->dwFromLen = strlen (lpep->lpDataFromApp);
lpep->nReturn = 0;
strcpy (lpep->szErrMsg, "Successful completion");
}[/code]
exitparm.h:
code #ifndef EXITPARAM_H_
#define EXITPARAM_H_
#include <windef.h>
#ifdef _WIN32
#define HUGE
#endif
struct tagExitParamStruct {
DWORD dwSize;
DWORD dwToLen;
DWORD dwFromLen;
DWORD dwMapInstance;
void FAR * lpv;
LPSTR lpszCmdLine;
BYTE HUGE * lpDataToApp;
BYTE HUGE * lpDataFromApp;
UINT uRetryCount;
UINT uRetryInterval;
BOOL bRollback;
BOOL bCleanup;
int nReturn;
char szErrMsg
100;
char szFile
260;
void FAR * lpMapHandle;
void FAR * lpInternal;
void FAR * lpCmdStruct;
void FAR * lpAdaptParms;
void FAR * lpContext;
void FAR * lpWildcard;
void FAR * lpfnMS;
void FAR * lpMS;
DWORD dwWildcardSize;
LPSTR lpszMapDirectory;
WORD wCardNum;
WORD wCleanupAction;
WORD wScope;
UINT uUnitSize;
BOOL bBurst;
BOOL bFromRule;
BOOL bSource;
DWORD dwRecords;
};
typedef struct tagExitParamStruct EXITPARAM;
typedef struct tagExitParamStruct FAR * LPEXITPARAM;
#endif /*EXITPARAM_H_*/[/code]
dllsample.h:
code#ifndef DLLSAMPLE_H_
#define DLLSAMPLE_H_
#include "exitparm.h"
void stringlength(LPEXITPARAM lpep);
#endif /*DLLSAMPLE_H_*/[/code]
Any hints?
Thanks in advance.
Andreas
#DataExchange#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender