我用delphi写了一个dll函数,在打印前预览一下所打印的文档是否正确函数形式如下:
procedure PrvBarcode(bpreview:boolean;strBarcode, strName, strDate, strStandard: pChar;h:hdc; x: Integer);stdcall; 我在delphi 中
procedure PrvBarcode(strBarcode, strName, strDate, strStandard: pChar;h:hdc; x: Integer);stdcall;external 'lenx.dll';
PrvBarcode('1234134234','wlefsl','2004-09-08','lskdfls',image1.Canvas.Handle,5);
无论预览还是打印都完全正确,但是我在C#中
[DllImport("lenx.dll", CharSet=CharSet.Auto)]
public static extern  void PrvBarcode(bool bpreview,string strBarcode,string strName, string strDate,string strStandard,System.IntPtr h,int x);
private System.Windows.Forms.PictureBox img11;
PrvBarcode(true,"12","we","dd","lll",img11.Handle,2); 中打印正确,预览没有反应,请高手帮忙因为打印句柄直接在delphi中,预览要把句柄传给当前的窗口句柄中,delphi中我直接传给了image.convas1.handle,但是在C#中我把他传给img11.handle 就没有反应