I have to create a COM dll from c# to use within old code. Every time I build
I get a new guid. I have tried to use the [Guid(...)] phrase before a class
or interface, but the compiler won't build due to the following messages:
Syntax error, ']' expected (shown after "[Guid" and before "("
A namespace does not directly contain members such as fields or methods
Type or namespace definition, or end-of-file expected
My code looks like:
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace EvalAndReview
{
/// <summary>
/// Summary description for SpectCharts.
/// </summary>
///
// interface
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[Guid{"1D99B653-4AD4-41c6-9D0F-46C366FB43A6"}]
public interface IDataReviewCharts
{
void ClearChart (int chart);
void SetRawSpectrumPointlist (int curve, int size);
void SetBGSubSpectrumPointlist (int curve, int size);
void SetLibSpectrumPointlist (int curve, int size);
void LoadRawSpectrumPoint (double x, double y);
void LoadBGSubSpectrumPoint (double x, double y);
void LoadLibSpectrumPoint (double x, double y);
}
[ClassInterface(ClassInterfaceType.AutoDual)]
[Guid{"1D99B653-4AD4-41c6-9D0F-46C366FB43A6"}]
public class DataReviewCharts : System.Windows.Forms.Form
{
...
}
Any help in getting this to build will be greatly appreciated.
Thanks