Here is my unresolved problem: I spoke about it last Friday but I have still no solutions for resolving it:
Description of the problem:
I use a function "PESDEMUX_ProcessFile" which is defined in the file "XtlPes.dll". This function allows me to convert file from one type to another.
I work on a device which is controled by my computer with the SERIAL or the USB port.
When I am on SERIAL Mode for controling the device, I have to transfer the file by USB port from the device to my computer and the function "PESDEMUX_ProcessFile" does the conversion. (I have to open and close a USB communication port for that). Here is there no problems.
Now, when I am on USB Mode for controling the device, I have to transfer the file by USB port too from the device to my computer and the function "PESDEMUX_ProcessFile" may does the conversion too. But I have a Visual C++ error: "Unhandled exception in Appli.exe (XTLPES.DLL): 0xC0000005: Access Violation." With the "Call Stack" option in Visual C++, I see that there is a problem at that line: "00E34F3D mov eax,dword ptr [esi+304h]".
Here is the code I used for caling the function "PESDEMUX_ProcessFile":
typedef LONG (__cdecl *PESDEMUX_ProcessFile)(CHAR*,CHAR*,INT);
PESDEMUX_ProcessFile pProcessFile;
CHAR chInFileName[255];
strcpy(chInFileName, m_csPCFileName); //Conversion CString to CHAR*
CHAR chOutFileName[255];
m_csPCFileName = m_csPCFileName + ".mpg";
strcpy(chOutFileName, m_csPCFileName); //Conversion CString to CHAR*
INT Type = 1;
if (theApp.g_hDllXtlPes != NULL)
{
pProcessFile = (PESDEMUX_ProcessFile)GetProcAddress(theApp.g_hDllXtlPes,"PESDEMUX_ProcessFile" );
if (!pProcessFile)
{
FreeLibrary(theApp.g_hDllXtlPes);
return FALSE;
}
else
{
BOOL BResult = TRUE;
BResult = pProcessFile(chInFileName,chOutFileName,Type);
if (BResult == FALSE)
{
TRACE("Conversion Process OK\n" );
}
else
TRACE("Conversion Process non OK\n" );
}
}
With HINSTANCE g_hDllXtlPes = LoadLibrary("XtlPes.dll" ); defined in another .cpp file.
Do you have any ideas on that curious problem ?
Thank's for advance,