Im haveing an issue with a mini dll I have made. The dll contaains two functions which output the name of the current module to the DOS console. The dll works as I was able to link with the lib and use the functions contained within. So its clear the dll is not the problem.

The problem is, when I try to use the dll dynamicaly with LoadLibrary/GetProcAddress is when I experince a error:

Access Violation, the instruction at [XXX] referenced memory at [XXX], The memory could not be writen.

acording to google this aparently is a buffer Overrun.

I have used breakpoints to debug, and narrowed down the line that is causeing the problem. The call to the newly aquired function. Heres a snipplet

===== begin sniplet ===
typedef void(WINAPI* PFUNC)(void);
HINSTANCE hModule = NULL;
PFUNC NumberList;
hModule = LoadLibrary("mydll.dll");
NumberList = (PFUNC) GetProcAddress(hModule, "NumberList");
NumberList(); // Access Violation caused by this line
FreeLibrary(hModule);
======= end sniplet ===

As you can see the error ocures after NumberList is called and returns.

My debuger brings me to the assembly of the problem address, but since my knowledge of asm is primitive its not much use to me.

I have googled for this and there are many results but one stood out. Buffer Overrun. http://medialab.freaknet.org/~alpt/t...RASMAN_EXE.htm

The exact error I am getting is discribed in the 4th paragraph.

It is strange, as I have been able to use dlls in this maner before with no problem, the difernces in this case that I can think of is, the functions are console, whereas i had been dealing with strictly Win32.

Im stumpted on this, perhaps someone can give me some guidence or sugestions?