Unhandled Exception: Access Violation - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Unhandled Exception: Access Violation

Guru_AngadiGuru_Angadi Posts: 1Member
Hello Everyone,

Am working creating MFC DLL & am getting an error:Unhandled exception at 0x00000000 in Key_Testing.exe: 0xC0000005: Access violation.

The DLL Code is like this:

//Demo.h
char* GetDiskSerialNumber (char g_DiskLetter);

//Demo.cpp
char* DLLclass::GetDiskSerialNumber(char g_DiskLetter)
{
CHAR SN[64];
memset(SN,0,sizeof(SN));

if(GetSerialNumber(SN,g_DiskLetter)){ // Error in this Line..
return (char*)SN;
}
}

This DLL am using in an application..
void CKey_TestingDlg::OnBnClickedgetserial()
{
// TODO: Add your control notification handler code here
DLLclass Dllobj;
char ltr='h';
char* ser=Dllobj.GetDiskSerialNumber(ltr);
}


Please,, Could anyone suggest where i gone wrong.. Any help will be appriciated..

Thank you.
Sign In or Register to comment.