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!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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:

char* GetDiskSerialNumber (char g_DiskLetter);

char* DLLclass::GetDiskSerialNumber(char g_DiskLetter)
CHAR SN[64];

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.