CPcanIsoTpExampleMFCthrowing exceptions
CPcanIsoTpExampleMFCthrowing exceptions
The untouched fresh built demo is throwing exceptions when opening and closing. Any hint?
at startup
Exception thrown at 0x774843A9 (oleaut32.dll) in PcanIsoTpExampleMFC.exe: 0xC0000005: Access violation reading location 0x0000000C
callstack points to oleaut32.dll called by PCANBasic called by PCAN-ISO-TP
when closing
Exception thrown at 0x00591D08 in PcanIsoTpExampleMFC.exe: 0xC0000005: Access violation executing location 0x00591D08.
callstack not available
Environment is windows 7, visual studio 2015 update 3 latest PCAN libraries and demo from site
During runtime the USB-FD adapter is detected and early tests are looking ok
at startup
Exception thrown at 0x774843A9 (oleaut32.dll) in PcanIsoTpExampleMFC.exe: 0xC0000005: Access violation reading location 0x0000000C
callstack points to oleaut32.dll called by PCANBasic called by PCAN-ISO-TP
when closing
Exception thrown at 0x00591D08 in PcanIsoTpExampleMFC.exe: 0xC0000005: Access violation executing location 0x00591D08.
callstack not available
Environment is windows 7, visual studio 2015 update 3 latest PCAN libraries and demo from site
During runtime the USB-FD adapter is detected and early tests are looking ok
Re: CPcanIsoTpExampleMFCthrowing exceptions
by the way there are a couple of C# leftover to clear out
str.Format(L"{0} {1} ({2:X2}h)", devDevice, byChannel, p_handle);
str.Format(L"An error occurred. Error-code's text ({0:X}) couldn't be retrieved", p_error);
str.Format(L"{0} {1} ({2:X2}h)", devDevice, byChannel, p_handle);
str.Format(L"An error occurred. Error-code's text ({0:X}) couldn't be retrieved", p_error);
-
- Software Development
- Posts: 305
- Joined: Mon 9. Sep 2013, 12:21
Re: CPcanIsoTpExampleMFCthrowing exceptions
Hello devotip,
We were able to reproduce your issue by placing the wrong PCAN-ISO-TP dll (i.e. the x64 version while running the x86 sample). Make sure the PCAN-ISO-TP dll located in your Debug/Release folders matches the building architecture (the sample is configured as a 32 bits application by default).
Thanks for the feedback about the string format functions, it will be fixed but for now it should not impact you in any way.
We were able to reproduce your issue by placing the wrong PCAN-ISO-TP dll (i.e. the x64 version while running the x86 sample). Make sure the PCAN-ISO-TP dll located in your Debug/Release folders matches the building architecture (the sample is configured as a 32 bits application by default).
Thanks for the feedback about the string format functions, it will be fixed but for now it should not impact you in any way.
Best regards,
Fabrice
Fabrice
Re: CPcanIsoTpExampleMFCthrowing exceptions
PC is a win7 x64, the demo is x86 and the libraries in use (debug folder) are the ones defined in the attachment
- Attachments
-
- library versions
- libs.jpg (110.93 KiB) Viewed 9290 times
-
- Software Development
- Posts: 305
- Joined: Mon 9. Sep 2013, 12:21
Re: CPcanIsoTpExampleMFCthrowing exceptions
In project file "stdafx.h", there is an include of <vld.h> (Visual Leak Dectector) on line 11. There are some known issues depending on the version installed that could match your problem. Since it is for debugging purpose only, could you comment/remove this include and let me know.
Best regards,
Fabrice
Fabrice
Re: CPcanIsoTpExampleMFCthrowing exceptions
Done, behavior unchanged
-
- Software Development
- Posts: 305
- Joined: Mon 9. Sep 2013, 12:21
Re: CPcanIsoTpExampleMFCthrowing exceptions
There is indeed an issue on Windows 7 with VS2015.3. You can fix the starting exception by using the corrected stdafx.h file, here is the changes up to the end of file:
We are still investigating why there is an exception when the program exits.
Code: Select all
[...]
#include <vector>
#include "PCAN-ISO-TP.h"
#include "MappingStatus.h"
#include "MessageStatus.h"
#include "PCanIsoTpUtils.h"
#include "PCanIsoTpExampleDlgAddNewMappings.h"
#include "PCanIsoTpExampleDlgMappings.h"
#include "PCanIsoTpExampleDlgMessages.h"
#include "PCanIsoTpExampleDlgParameters.h"
#include "PCanIsoTpExampleTabCtrl.h"
#include "PcanIsoTpExampleDlg.h"
- Attachments
-
- stdafx.h
- (2.21 KiB) Downloaded 561 times
Best regards,
Fabrice
Fabrice
Re: CPcanIsoTpExampleMFCthrowing exceptions
Retrieved a vs2008 and setup a minimal dialog application, same issue when closing even without invoking anything
Another sample application PCTPClient is not exposing the effect but is a console only and may have a implied different shutdown sequence
As a side note the lib files included in the samples are not binary twins
Another sample application PCTPClient is not exposing the effect but is a console only and may have a implied different shutdown sequence
As a side note the lib files included in the samples are not binary twins
Re: CPcanIsoTpExampleMFCthrowing exceptions
Attached a minimal vs2008 MFC testcase, can be imported in newer visual studio versions
Start it, click cancel. nothing is invoked but crash when closing
Start it, click ok. CANTP_Uninitialize is invoked but crash when closing
start it, click libinfo. some methods are invoked and behaving as expected but then when closing a crash
Start it, click cancel. nothing is invoked but crash when closing
Start it, click ok. CANTP_Uninitialize is invoked but crash when closing
start it, click libinfo. some methods are invoked and behaving as expected but then when closing a crash
- Attachments
-
- CollaudoFSK.7z
- Minimal MFC test case
- (1.95 MiB) Downloaded 400 times
-
- Software Development
- Posts: 305
- Joined: Mon 9. Sep 2013, 12:21
Re: CPcanIsoTpExampleMFCthrowing exceptions
Hello Devotip,
Sorry for the delay, but the issue should be fixed in the next release. Meanwhile I'll see that you get a testing version to confirm the fix in the next few days.
I can confirm that the problem does not impact any of PCAN-ISO-TP features, it is only limited to the closure of an MFC application: the problem arises when Windows unloads PCANBasic.dll which is still used by PCAN-ISO-TP.dll.
Sorry for the delay, but the issue should be fixed in the next release. Meanwhile I'll see that you get a testing version to confirm the fix in the next few days.
I can confirm that the problem does not impact any of PCAN-ISO-TP features, it is only limited to the closure of an MFC application: the problem arises when Windows unloads PCANBasic.dll which is still used by PCAN-ISO-TP.dll.
Best regards,
Fabrice
Fabrice