Error Registering DLL but not .EXE ??
-
Hello , We are trying to access some functions written in our "SAP R-3 system" using a remote function call. SAP R-3 also generates C Code which we can use to compile interfaces that can test these functions. The text file that comes as a help file when we generate code says that it is meant for generating executable. It however mentions nothing about the code being generated not being fit for using as a dll. I generated C Code for one such function and then made an .exe project using Visual C++ and tested it and it seems to work fine just as the documentation claims. However when I use the same code to create a Visual C++ dll projet everything works and I get to the point of making the dll. But when I register the .dll file using REGSVR32 I get an error that reads "the dll was loaded but the DLL Server Register Entry point was not found." I do not know, what is it that I am doing wrong here. Or rather my question would be 1). What special things need to be added or removed or taken care of in my C Code when I am trying to compile it into a DLL 2). I am attaching the code below, that I am using to compile into a DLL. Please feel free to have a look and tell me if there is something you feel that's causing the trouble. Any help with this is deeply appreciated. Regards , Pradhip.S ----------------------------------------------------------- // Code generated by SAP and Visual C++ together. // SAPCConnect.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" #include "saprfccl.h" #if !defined(SAPonWINDOWS) && !defined(SAPonNT) #define __min(a,b) (((a)<(b))?(a):(b)) #define OUT(text,pos) printf("%*.0s",pos,text); printf("%s\n",text); if (outfile!=NULL) fprintf(outfile,"=%s\n",text) #endif #define NL printf("\n") BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } /* ------------------------------------------------------------------------ SAP AG - R/3 Remote Function Call Interface Generation RFC_ANSIC_CL_EXP EN 46C 07/19/2004 20:49 Complete ANSI C client example saprfccl.c ------------------------------------------------------------------------ */ static FILE *infile,*outfile,*logfile; void LOG(const RFC_HANDLE hRfc, const char *text,const char *str) { if (logfile!=NULL) { fprintf(logfile,"%d %s %s\n",hRfc,text,str); fflush(logfile); } } typedef void (WIN_DLL_EXPORT_FLAGS * R
-
Hello , We are trying to access some functions written in our "SAP R-3 system" using a remote function call. SAP R-3 also generates C Code which we can use to compile interfaces that can test these functions. The text file that comes as a help file when we generate code says that it is meant for generating executable. It however mentions nothing about the code being generated not being fit for using as a dll. I generated C Code for one such function and then made an .exe project using Visual C++ and tested it and it seems to work fine just as the documentation claims. However when I use the same code to create a Visual C++ dll projet everything works and I get to the point of making the dll. But when I register the .dll file using REGSVR32 I get an error that reads "the dll was loaded but the DLL Server Register Entry point was not found." I do not know, what is it that I am doing wrong here. Or rather my question would be 1). What special things need to be added or removed or taken care of in my C Code when I am trying to compile it into a DLL 2). I am attaching the code below, that I am using to compile into a DLL. Please feel free to have a look and tell me if there is something you feel that's causing the trouble. Any help with this is deeply appreciated. Regards , Pradhip.S ----------------------------------------------------------- // Code generated by SAP and Visual C++ together. // SAPCConnect.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" #include "saprfccl.h" #if !defined(SAPonWINDOWS) && !defined(SAPonNT) #define __min(a,b) (((a)<(b))?(a):(b)) #define OUT(text,pos) printf("%*.0s",pos,text); printf("%s\n",text); if (outfile!=NULL) fprintf(outfile,"=%s\n",text) #endif #define NL printf("\n") BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } /* ------------------------------------------------------------------------ SAP AG - R/3 Remote Function Call Interface Generation RFC_ANSIC_CL_EXP EN 46C 07/19/2004 20:49 Complete ANSI C client example saprfccl.c ------------------------------------------------------------------------ */ static FILE *infile,*outfile,*logfile; void LOG(const RFC_HANDLE hRfc, const char *text,const char *str) { if (logfile!=NULL) { fprintf(logfile,"%d %s %s\n",hRfc,text,str); fflush(logfile); } } typedef void (WIN_DLL_EXPORT_FLAGS * R
first, a polite criticism: nobody is ever going to look at that much code. anyway, unless you are writing a COM server DLL, you don't need to use RegSvr32 to "register" it. specifically, RegSvr32 loads your DLL and tried to call a function called "RegisterServer" in your DLL; RegisterServer usually sets up a bunch of registry stuff that lets COM know what your DLL does. but, if you're not writing a COM server DLL, there's no need to have a RegisterServer function and no need to use RegSvr32. -c Software | Cleek