当前位置: 代码迷 >> WinCE >> 在wince上写C# Message消息出错!
  详细解决方案

在wince上写C# Message消息出错!

热度:27   发布时间:2016-04-28 12:55:53.0
在wince下写C# Message消息出错!!!!求救!!!
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices; //add by daidongyan
using System.Collections;
using System.Threading;
using Microsoft.Win32;
using System.Diagnostics;
using System.IO;

public struct COPYDATASTRUCT 
  { 
  public IntPtr dwData; 
  public int cbData; 
  //[MarshalAs(UnmanagedType.LPStr)]  
  public IntPtr lpData; 
  } 
  protected override void DefWndProc(ref System.Windows.Forms.Message m) 
  { 
  switch(m.Msg) 
  { 
  case WM_COPYDATA: 
  COPYDATASTRUCT mystr = new COPYDATASTRUCT(); 
  Type mytype = mystr.GetType(); 
  mystr =(COPYDATASTRUCT)m.GetLParam(mytype); 
  this.textBox1.Text =mystr.lpData; 
  break; 
  default: 
  //base.DefWndProc(ref m); 
  break; 
  } 
  } 

E:\vs2008\IDR400-TEST08\IDR400-TEST08\Form1.cs(600,76): error CS0234: The type or namespace name 'Message' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?)

Compile complete -- 1 errors, 0 warnings

------解决方案--------------------
C#没使用过,Google下吧
  相关解决方案