Page 1 of 1

Visual Studio program won't work

Posted: Tue Apr 28, 2015 1:12 pm
by hadamhe
I'm new to iX Developer so sorry if this is a stupid question. I wrote a C# app in Visual Studio 2010 to run on Windows CE which works fine. I've copied my code over to the iX Developer environment and now it won't build. In VS code is

Namespace ReaderConnect
{
public partial class Screen1 : Form, FeIscListener
{

but iX doesn't like this. I get an error "Partial declarations of 'Neo.ApplicationFramework.Generated.Screen1' must not specify different base classes

Any ides?

Changing it to
Namespace ReaderConnect
{
public partial class Screen1
{
fixes the initial error but causes more errors with my event listeners.

Re: Visual Studio program won't work

Posted: Thu May 07, 2015 11:59 am
by AMitchneck
This is a limitation of C#, nothing to do with iX Developer. Classes can only include one base class (such as Form) but can include multiple interfaces (such as IDisposable). I don't know what your FeIscListener is, but from what I can tell you want to create an object of type FeIscListener in your Screen1 class and reference this.

public partial class Screen1 : Form
{
FeIscListener listener = new FeIscListener();

Re: Visual Studio program won't work

Posted: Mon May 18, 2015 9:22 am
by hadamhe
Adam,

FeIscListener is an interface and the C# code works fine in Visual studio. Here's some more of the code to hopefully offer more clarity. Without the FeIscListener listed after Form the AddEventListner causes an error. Any other ideas?

namespace ReaderConnect
{
public partial class frmMain : Form , FeIscListener
{
public frmMain()
{
//Registry from Events send and receive
fedm.AddEventListener(this, FeIscListenerConst.SEND_STRING_EVENT);
fedm.AddEventListener(this, FeIscListenerConst.RECEIVE_STRING_EVENT);

Re: Visual Studio program won't work

Posted: Mon May 18, 2015 8:47 pm
by AMitchneck
OK, I think I understand your problem. iX developer does not use the standard windows Form class. Instead it uses "Neo.ApplicationFramework.Controls.Controls.Form" or another screen (if set to use another screen as a background).

To fix your problem, initialize your screen using the following:

public partial class frmMain : FeIscListener

iX developer will automatically set the screen as a form using the auto-coded portion of the partial class definition meaning you don't need to.

Re: Visual Studio program won't work

Posted: Wed May 20, 2015 8:31 am
by hadamhe
Adam,

That fixed the problem, thanks for all the help!