Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> OAS Cartridge & MFC
Hi-
I'm trying to build a simple OAS Cartrige in the form of an MFC Dll. I'm a bit rusty on building Dll's and I hope that someone can help me out with this first compiliation hurdle:
My source looks like this:
#include "stdafx.h"
#include <afxdllx.h>
extern "C"
{
#ifndef ORATYPES_ORACLE
#include <oratypes.h>
#endif
#ifndef WRB_ORACLE
#include <wrb.h>
#endif
}
static AFX_EXTENSION_MODULE OASCartDLL = { NULL, NULL };
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved UNREFERENCED_PARAMETER(lpReserved); if (dwReason == DLL_PROCESS_ATTACH) { TRACE0("OASCART.DLL Initializing!\n"); if (!AfxInitExtensionModule(OASCartDLL, hInstance)) return 0; new CDynLinkLibrary(OASCartDLL); } else if (dwReason == DLL_PROCESS_DETACH) { TRACE0("OASCART.DLL Terminating!\n"); AfxTermExtensionModule(OASCartDLL); } return 1; // ok
extern "C" WRBReturnCode OASCart_Exec(void *WRBCtx, void *appCtx) {
WRB_printf(WRBCtx, "Working."); return (WRBReturnCode)(WRB_DONE);
extern "C" WRBReturnCode OASCart_Entry(WRBCallbacks *WRBCalls) {
WRBCalls->exec_WRBCallback = OASCart_Exec;
return (WRBReturnCode)(WRB_DONE);
}
I export the entry point OASCart_Entry, and OAS seems to be able to find it all right. However, it claims that OASCart_Entry does not return WRB_DONE. It says so in wrb.log:
11-04-98 07:42:40 0 renfield.twocoast.com `WRB App Engine` 330 0 0x400fff `OWS-10005: Init callback or Entry Function doesnot return WRB_DONE `
I think this has something to do with how the enum WRBReturnCode is defined (in callback.h). This thing won't compile unless I cast WRB_DONE to WRBReturnCode.
Any suggestions?
Thanks,
Thomas Barry Received on Wed Nov 04 1998 - 08:03:13 CST