I have library code in c# using Z339xLib.dll file the code is :
#region Assembly Z339xLib.dll, v4.0.30319
// C:\Documents and Settings\Hytham\Desktop\Software Protocol n Image Capture SDK_New\Software Protocol n Image Capture SDK\Z339x_SDK_Sample\Z339x_SDK_Sample\bin\Debug\Z339xLib.dll
#endregion
using System;
using System.Drawing;
namespace Z339xLib
{
public class Z339xLibSdk
{
public Z339xLibSdk();
public bool GetImageAndSaveFile(string portname, string filename, int type);
public Bitmap GetImageByBitmap(string portname);
public string SearchDevice_VCOM();
}
}
I need to convert this code to delphi programing, i create a code in delphi like this:
unit Z339xLib_Sdk;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics,Controls,Dialogs,
StdCtrls, ExtCtrls;
Const Z339xLibSdk = 'Z339xLib.dll';
function GetImageAndSaveFile(hport:WideString;ImageDir:WideString;Imagetype:integer): boolean; stdcall;external Z339xLibSdk;
function GetImageByBitmap(hport:WideString): BITMAP; stdcall;external Z339xLibSdk;
function SearchDevice_VCOM : string; stdcall;external Z339xLibSdk;
implementation
end.
when call the function i get error :
the applicaion failed to intialize properly(0xc000007b)
please any help or there is any problem with my syantex code.
and this is explaining of the function:
Function bool GetImageAndSaveFile(String Port_Name, String File_Name, int Format);
Parameters String Port_Name = Virual Com Port Name(ex. COM1…).
Or you can just use “AUTO” as a serial port name, system will automatic search the device.
String File_Name A string that contains the name of the file to which to save this Image.
int Format Image Format
0: png
1:bmp
2:Jpeg
3:Tiff
Return values True: Success
False: error occurred.
thanks for your help
User contributions licensed under CC BY-SA 3.0