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

  1. Open a VC++ project (Open->New).
  2. Select a Win32 Dynamic Link Library and give the name of the project.
  3. In the next dialog box, select the option Simple dll project.
  4. Following files are created by default:

  5. Make the following changes in the StdAfx.h and Main.cpp files and check the results in the process simulator.
  6. 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;

    }


 Transports and Interfaces: Siebel eBusiness Application Integration Volume III 
 Published: 23 June 2003