First off let me say that I am not a C++ expert and
any help would be appreciated.
Here is part of the function that I am trying to modify
the strncpy function crashes when I try and call the function from
VB when debugging
However if I use the exe that I generate from VB in the C++ debuger
it does not crash.
Or if I execute the EXE everything seems to work fine
I suspect that when I call the dll in the VB debuger the
values are not passed the same as when I execute the compiled exe.
How can I get filepath[] to display in the MessageBox?
BOOL _stdcall GetPatName2(char filepath[], char* patname,int
filepath_len){
BOOL return_val = SUCCESS;
int sample_size;
char *PName;
long filesize;
long wnum =0;
char *file_name;
struct SAMPLE_HEADER *raw_data_buffer = NULL;
int file_no;
PName =(char*)AllocateHeap(PNAMESIZE);
file_name = (char *)AllocateHeap(filepath_len+1);
MessageBox(NULL,(LPCTSTR)file_name2,TEXT("Sample Code"), NULL);
strncpy(file_name,filepath,filepath_len);
file_name[filepath_len] = '\0'; //make sure its null terminated
MessageBox(NULL, TEXT("Job Done\n"), NULL, NULL);
return (return_val);
}
VB fuction declaration
Declare Function GetPatName2 Lib "c:\test\testdll\Debug\playback.dll"
Alias "#4" (ByVal Filepath As String, ByVal PName As String, ByVal
FILEPATHLEN As Integer) As Boolean
Thanks Nevlis