Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Error Registering DLL but not .EXE ??

Error Registering DLL but not .EXE ??

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionhelpsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pradhip
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • P Pradhip

      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

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups