Solved

dll entry point not found

Posted on 2001-09-07
8
786 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C++ Language error 28 197
FMX enumerated colours 2 84
IdTCPClient1->Disconnect(); not working 3 61
What is sub-make ? 2 39
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

895 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

18 Experts available now in Live!

Get 1:1 Help Now