What is the code inside
GetSerialNumber
?
There is probably some error there.
Also, you're declaring a local array and returning its address, which will no longer be valid when the function returns.
Instead change it as follows -
void DLLclass::GetDiskSerialNumber(char g_DiskLetter, char* SN)
{
GetSerialNumber(SN, g_DiskLetter);
}
void CKey_TestingDlg::OnBnClickedgetserial()
{
DLLclass Dllobj;
char ltr='h';
CHAR SN[64];
memset(SN,0,sizeof(SN));
Dllobj.GetDiskSerialNumber(ltr, SN);
}