?
Solved

dll entry point not found

Posted on 2001-09-07
8
Medium Priority
?
813 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 6

Accepted Solution

by:
Triskelion earned 800 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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 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 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.

770 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