NO

Author Topic: Using Regsvr32 to register DLL in Windows/XP  (Read 3629 times)

Prometheus

  • Guest
Using Regsvr32 to register DLL in Windows/XP
« on: April 28, 2007, 01:10:13 AM »
 :'(

Hello everybody.  I'd written a C module within a "Windows DLL" project (see code below) and I'm able to compile it.  When I use regsvr32 to register it, I receive the dreaded error message "...\feomod2.dll was loaded, but the DllRegisterServer entry point was not found.  This file can not be registered".  I've tried many techniques, but am now stumped.  Please help ....

Here's the source code:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>

typedef unsigned short     Int16;
typedef unsigned char      Int8;
typedef unsigned long int  Int32;

const unsigned int NUMBER_OF_BYTES_TO_KILL = 2 ;

__declspec(dllexport) Int32 _dynamn ( 
      int     *code,
      int     *stmno,
      int     *InLen,
      char   *InBuf,
      int      *OutLen,
      char    *OutBuf
   )

{
   switch (*code)
   {

      case 1:  /* Initialization, no other values */
         printf ("OUTMOD Initial Entry\n");
         break;

      case 2:  /* Cleanup call, no other values */
         printf ("OUTMOD End of Responses Entry\n");
         break;

      case 3:  /* Process response record */

         /* Process the record only if its length is greater than NUMBER_OF_BYTES_TO_KILL */
         if ( sizeof( *InBuf )  > NUMBER_OF_BYTES_TO_KILL )
         {
            /* Move *InBuf memory address, NUMBER_OF_BYTES_TO_KILL bytes forward */
            OutBuf = OutBuf + NUMBER_OF_BYTES_TO_KILL;

            /* Inform the FE engine that the prefixing NUMBER_OF_BYTES_TO_KILL were eliminated */
            *OutLen = *OutLen - NUMBER_OF_BYTES_TO_KILL;
         }

         break;

      case 4:
         /* Checkpoint, no other values */
         printf ("OUTMOD Checkpoint Entry\n");
         break;

      case 5:
         /* DBC restart - close and reopen the output files */
         printf ("OUTMOD DBC Restart Entry\n");
         break;

      case 6:
         /* Host restart  */
         printf ("OUTMOD Host Restart Entry\n");
         break;

      default:
         printf ("OUTMOD Invalid Entry code\n");
         break;

   }
   return (0);
}

JohnF

  • Guest
Re: Using Regsvr32 to register DLL in Windows/XP
« Reply #1 on: April 28, 2007, 07:57:11 AM »
First, why do you want to register the dll, how is it to be used?

Second, this error is a clue -- "\feomod2.dll was loaded, but the DllRegisterServer entry point was not found" -- to register a dll you need more functions.

Function DllMain is needed for all Dll's and if it needs to be registered you need a DllRegisterServer function and DllUnregisterServer.

You should read up on Dll creation.

John