Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Error: Must declare a body because it is not marked abstract, extern, or partial (http://www.go4expert.com/forums/error-declare-body-marked-abstract-t17864/)

MikeMak27 5Jun2009 02:32

Error: Must declare a body because it is not marked abstract, extern, or partial
 
I'm writing a program for work and I consistently get the same error so the program will not compile. Towards the end of the code, I keep getting an error for the line,
private void Form1_Load(object sender, EventArgs e);

The error code says: Error 1 'XTAPI_Tutorial.Form1.Form1_Load(object, System.EventArgs)' must declare a body because it is not marked abstract, extern, or partial.
Does anyone have any ideas. I am a newbie to the code language and cannot figure out what I am doing wrong. I am using VisualStudio2008. Thank You
Code: CSharp

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using XTAPI;
namespace XTAPI_Tutorial
{
public partial class Form1 : Form
{
private TTGate ttGate = new TTGate();
private TTDropHandler m_drop = null;
private TTInstrObj m_instr = null;
private TTInstrNotifyClass m_notify = null;
public Form1()
{
InitializeComponent();
m_drop = new TTDropHandler();
m_drop.RegisterDropWindow((int)this.Handle);
m_drop.OnNotifyDrop += new _ITTDropHandlerEvents_OnNotifyDropEventHandler(m_drop_OnNotifyDrop);
m_notify = new TTInstrNotifyClass();
m_notify.OnNotifyFound += new _ITTInstrNotifyEvents_OnNotifyFoundEventHandler(m_notify_OnNotifyFound);
m_notify.OnNotifyNotFound += new _ITTInstrNotifyEvents_OnNotifyNotFoundEventHandler(m_notify_OnNotifyNotFound);
m_notify.OnNotifyUpdate += new _ITTInstrNotifyEvents_OnNotifyUpdateEventHandler(m_notify_OnNotifyUpdate);
m_notify.OnNotifyDepthData += new _ITTInstrNotifyEvents_OnNotifyDepthDataEventHandler(m_notify_OnNotifyDepthData);
m_notify.EnableDepthUpdates = 1;
}
void m_notify_OnNotifyDepthData(TTInstrNotify pNotify, TTInstrObj pInstr)
{
try
{ }
catch (System.Exception e)
{
MessageBox.Show(e.Message);
}
throw new NotImplementedException();
}
void m_notify_OnNotifyUpdate(TTInstrNotify pNotify, TTInstrObj pInstr)
{
try
{
string priceStr = (string)pInstr.get_Get("Last");
}
catch (System.Exception e)
{
MessageBox.Show(e.Message);
}
throw new NotImplementedException();
}
void m_notify_OnNotifyNotFound(TTInstrNotify pNotify, TTInstrObj pInstr)
{
MessageBox.Show("Instrument could not be found");
throw new NotImplementedException();
}
void m_notify_OnNotifyFound(TTInstrNotify pNotify, TTInstrObj pInstr)
{
try
{
Array data = (Array)pInstr.get_Get("Contract,Exchange");
string contract = data.GetValue(0).ToString();
string exchange = data.GetValue(1).ToString();
this.Text = contract + " " + exchange;
}
catch (System.Exception e)
{
MessageBox.Show(e.Message);
}
throw new NotImplementedException();
}
void m_drop_OnNotifyDrop()
{
throw new NotImplementedException("The method of operation is not implemented.");
}
private void Form1_Load(object sender, EventArgs e);
 
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
ttGate.XTAPITerminate();
}
}
}


SaswatPadhi 21Jun2009 18:25

Re: Error: Must declare a body because it is not marked abstract, extern, or partial
 
Look at this line :
Code: CSharp

private void Form1_Load(object sender, EventArgs e);

Delete this line and everything will be fine ! :)


All times are GMT +5.5. The time now is 00:00.