Board logo

Subject: 已解决 [Print This Page]

Author: listary    Time: 2019-1-3 15:48     Subject: 已解决

有个问题困扰很久了,请各位老师帮助。在弄一个项目,要把图像显示到界面上,要把VB的代码转为Delphi的项目,VB或CSharp的代码是这样
C#:
//Dll 函数声明:
[DllImport("iClientApi.dll", EntryPoint = "iClientSetWindow")]
public static extern bool  iClientSetWindow(IntPtr pIClient, IntPtr hWnd);
iClientLib.iClientSetWindow( pIClient, pictureBox1.Handle );  //这个用了一个Picture控件来显示图片 可以显示
VB6:
'Dll 函数声明:
Declare Function iClientSetWindow Lib "iClientApi.dll" (ByVal pIClient As Long, ByVal hWnd As Long) As Boolean
iClientSetWindow pIClient, Display.hWnd     '这个用了一个Frame控件来显示图片
我转成Delphi7来显示图片总是不成功
//Dll函数声明:
Function iClientSetWindow(pIClient:Cardinal; hWnd:THandle):Boolean; stdcall; external 'iClientApi.dll';
tmpBool := iClientSetWindow(pIClient, img1.Canvas.Handle);   //这里用了一个Image控件,显示不出来

请老师帮忙!

[ 本帖最后由 listary 于 2019-1-3 15:57 编辑 ]




Welcome to CnPack Forum (http://bbs.cnpack.org/) Powered by Discuz! 5.0.0