PlasmaZero
Programmer
Hi, I'm working on a project using some .NET things, like properties (get/set). However, visual studio .net is not recognizing the properties format and is giving me compile errors i.e. "syntax error: 'return'" and "unexpected tokens preceding ';'". I've included both system.dll and mscorlib.dll and used the (I believe) appropriate namespaces, and I can't figure out why VS.NET isn't recognizing the format. Here's one file (out of many of the project) that is getting the error.
#if !defined(TRACK)
#define TRACK
#using <system.dll>
#using <mscorlib.dll>
using namespace System;
using namespace System::Collections;
#include "seq.h"
#include "soundgen.h"
class Track : public Seq
{
public:
Track();
Track(SoundGen inst);
~Track();
double output_sample();
SoundGen Instrument {
get {
return instrument;
}
set {
instrument = value;
}
}
double Gain {
get {
return gain;
}
set {
gain = value;
}
}
// Note manip
void addNote(Note note);
void removeNote(int index);
void insertNote(int index, Note note);
Note getNote(int index);
private:
SoundGen instrument;
Notes notes;
double gain=1.0;
};
// Track Collection def
class Tracks : public CollectionBase
{
// Method implementation from the CollectionBase class
public void Add(Track track){
List.Add(track);
}
// Method implementation from the CollectionBase class
public void Remove(int index){
// Check to see if there is a Track at the supplied index.
if (index > Count - 1 || index < 0)
throw new Exception("Index out of bounds"
List.RemoveAt(index);
}
// Method implementation from the CollectionBase class
public void Insert(int index, Track track) {
List.Insert(index, track);
}
// Method implementation from the CollectionBase class
public Track Item(int Index) {
return (Track) List[Index];
}
};
#endif // TRACK
Any ideas?
Thanks,
Tom
#if !defined(TRACK)
#define TRACK
#using <system.dll>
#using <mscorlib.dll>
using namespace System;
using namespace System::Collections;
#include "seq.h"
#include "soundgen.h"
class Track : public Seq
{
public:
Track();
Track(SoundGen inst);
~Track();
double output_sample();
SoundGen Instrument {
get {
return instrument;
}
set {
instrument = value;
}
}
double Gain {
get {
return gain;
}
set {
gain = value;
}
}
// Note manip
void addNote(Note note);
void removeNote(int index);
void insertNote(int index, Note note);
Note getNote(int index);
private:
SoundGen instrument;
Notes notes;
double gain=1.0;
};
// Track Collection def
class Tracks : public CollectionBase
{
// Method implementation from the CollectionBase class
public void Add(Track track){
List.Add(track);
}
// Method implementation from the CollectionBase class
public void Remove(int index){
// Check to see if there is a Track at the supplied index.
if (index > Count - 1 || index < 0)
throw new Exception("Index out of bounds"
List.RemoveAt(index);
}
// Method implementation from the CollectionBase class
public void Insert(int index, Track track) {
List.Insert(index, track);
}
// Method implementation from the CollectionBase class
public Track Item(int Index) {
return (Track) List[Index];
}
};
#endif // TRACK
Any ideas?
Thanks,
Tom