VS 2008 C# midi program

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small <font size=2 color="#0000ff <font size=2 color="#0000ff
Im trying to play a midi note from my web application in C# in VS 2008<br/>My program wont complie<br/>Whatam I doing wrong?<br/>Heres my form file:<br/><br/>using
</font></font><font size=2 color="#0000ff
 
</font>
<span style="font-size:x-small System;
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small <font size=2 color="#0000ff <font size=2 color="#0000ff
using
</font></font><font size=2 color="#0000ff
 
</font>
<span style="font-size:x-small System.Collections.Generic;
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small <font size=2 color="#0000ff <font size=2 color="#0000ff
using
</font></font><font size=2 color="#0000ff
 
</font>
<span style="font-size:x-small System.Windows.Forms;
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small <font size=2 color="#0000ff <font size=2 color="#0000ff
using
</font></font><font size=2 color="#0000ff
 
</font>
<span style="font-size:x-small System.ComponentModel;
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small <font size=2 color="#0000ff <font size=2 color="#0000ff
using
</font></font><font size=2 color="#0000ff
 
</font>
<span style="font-size:x-small System.Diagnostics;
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small <font size=2 color="#0000ff <font size=2 color="#0000ff
using
</font></font><font size=2 color="#0000ff
 
</font>
<span style="font-size:x-small System.Runtime.InteropServices;
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small <font size=2 color="#0000ff <font size=2 color="#0000ff
using
</font></font><font size=2 color="#0000ff
 
</font>
<span style="font-size:x-small System.Text;
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small <font size=2 color="#0000ff <font size=2 color="#0000ff
namespace
</font></font><font size=2 color="#0000ff
 
</font>
<span style="font-size:x-small WindowsFormsApplication1
{
<font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small partial<span style="font-size:x-small <span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small class<span style="font-size:x-small <span style="color:#2b91af;font-size:x-small <span style="color:#2b91af;font-size:x-small Form1
<span style="font-size:x-small
{
 
<font size=2>
[
</font>
<span style="color:#2b91af;font-size:x-small <span style="color:#2b91af;font-size:x-small DllImport<span style="font-size:x-small (<span style="color:#a31515;font-size:x-small <span style="color:#a31515;font-size:x-small "Winmm.dll"<span style="font-size:x-small )]<font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small static<span style="font-size:x-small <span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small extern<span style="font-size:x-small <span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small uint<span style="font-size:x-small midiInGetNumDevs();<font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small long <span style="font-size:x-small hndle;<font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small int<span style="font-size:x-small result = midiOutOpen(hndle, 0, 0, 0, 0);<font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small int<span style="font-size:x-small r = midiOutShortMsg(hndle, 0x00403C90);
 
 
 
 
<font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small <span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small <summary>
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small Required designer variable.
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small <span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small </summary>
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small private<span style="font-size:x-small System.ComponentModel.<span style="color:#2b91af;font-size:x-small <span style="color:#2b91af;font-size:x-small IContainer<span style="font-size:x-small components = <span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small null<span style="font-size:x-small ;<font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small <span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small <summary>
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small Clean up any resources being used.
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small <span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small </summary>
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small <span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small <param name="disposing <span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small true if managed resources should be disposed; otherwise, false.<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small </param>
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small protected<span style="font-size:x-small <span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small override<span style="font-size:x-small <span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small void<span style="font-size:x-small Dispose(<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small bool<span style="font-size:x-small disposing)
{
<font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small if<span style="font-size:x-small (disposing && (components != <span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small null<span style="font-size:x-small ))
{
components.Dispose();
}
<font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small base<span style="font-size:x-small .Dispose(disposing);
}

<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small <font size=2 color="#0000ff <font size=2 color="#0000ff
#region
</font></font><font size=2 color="#0000ff
 
</font>
<span style="font-size:x-small Windows Form Designer generated code<font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small <span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small <summary>
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small Required method for Designer support - do not modify
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small the contents of this method with the code editor.
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small ///<span style="color:#008000;font-size:x-small <span style="color:#008000;font-size:x-small <span style="color:#808080;font-size:x-small <span style="color:#808080;font-size:x-small </summary>
<span style="font-size:x-small <font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small private<span style="font-size:x-small <span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small void<span style="font-size:x-small InitializeComponent()
{
<font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small this<span style="font-size:x-small .components = <span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small new<span style="font-size:x-small System.ComponentModel.<span style="color:#2b91af;font-size:x-small <span style="color:#2b91af;font-size:x-small Container<span style="font-size:x-small ();<font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small this<span style="font-size:x-small .AutoScaleMode = System.Windows.Forms.<span style="color:#2b91af;font-size:x-small <span style="color:#2b91af;font-size:x-small AutoScaleMode<span style="font-size:x-small .Font;<font size=2>
 
</font>
<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small this<span style="font-size:x-small .Text = <span style="color:#a31515;font-size:x-small <span style="color:#a31515;font-size:x-small "Form1"<span style="font-size:x-small ;
}

<span style="color:#0000ff;font-size:x-small <span style="color:#0000ff;font-size:x-small
#endregion
<span style="font-size:x-small
}
}


View the full article
 
Back
Top