473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem in the calling the dll functions

hi,

i am making the dll for clamav antivirus libraray so that i can make
activex control for windows.

i complied the library successfully and make the Libclamav.dll file using
win32 Api project in debug mode.

this dll file exports all the 21 function which is needed for clamscan.

now i am making the MFC project in which i am calling these function.

the function in which i am loading the database dir crash with the

Error Message : Unhandled exception at 0x0008686a in export.exe: 0xC0000005:
Access violation reading location 0x0008686a.

note: here export.exe is my program executable file.

Please help me to sort out the problem . i want to know :
a. where is the actual problem?
In the application program or in the dll

what should be the approach to find out the error . i am new in the vc++
programing environment. so please try to give me detail information about
this problem.

Nov 17 '05 #1
1 1320
Error Message : Unhandled exception at 0x0008686a in export.exe: 0xC0000005:
Access violation reading location 0x0008686a.

Here are some possible reasons:
1) Buffer overwrite in a function (thus jumping to incorrect address when returning;
check arrays declared as local variables and make sure that the code does not write
past their boundaries)
2) Function call through an invalid pointer
3) Heap corruption
4) Some other reasons are possible, but less likely
what should be the approach to find out the error


Try to step through the code in the debugger, it is very likely
that you will find the problem this way. If you attached the debugger
only after the exception, check the call stack - it can tell what functions
were called recently (though it is possible that the call stack will not be available).

Also, since you write the code, use tracing and insert as many trace statements
into the application and the DLL as possible (at least, trace all function calls).
The trace log will tell you what functions have been executing just before
the problem occurred, therefore you will know where to look for the problem.
You can use OutputDebugString, TRACE, ATLTRACE, or other tracing libraries
(e.g. see CodeGuru.com).

Check that all DLL functions are properly declared, and the declarations
are up-to-date in the DLL and in the client application.
Make sure that the up-to-date version of the DLL is used
(check the location it is loaded from).

If you use VS.NET, make sure that /RTC1 and /GS compiler options are enabled.

If you call functions through pointers, verify all pointers before calling the functions.

If it does not help, there are other approaches that can be applied.

Regards,
Oleg


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Cindy Liu | last post by:
Hi Everyone, I created C# COM+ component. It has two overloaded methods - the method names are same and their signatures are different, one takes two parameters and another takes four. I coded...
2
by: Pawan Aggarwal | last post by:
I'm having trouble with calling an exported function in a native DLL compiled with eMbedded Visual C++ in C# application in PocketPC 2002 OS. Problem Description follows: I have one exported...
5
by: Dave | last post by:
does calling a regular function cost any cpu time? In other words, is it faster to write the code of two functions into main(), or is it the exact same thing as calling two functions. I know its...
12
by: scottt | last post by:
hi, I am having a little problem passing in reference of my calling class (in my ..exe)into a DLL. Both programs are C# and what I am trying to do is pass a reference to my one class into a DLL...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
6
by: David Hearn | last post by:
I have a property in a user control that I am setting: Private strPageName as String Public Property PageName() as String Get Return strPageName End Get Set(byVal Value as String)...
1
by: =?Utf-8?B?RmFiaWFu?= | last post by:
Hello, I want to give multiple native classes (in different mixed mode dlls) access to a managed output window (for error messages). Therefore I wrote a native singleton with __declspec...
7
by: Ryanivanka | last post by:
hi, I am using a delphi DLL in vc++,static linked with ".h"and "lib". the export functions in DLL are "__stdcall",but the function doesn't work well,it often returns some weird values. when I add...
1
by: JohnCox | last post by:
I have a simple Win32 DLL I wrote named "SimpleLib" that exports two functions. It is written in C++ and compiled with __stdcall (/Gz) and with the preprocessor definition _MBCS (not Unicode). ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.