Bookshelf Home | Contents | Index | Search | PDF |
Transports and Interfaces: Siebel eBusiness Application Integration Volume III > EAI DLL and EAI File Transports > EAI HTTP Transport Method Arguments >
Creating a DLL to Call a Function in an External DLL
Following procedure illustrates how to create a DLL to use the EAI DLL Transport business service to call a function in an external DLL.
To make a DLL
- Open a VC++ project (Open->New).
- Select a Win32 Dynamic Link Library and give the name of the project.
- In the next dialog box, select the option Simple dll project.
Following files are created by default:
- Project.cpp
- StdAfx.h
- StdAfx.cpp
- Make the following changes in the StdAfx.h and Main.cpp files and check the results in the process simulator.
StdAfx.h
struct XMLDataBuf
{
int nLength;
void* pData;
};
extern "C" int __declspec(dllexport) TestEAI(const XMLDataBuf* Value, XMLDataBuf* pReply);
Main.cpp
#include "stdafx.h"
#include <string.h>
#include <stdio.h>
#include <io.h>
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
extern "C" int __declspec(dllexport) TestEAI(const XMLDataBuf* Value, XMLDataBuf* pReply)
{
FILE *p;
p = fopen("c:\\test.txt","w");
fprintf(p,"before test");
fprintf(p,"%s After Test",Value->pData);
//strcpy(s,"Hello World");
fclose(p);
return 0;
}
Bookshelf Home | Contents | Index | Search | PDF |
Transports and Interfaces: Siebel eBusiness Application Integration Volume III Published: 23 June 2003 |