Solved

dll entry point not found

Posted on 2001-09-07
8
793 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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
 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

776 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