MMカスタマイズ順序


1. General Settings 一般設定

国・通貨、単位、カレンダー

2. Organization 組織構造
  • 会社コード、管理領域
  • 購買組織、購買グループ
  • 評価エリア
  • プラント、保管場所
3. Master Data for MM マスタデータ
  • 品目マスタ
  • 仕入先マスタ
4. Valuation and Account Assignment 評価及び勘定割当
5. Purchasing 購買
6. Inventory Management 在庫管理

C#中汉字转日文カタカナ失败

05-22

采取的方式是调用com对象处理,下面是核心代码rnrnrnrn [DllImport("imm32.dll")]rn public static extern IntPtr ImmGetContext(IntPtr hwnd);rnrn [DllImport("User32.dll")]rn public static extern IntPtr GetKeyboardLayout(int hwnd);rnrn [DllImport("imm32.dll")]rn public static extern int ImmGetConversionList(IntPtr hKL, IntPtr hIMC, string lpSrc, IntPtr lpDst, int dwBufLen, int uFlag);rnrn [DllImport("imm32.dll")]rn public static extern bool ImmReleaseContext(IntPtr hwnd, IntPtr hIMC);rnrnrn const int GCL_REVERSECONVERSION = 0x0002;rn [StructLayout(LayoutKind.Sequential)]rn public class CANDIDATELISTrn rn public int dwSize;rn public int dwStyle;rn public int dwCount;rn public int dwSelection;rn public int dwPageStart;rn public int dwPageSize;rn public int dwOffset;rn rnrn rnrn public string GetReverseConversion(string AText)rn rn IntPtr AHwnd = this.Handle;rn string[] strList = null;rn IntPtr hIMC = ImmGetContext(AHwnd);rn IntPtr hKL = GetKeyboardLayout(0);rn if ((hIMC != IntPtr.Zero) && (hKL != IntPtr.Zero))rn rn CANDIDATELIST list = new CANDIDATELIST();rn int dwSize = ImmGetConversionList(hKL, hIMC, AText, IntPtr.Zero, 0, GCL_REVERSECONVERSION);rn if (dwSize > 0)rn rn IntPtr BufList = Marshal.AllocHGlobal(dwSize);rn ImmGetConversionList(hKL, hIMC, AText, BufList, dwSize, GCL_REVERSECONVERSION);rn Marshal.PtrToStructure(BufList, list);rn byte[] buf = new byte[dwSize];rn Marshal.Copy(BufList, buf, 0, dwSize);rn Marshal.FreeHGlobal(BufList);rn int os = list.dwOffset;rn string str = System.Text.Encoding.Default.GetString(buf, os, buf.Length - os);rn str = Regex.Replace(str, @"\0+$", "");rn char[] par = "\0".ToCharArray();rn strList = str.Split(par);rn bool returnValue = ImmReleaseContext(AHwnd, hIMC);rn rn rn string katakana = Microsoft.VisualBasic.Strings.StrConv(strList[0], Microsoft.VisualBasic.VbStrConv.Katakana, 0);rn return Microsoft.VisualBasic.Strings.StrConv(katakana, Microsoft.VisualBasic.VbStrConv.Narrow, 0); ;rn rnrn rnrn现在有个问题,假设点button后直接处理,不会出异常:rnrnstring text_kana = GetReverseConversion(this.textBox1.Text);rn this.textBox2.Text = text_kana;rnrn rnrn但是如果先弹出message后,便出现nullreference异常,rnrnMessageBox.Show("メッセージ表示");rn string text_kana = GetReverseConversion(this.textBox1.Text);rn this.textBox2.Text = text_kana;rnrn rnrn为啥呢?rnrnrn

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试