mattbrailsford
United Kingdom
Asked
— Edited
Hey,
I was wondering if anyone had an example of using the EZ SDK via a console application? All the samples are full on WinForm apps, where as I would just like to create a simple console app. The problem being, it seems all connections in the WinForms apps are using the EZB_Connect user control, which doesn't work inside a console app.
Has anybody got any examples of using the SDK in a console app?
Many thanks
Matt
EZB_Connect is just your basic serial port connection. I use it cause its easier and quicker then defining a serial port and all its parameters. You can probably call, define, a new instance of EZB_connect with in the code
EZ_B.EZB_Connect newPort = new EZ_B.EZB_Connect();
I think I may have found the solution, it looks like you can do something along these lines:
var ezb = new EZ_B.EZB(); ezb.Connect(selectedComPort); // Wait for it to connect // Do your thing ezb.Disconnect();
I do seem to get some warnings though about DIrectX attempting managed execution inside OS Loader lock. Does this sound normal?
Cheers
Matt
Yes you have to disable load locker on your projects. The option should be located under build : restrictions uncheck the ability for this.
Awesome, thanks for the help.
Could really do with getting this info on the SDK documentation page I would say as it wasn't straight forward getting up and running. After doing the following though, everything seems to be set:
1: Make sure DirectX is up to date (http://www.microsoft.com/en-us/download/details.aspx?id=35) 2: Download the SDK and store the files in a memorable place 3: Create a new visual studio project 4: Make sure it's set to use .NET 3.5 5: Make sure it's set to compile to x86 6: Disable LoaderLock warnings (http://harriyott.com/2006/08/loaderlock-was-detected.aspx)
Anywho, time to go play
@mattBrailsFord, glad to hear you got it figured out The SDK ZIP file contains a README.TXT with those instructions
DJ had something up for it before but things got shifted around since EZ-Robot took off.
Haha, you are absolutely right, it was all there in the readme. Lol, typical guy, never wants to read the instructions