Visual Studio program won't work

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
hadamhe
Posts: 4
Joined: Tue Apr 28, 2015 12:55 pm

Visual Studio program won't work

Post 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.

AMitchneck
Posts: 137
Joined: Mon Jun 11, 2012 2:10 pm

Re: Visual Studio program won't work

Post 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();
Adam M.
Controls Engineer
FlexEnergy

hadamhe
Posts: 4
Joined: Tue Apr 28, 2015 12:55 pm

Re: Visual Studio program won't work

Post 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);

AMitchneck
Posts: 137
Joined: Mon Jun 11, 2012 2:10 pm

Re: Visual Studio program won't work

Post 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.
Adam M.
Controls Engineer
FlexEnergy

hadamhe
Posts: 4
Joined: Tue Apr 28, 2015 12:55 pm

Re: Visual Studio program won't work

Post by hadamhe »

Adam,

That fixed the problem, thanks for all the help!

Post Reply