Solved

dll entry point not found

Posted on 2001-09-07
8
781 Views
Last Modified: 2007-10-18
i am getting this error when i try registering a dll written in vc++.


the dll was loaded, but dllregisterserver entry point was not found.

dllregisterserver may not be exported, or a corrupt version of the dll may be in memory. Consider using PView to detect and remove it.


i have no clue what that means, any help?
0
Comment
Question by:augblay
  • 4
  • 3
8 Comments
 
LVL 6

Expert Comment

by:Triskelion
ID: 6466118
Did you put __declspec(dllexport) in front of your exported functions?
OR
Did you put the names of the exported functions in the EXP file?

0
 
LVL 1

Author Comment

by:augblay
ID: 6466144
i am a vb programmer, never done vc++ programming, can i email you the file as an attachment the project is not big
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 6466202
Yes.
Check my profile.
0
 
LVL 6

Accepted Solution

by:
Triskelion earned 200 total points
ID: 6466278
Add the names of all of your exported functions inside of your DEF file.
It should look like this:

; rs232dll.def : Declares the module parameters.

LIBRARY      RS232DLL.DLL

EXPORTS
     CheckConnection
     SetupParameters
     IOOperation
     GetHandle
     CloseComPort
     HowManyResends
     SafeMode
     SendBuffer
     SendWindowInfo
     SendFile
     ReceiveFile
     SendCommand


Then rebuild your app.

After that you can use any other app that can call a DLL to test it.  Example below.

Declare Function GetHandle Lib "c:\science\20179045\rs232\Release\rs232dll.dll" () As Integer
Sub test()
    MsgBox GetHandle
End Sub
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 1

Expert Comment

by:ua1zcl
ID: 6466434
Plese add to .def file the following:

EXPORTS
  DllMain=DllEntryPoint      
  DllEntryPoint=DllEntryPoint  

If no def file presenst - create it and add to project beside other .c or .cpp source files.


Be sure you have a DllEntryPoint() function in one of
source files:

 int __declspec(dllexport) WINAPI DllEntryPoint
( HINSTANCE hInst,ULONG ul_reason_being_called,LPVOID lpReserved)
{  
    switch (ul_reason_being_called)
    {
        case DLL_PROCESS_ATTACH:
         iProcAttaches++;
        break;
        case DLL_THREAD_ATTACH:
        break;
        case DLL_THREAD_DETACH:
        break;
        case DLL_PROCESS_DETACH:
        break;
    }
UNREFERENCED_PARAMETER(hInst);
UNREFERENCED_PARAMETER(lpReserved);
return 1;
}
-----------------------------------------
So, now we have any known entry point.
0
 
LVL 1

Author Comment

by:augblay
ID: 6466809
i am getting this error when i am compiling it, do you know what is going on, meanwhile i have tried to increase the point to 400 for your excellent help.

please take a look in the code i sent you and let me know what is going on.

Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
rs232dll.cpp
d:\please burn for augustine\chameleon - source code for win32 and rs232.dll\rs232dll\rs232dll.cpp(598) : warning C4305: '=' : truncation from 'const int' to 'char'
d:\please burn for augustine\chameleon - source code for win32 and rs232.dll\rs232dll\rs232dll.cpp(598) : warning C4309: '=' : truncation of constant value
d:\please burn for augustine\chameleon - source code for win32 and rs232.dll\rs232dll\rs232dll.cpp(1157) : warning C4018: '<' : signed/unsigned mismatch
Linking...
   Creating library Debug/rs232dll.lib and object Debug/rs232dll.exp

rs232dll.dll - 0 error(s), 3 warning(s)
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 6466879
Yup.  I put a simple cast in front of those.

if(bItsAResend)
   io_buffer[0]=(char)INVALID_VALUE;

and

while(t2-t1 < (DWORD)delay)
     t2= timeGetTime();
0
 
LVL 1

Author Comment

by:augblay
ID: 6469524
Thanks a lot, i was able to compile and build without any error, the def file definition was also very helpful, but i am still getting the initial  error when i try registering it.

the dll was loaded, but dllregisterserver entry point was not found.

dllregisterserver may not be exported, or a corrupt version of the dll may be in memory. Consider using
PView to detect and remove it.


What else can i do?
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now