这个是delphi下的调用语句:
===========
unit Unit1;interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
Function OpenImage (Const str1 : string ;Var ch1 : LongWord;Var ch2 : LongWord;Var ch3 : LongWord;Var ch4 : LongWord ): LongWord; Stdcall; External 'DISCERN.dll';
type
  TForm1 = class(TForm)
    Button1: TButton;
    OpenDialog1: TOpenDialog;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
  str1:string;
  s,c1,c2,c3,c4:LongWord;
begin
    
    str1:= extractfilepath(paramstr(0)) + '061031163601Code.bmp' ;
    s:= OpenImage(str1 , c1 , c2 , c3 , c4);
    edit1.Text:= chr(c1) + chr(c2) + chr(c3) + chr(c4) ;
end;end.===========
这是我写的C#调用的语句,但出错啦~~说是:
[尝试读取或写入受保护的内存。这通常指示其他内存已损坏。]
请大侠帮我看看,我不会调用
=========
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }        [DllImport("discern.dll")]
        public static extern string OpenImage(string str1, char c1, char c2, char c3, char c4);        private void button1_Click(object sender, EventArgs e)
        {
            string cog_ycad = Environment.CurrentDirectory.ToString() + "\\061031163601Code.bmp";
            char c1 = char.Parse(" ");
            char c2 = char.Parse(" ");
            char c3 = char.Parse(" ");
            char c4 = char.Parse(" ");
            char s = char.Parse(" ");
            OpenImage(cog_ycad, c1, c2, c3, c4);
            textBox1.Text = c1.ToString() + c2.ToString() + c3.ToString() + c4.ToString();
        }    }
}=========顺便再给我另一个贴一个广告,也求大侠们帮帮忙
http://community.csdn.net/Expert/topic/5275/5275624.xml?temp=.1751215