4 of 9
4
CsTI - CSharp Touchlib Interface
Posted: 18 April 2008 05:13 AM   [ Ignore ]   [ # 46 ]
Jr. Member
Avatar
RankRank
Total Posts:  120
Joined  2008-01-28

An unhandled exception of type ‘System.MethodAccessException’ occurred in mscorlib.dll

Additional information: TouchlibWrapper.CsTI..ctor()

am on windows XP .. SP2

:(

 Signature 

..’m not the best..but ‘m not like the rest....

Profile
 
 
Posted: 18 April 2008 05:30 AM   [ Ignore ]   [ # 47 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

hi to everyone that’s having problems.

I’ve been quite busy with university projects the past months so my apologies to you all for not helping out with the problems. I’m away for the weekend and will be back on monday. On monday I will add see if I can add a recapture background (touchlib’s loop might be a problem) to CsTI and fix the accessviolation problems that’s causing the headaches. I’ll also update the svn and fix it for the touchlib beta 2 version.

Again, my apologies.

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 18 April 2008 05:32 AM   [ Ignore ]   [ # 48 ]
Jr. Member
Avatar
RankRank
Total Posts:  120
Joined  2008-01-28

can u plz tell me to somehow resolve this issue for a timebeing ... its a bit urgent for me ... plzzz

 Signature 

..’m not the best..but ‘m not like the rest....

Profile
 
 
Posted: 18 April 2008 05:37 AM   [ Ignore ]   [ # 49 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

to be honest I’m not very sure what’s causing it. I know I had the problem some time ago but cannot remember what fixed it. Does it happen in Debug and RELEASE mode?

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 21 April 2008 03:50 AM   [ Ignore ]   [ # 50 ]
New Member
Rank
Total Posts:  9
Joined  2008-03-25

Hi Mj,

I was also running into the FileNotFound exception - are you trying to recompile CsTI from scratch, or just use it in a C# app as a DLL?

One possible approach is to use DependencyWalker (here) and examine the DLLs (CsTI.dll and TouchlibWrapper.dll) to see if they’re missing any links?

Profile
 
 
Posted: 21 April 2008 07:11 AM   [ Ignore ]   [ # 51 ]
Jr. Member
Avatar
RankRank
Total Posts:  120
Joined  2008-01-28

am trying to just use it in a C# app as a dll ....
ill try with Dependency walker .....
thnx

 Signature 

..’m not the best..but ‘m not like the rest....

Profile
 
 
Posted: 21 April 2008 07:37 AM   [ Ignore ]   [ # 52 ]
Jr. Member
Avatar
RankRank
Total Posts:  120
Joined  2008-01-28

tried with Dependancy walker ... there were some dll files missing, so i added them to the right locations .....

I can just add CsTI.dll as a reference ... cannot add TouchLibWrapper.dll to reference ....
while compiling i get this : ‘TouchlibWrapper.CsTI.CsTI()’ is inaccessible due to its protection level
....plus a few more errors

 Signature 

..’m not the best..but ‘m not like the rest....

Profile
 
 
Posted: 21 April 2008 08:06 AM   [ Ignore ]   [ # 53 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

That’s supposed to be like that. You cannot use the CsTI constructor. The wrapper uses the singleton design pattern so that there is no ‘accidental’ way of trying to make multiple instances of the wrapper. The reason that won’t work anyways is that only one application can use touchlib at any time.

To solve that. Use CsTI cs = CsTI.Instance();

Check out the example program included with this post

File Attachments
Program.txt  (File Size: 1KB - Downloads: 83)
 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 21 April 2008 10:27 AM   [ Ignore ]   [ # 54 ]
Jr. Member
Avatar
RankRank
Total Posts:  120
Joined  2008-01-28

now i get this ...

An unhandled exception of type ‘System.IO.FileLoadException’ occurred in mscorlib.dll

Additional information: Could not load file or assembly ‘CsTI, Version=1.0.2751.23293, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

i am using VS .NET 2008 .... i hope thts not a problem .....

 Signature 

..’m not the best..but ‘m not like the rest....

Profile
 
 
Posted: 21 April 2008 10:43 AM   [ Ignore ]   [ # 55 ]
New Member
Rank
Total Posts:  9
Joined  2008-03-25

encountered this problem as well…

I think it’s something to do with differrent versions of the various DLLs referenced by CsTI & touchlib not getting along with each other/Windows.

I’m guessing you had to move a few files named MFC80.dll, MSVCR80.dll or something similar?

Are you using donovan’s latest build of CsTI/TouchlibWrapper?

Profile
 
 
Posted: 21 April 2008 10:44 AM   [ Ignore ]   [ # 56 ]
Jr. Member
Avatar
RankRank
Total Posts:  120
Joined  2008-01-28

whew !! .... smile
Its working now .....

For those who r facing similar problems ..... download Put_These_Into_Debug.zip file and extract the contents to your program debug folder ..... the folder contains Touchlib Rev.58 and CsTI_beta 1.0 for WinXP_Vista ....
Add a reference to CsTI.dll .....
And here goes the sample code

using System;
using System.Collections.Generic;
using System.Text;

using TouchlibWrapper;

namespace TL58_testConsole
{
    
class Program
    {
        
static void Main(string[] args)
        
{
            CsTI cs 
CsTI.Instance();

            
cs.fingerDown += new fingerDownHandler(cs_fingerDown);

            
cs.startScreen();
        
}

        
static void cs_fingerDown(int IDint tagIDfloat Xfloat Yfloat anglefloat areafloat heightfloat widthfloat dXfloat dY)
        
{
            Console
.WriteLine("DOWN : " ID);
        
}
    }
}

the problem was due to version mismatch i guess ....

THANX A TON donovan !! smile ...... thts a gr8 work !! ..... ill be trying it with VB .NET now ......

*EDIT*
@owenhindley
hehehe ... we posted at the same time it seems .... thnx anyways .... smile

 Signature 

..’m not the best..but ‘m not like the rest....

Profile
 
 
Posted: 21 April 2008 01:17 PM   [ Ignore ]   [ # 57 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

I’m guessing you had to move a few files named MFC80.dll, MSVCR80.dll or something similar?

yeah, the visual c 2005 redist is needed for it to run.

owenhindley: have you had any luck compiling and getting it to work? I’m updating my touchlib and will start working in a few minutes on it.

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 21 April 2008 04:57 PM   [ Ignore ]   [ # 58 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

owenhindley: mine compiles and runs fine. only when I press ESC from a touchlib window does it give the accessviolation thing. I’ll look into that now. but otherwise it works. If yours doesn’t want to work. I’ll send you my VS2008 solutions. Maybe it’s a vista thing..grin

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 22 April 2008 04:14 AM   [ Ignore ]   [ # 59 ]
New Member
Rank
Total Posts:  9
Joined  2008-03-25

hi donovan, if you could send me your VS2008 solutions, that’d be really useful, thankyou!

I’m not sure where the problem lies my end - possibly is a Vista thing, I can create an instance of CsTI, and pass data back and forth between TouchlibWrapper, CsTI and C# no problem (by adding in a quick test function and passing numbers around), but the second a Touchlib method is called, it throws the AccessViolation exception.. very strange!

Profile
 
 
Posted: 22 April 2008 08:25 AM   [ Ignore ]   [ # 60 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

that is really strange. might be that it is building against a different version of touchlib.LIB file than the touchlib.DLL. That’s all I can think at the moment. So if it still gives the same problems. Get the latest touchlib source, compile it, and use the lib and dll from that compile for compiling the wrapper.

the vs2008 solutions are available here -> http://www.whitespaced.co.za/ftir/CsTI08.zip

the solutions are not really structured nicely, but I’m looking to do some major updates to the wrapper like not needing the touchlib.lib file to compile. instead make function pointer to the dll which will make life much better.

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
   
4 of 9
4