Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Compatibility problems with Matrox Imaging Library
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Compatibility problems with Matrox Imaging Library

 Post Reply Post Reply
Author
Message
pijnappel View Drop Down
Groupie
Groupie


Joined: 30 November 2007
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote pijnappel Quote  Post ReplyReply Direct Link To This Post Topic: Compatibility problems with Matrox Imaging Library
    Posted: 10 April 2008 at 3:00am
Hello,
 
our application uses Matrox Imaging Library (MIL-LITE v. 8.0) to display a live video stream. When I load a skin using SkinFramework everything seems to work fine until I close the application window.
 
In the DeInitialization function for MIL components, where MIL Threads are cleaned up I get the following error message:
 
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
 
Commenting out the LoadSkin function of SkinFramework everything shuts down without errors. I already reported this to Matrox, but no response till today. Could this be a problem caused by SkinFrameworks hooking functions? I'm thankfull for every suggestion.
 
Thanks
 
pijnappel
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2008 at 3:17am
Originally posted by pijnappel pijnappel wrote:

Hello,
 
our application uses Matrox Imaging Library (MIL-LITE v. 8.0) to display a live video stream. When I load a skin using SkinFramework everything seems to work fine until I close the application window.
 
In the DeInitialization function for MIL components, where MIL Threads are cleaned up I get the following error message:
 
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
 
Commenting out the LoadSkin function of SkinFramework everything shuts down without errors. I already reported this to Matrox, but no response till today. Could this be a problem caused by SkinFrameworks hooking functions? I'm thankfull for every suggestion.
 
Thanks
 
pijnappel
 
I had this problem in something else where I incorrectly defined a function as __stdcall instead of __cdecl.
 
This function was access by loading the DLL then using GetProcAddress.
 
For example (wrong):
    typedef DWORD (__stdcalll REPORTERTICKLE)   ();
instead of
    typedef DWORD (__cdecl REPORTERTICKLE)   ();
Simon HB9DRV
Back to Top
pijnappel View Drop Down
Groupie
Groupie


Joined: 30 November 2007
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote pijnappel Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2008 at 3:53am
Thanks, but unfortunately I have no access to the MIL libraries source code so I can't look into it.
 
I thought it could be a problem of the SkinFramework hooks because it hooks to Threads to skin Controls. Maybe the cleanup of hooked threads by MIL could cause this error? 
 
Update:
I searched the MIL Header files and found out that the MIL functions I need to use include __stdcall. Do you know a solution to handle this without changing the MIL Library (I can't do that anyway)?
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2008 at 2:46pm
Originally posted by pijnappel pijnappel wrote:

Thanks, but unfortunately I have no access to the MIL libraries source code so I can't look into it.
 
I thought it could be a problem of the SkinFramework hooks because it hooks to Threads to skin Controls. Maybe the cleanup of hooked threads by MIL could cause this error? 
 
Update:
I searched the MIL Header files and found out that the MIL functions I need to use include __stdcall. Do you know a solution to handle this without changing the MIL Library (I can't do that anyway)?
 
Me - no, don't know, sorry.
Simon HB9DRV
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2008 at 3:16pm
Hi;
 
it's not only a problem of the calling convention. It also happens when you dynamically load a library and assign a function to a function pointer that has a wrong signature; e.g. you define a function pointer like this (using Simons)
 
typedef DWORD (__stdcall MYFUNCTIONPOINTER) (DWORD, LPCTSTR);

But the library implements the function with

DWORD _stdcall ThisIsMyFunction(DWORD dwData);
 
Now you call it using the function pointer, providing a wrong number and/or wrong type of parameter(s).
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
pijnappel View Drop Down
Groupie
Groupie


Joined: 30 November 2007
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote pijnappel Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2008 at 2:01am
I found the solution.

I removed the window handle I assigned to the Matrox live video from the codejock skin framework and now it works as expected.

Thanks for your suggestions

pijnappel
Back to Top
bhuvidya View Drop Down
Newbie
Newbie
Avatar

Joined: 25 March 2009
Location: Australia
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote bhuvidya Quote  Post ReplyReply Direct Link To This Post Posted: 25 March 2009 at 7:50pm
hi there

i have a similar problem, but with flash activex control - i think your solution may be mine as well! how exactly did you "remove the window handle you assigned to the Matrox live video from the codejock skin framework"??

any help greatly appreciated
bhu

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 26 March 2009 at 3:33pm
Yes, some dlls don't like when SkinFramework hook them and solution to exclude them using Exclude method.


You can run Process Explorer from sysinternals - http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
it can show list of loaded dlls and use exclude all ado related.

SkinFramework1.ExcludeModule "Module.dll"  
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.187 seconds.