S
Shark
What could be the error??
i have a dll for converting vox files to Dll.
the structure of the header looks like :
-----------------------------------------code-------------------------------------------
typedef struct tFILECONVERT
{
long lStructSize; // the size of this structure
BOOL bCallback; // if TRUE, notify the callback window after
conversion (ID + result code)
HWND hCallbackWindow; // the handle of the callback window if
bCallback is true
long CallbackID; // User provided ID used to mark the callback
message
LPSTR szInputFile; // path and name of the input sound file
WORD wInputFormat; // sound format of the input sound file
DWORD dwInputRate; // sample rate of the input sound file
WORD wInputChannels; // number of channels of the input sound file
LPSTR szOutputFile; // path and name of the output sound file
WORD wOutputFormat; // sound format of the output sound file
DWORD dwOutputRate; // sample rate of the output sound file
WORD wOutputChannels; // number of channels of the output sound file->
currently = 1
BOOL bFilter; // if TRUE, enables filtering during conversion
WORD FilterType; // filter type, if filtering is enabled
DWORD LopassCutoff; // cutoff frequency for low pass filtering
DWORD HipassCutoff; // cutoff frequency for high pass filtering
BOOL bSilence; // if TRUE, performs automatic leader/trailer
trimming during conversion
float SilenceVal; // sound intensity (in % full scale) under which
sound is considered as silence
DWORD LeaderLength; // wanted duration of the trimmed leader
DWORD TrailerLength; // wanted duration of the trimmed trailer
BOOL bNormalize; // if TRUE, allows amplification of the sound
float NormalizeVal; // intensity at which the sound should be
amplified (in % full scale)
BOOL bClarity; // if TRUE, applies sound enhancement effects during
conversion
short ClarityVal; // type of sound enhancement desired
BOOL bCenter; // if TRUE, sound will be centered around 0 during
conversion
BOOL bOldWaveFormat; // if TRUE, will generate old win3.1 wave formats
(no WAVEFORMATEX, no fact chunk)
BOOL bLogIt; // if TRUE, the conversion results will be logged in a
file
LPSTR szLogFile; // path and name of the conversion log file
BOOL bErrorMessage; // if TRUE, a litteral error message will be
returned after conversion
LPSTR szErrorMessage; // address of the string to return the error
message (must be >= 128 char)
WORD ReturnCode; // code to notify the user of the result of the
conversion
DWORD Reserved; // reserved for future extensions-> MUST be set to 0
} FILECONVERT,*PFILECONVERT,far *LPFILECONVERT;
extern "C" BOOL VoxFileConvert(LPFILECONVERT); // the actual
conversion function declaration
extern "C" void VoxConvertRegister(void); // the actual conversion
function declaration
-----------------------------------------------code
end-----------------------------------------------------------------
Now when i try to call the "voxFileConvert" function, it fails. i link
the Dll with the corresponding .Lib file,
but i tried dynamic loading also. that too fails.
-------------------------------------------code------------------------------------------------------------------------------
CONVERT()
{
LPFILECONVERT lpFileConvert;
HGLOBAL hFileConvert;
char szInputFile[256];
char szOutputFile[256];
char szLogFile[256];
char szErrorMessage[256];
hFileConvert = GlobalAlloc(GHND,sizeof(FILECONVERT));
if (!hFileConvert)
{
cout<<"Not enough memory left";
//break;
}
lpFileConvert = (LPFILECONVERT)GlobalLock (hFileConvert);
/*Upon reaching here, Access violation Error found while,(only) in
debugging mode., but when you run the program, it goes till the end ..
(till voxFileConvert).. and throws "illegal Operation" error.*/
lpFileConvert->lStructSize = 128;
lpFileConvert->bCallback = FALSE;
lpFileConvert->hCallbackWindow = NULL;
lpFileConvert->CallbackID = 0;
strcpy(szInputFile,"11.vox");
printf("%s","HAPPEND");
lpFileConvert->szInputFile = szInputFile;
printf("%s",lpFileConvert->szInputFile);
lpFileConvert->wInputFormat = SID_WAVE;
lpFileConvert->dwInputRate = 0;
lpFileConvert->wInputChannels = 0;
strcpy(szOutputFile,"11.wav");
printf("%s","HAPPEND");
lpFileConvert->szOutputFile = szOutputFile;
lpFileConvert->wOutputFormat = SID_DIALADPCM;
lpFileConvert->dwOutputRate = 8000;
lpFileConvert->wOutputChannels = 1;
lpFileConvert->bFilter = FALSE;
lpFileConvert->FilterType = 0;
lpFileConvert->LopassCutoff = 0;
lpFileConvert->HipassCutoff = 0;
lpFileConvert->bSilence = FALSE;
lpFileConvert->SilenceVal = 5.0;
lpFileConvert->LeaderLength = 50;
lpFileConvert->TrailerLength = 50;
lpFileConvert->bNormalize = FALSE;
lpFileConvert->NormalizeVal = 75.0;
lpFileConvert->bClarity = FALSE;
lpFileConvert->ClarityVal = 5;
lpFileConvert->bCenter = FALSE;
lpFileConvert->bOldWaveFormat = FALSE;
lpFileConvert->bLogIt = FALSE;
strcpy(szLogFile,"VOXlog.txt");
printf("%s","HAPPEND");
///// szIniPath );
//strcat(szLogFile,"VCLog.txt");
strcpy(szErrorMessage,"My Error");
lpFileConvert->szLogFile = szLogFile;
lpFileConvert->bErrorMessage = TRUE;
lpFileConvert->szErrorMessage = szErrorMessage;
GlobalUnlock(hFileConvert);
printf("%s","HAPPEND END");
// VoxFileConvert(&lpFileConvert); ///////////VoxDllTest has
encountered a problem and needs to close.
sprintf("CODE:","%d",lpFileConvert->ReturnCode);
--------------------------------------code
end--------------------------------------------------------------
i have a dll for converting vox files to Dll.
the structure of the header looks like :
-----------------------------------------code-------------------------------------------
typedef struct tFILECONVERT
{
long lStructSize; // the size of this structure
BOOL bCallback; // if TRUE, notify the callback window after
conversion (ID + result code)
HWND hCallbackWindow; // the handle of the callback window if
bCallback is true
long CallbackID; // User provided ID used to mark the callback
message
LPSTR szInputFile; // path and name of the input sound file
WORD wInputFormat; // sound format of the input sound file
DWORD dwInputRate; // sample rate of the input sound file
WORD wInputChannels; // number of channels of the input sound file
LPSTR szOutputFile; // path and name of the output sound file
WORD wOutputFormat; // sound format of the output sound file
DWORD dwOutputRate; // sample rate of the output sound file
WORD wOutputChannels; // number of channels of the output sound file->
currently = 1
BOOL bFilter; // if TRUE, enables filtering during conversion
WORD FilterType; // filter type, if filtering is enabled
DWORD LopassCutoff; // cutoff frequency for low pass filtering
DWORD HipassCutoff; // cutoff frequency for high pass filtering
BOOL bSilence; // if TRUE, performs automatic leader/trailer
trimming during conversion
float SilenceVal; // sound intensity (in % full scale) under which
sound is considered as silence
DWORD LeaderLength; // wanted duration of the trimmed leader
DWORD TrailerLength; // wanted duration of the trimmed trailer
BOOL bNormalize; // if TRUE, allows amplification of the sound
float NormalizeVal; // intensity at which the sound should be
amplified (in % full scale)
BOOL bClarity; // if TRUE, applies sound enhancement effects during
conversion
short ClarityVal; // type of sound enhancement desired
BOOL bCenter; // if TRUE, sound will be centered around 0 during
conversion
BOOL bOldWaveFormat; // if TRUE, will generate old win3.1 wave formats
(no WAVEFORMATEX, no fact chunk)
BOOL bLogIt; // if TRUE, the conversion results will be logged in a
file
LPSTR szLogFile; // path and name of the conversion log file
BOOL bErrorMessage; // if TRUE, a litteral error message will be
returned after conversion
LPSTR szErrorMessage; // address of the string to return the error
message (must be >= 128 char)
WORD ReturnCode; // code to notify the user of the result of the
conversion
DWORD Reserved; // reserved for future extensions-> MUST be set to 0
} FILECONVERT,*PFILECONVERT,far *LPFILECONVERT;
extern "C" BOOL VoxFileConvert(LPFILECONVERT); // the actual
conversion function declaration
extern "C" void VoxConvertRegister(void); // the actual conversion
function declaration
-----------------------------------------------code
end-----------------------------------------------------------------
Now when i try to call the "voxFileConvert" function, it fails. i link
the Dll with the corresponding .Lib file,
but i tried dynamic loading also. that too fails.
-------------------------------------------code------------------------------------------------------------------------------
CONVERT()
{
LPFILECONVERT lpFileConvert;
HGLOBAL hFileConvert;
char szInputFile[256];
char szOutputFile[256];
char szLogFile[256];
char szErrorMessage[256];
hFileConvert = GlobalAlloc(GHND,sizeof(FILECONVERT));
if (!hFileConvert)
{
cout<<"Not enough memory left";
//break;
}
lpFileConvert = (LPFILECONVERT)GlobalLock (hFileConvert);
/*Upon reaching here, Access violation Error found while,(only) in
debugging mode., but when you run the program, it goes till the end ..
(till voxFileConvert).. and throws "illegal Operation" error.*/
lpFileConvert->lStructSize = 128;
lpFileConvert->bCallback = FALSE;
lpFileConvert->hCallbackWindow = NULL;
lpFileConvert->CallbackID = 0;
strcpy(szInputFile,"11.vox");
printf("%s","HAPPEND");
lpFileConvert->szInputFile = szInputFile;
printf("%s",lpFileConvert->szInputFile);
lpFileConvert->wInputFormat = SID_WAVE;
lpFileConvert->dwInputRate = 0;
lpFileConvert->wInputChannels = 0;
strcpy(szOutputFile,"11.wav");
printf("%s","HAPPEND");
lpFileConvert->szOutputFile = szOutputFile;
lpFileConvert->wOutputFormat = SID_DIALADPCM;
lpFileConvert->dwOutputRate = 8000;
lpFileConvert->wOutputChannels = 1;
lpFileConvert->bFilter = FALSE;
lpFileConvert->FilterType = 0;
lpFileConvert->LopassCutoff = 0;
lpFileConvert->HipassCutoff = 0;
lpFileConvert->bSilence = FALSE;
lpFileConvert->SilenceVal = 5.0;
lpFileConvert->LeaderLength = 50;
lpFileConvert->TrailerLength = 50;
lpFileConvert->bNormalize = FALSE;
lpFileConvert->NormalizeVal = 75.0;
lpFileConvert->bClarity = FALSE;
lpFileConvert->ClarityVal = 5;
lpFileConvert->bCenter = FALSE;
lpFileConvert->bOldWaveFormat = FALSE;
lpFileConvert->bLogIt = FALSE;
strcpy(szLogFile,"VOXlog.txt");
printf("%s","HAPPEND");
///// szIniPath );
//strcat(szLogFile,"VCLog.txt");
strcpy(szErrorMessage,"My Error");
lpFileConvert->szLogFile = szLogFile;
lpFileConvert->bErrorMessage = TRUE;
lpFileConvert->szErrorMessage = szErrorMessage;
GlobalUnlock(hFileConvert);
printf("%s","HAPPEND END");
// VoxFileConvert(&lpFileConvert); ///////////VoxDllTest has
encountered a problem and needs to close.
sprintf("CODE:","%d",lpFileConvert->ReturnCode);
--------------------------------------code
end--------------------------------------------------------------