Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Visual Studio program won't work
PostPosted: Tue Apr 28, 2015 1:12 pm 

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

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


 Profile  
 
 Post subject: Re: Visual Studio program won't work
PostPosted: Thu May 07, 2015 11:59 am 

Joined: Mon Jun 11, 2012 2:10 pm
Posts: 89

Offline
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


 Profile  
 
 Post subject: Re: Visual Studio program won't work
PostPosted: Mon May 18, 2015 9:22 am 

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

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


 Profile  
 
 Post subject: Re: Visual Studio program won't work
PostPosted: Mon May 18, 2015 8:47 pm 

Joined: Mon Jun 11, 2012 2:10 pm
Posts: 89

Offline
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


 Profile  
 
 Post subject: Re: Visual Studio program won't work
PostPosted: Wed May 20, 2015 8:31 am 

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

Offline
Adam,

That fixed the problem, thanks for all the help!


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: