Forum > Beginners

Import .dll faild!

(1/1)

lijinjie:
Lazarus Ver 2.012

The ControlCAN.dll is for driving the USB-CAN adapter.  there is an example code of Delphi 7, I tried to use it on Lazarus, but got faild.

The .dll file and interface file are included in Delphi7_Example(En).rar.

:) I need your help,Please!

GetMem:

--- Quote from: lijinjie on October 25, 2021, 04:13:34 am ---Lazarus Ver 2.012

The ControlCAN.dll is for driving the USB-CAN adapter.  there is an example code of Delphi 7, I tried to use it on Lazarus, but got faild.

The .dll file and interface file are included in Delphi7_Example(En).rar.

:) I need your help,Please!


--- End quote ---
Where is the converted Lazarus project? You didn't even try to convert it did you? See attachment...

lijinjie:

--- Quote from: GetMem on October 25, 2021, 08:15:39 am ---
--- Quote from: lijinjie on October 25, 2021, 04:13:34 am ---Lazarus Ver 2.012

The ControlCAN.dll is for driving the USB-CAN adapter.  there is an example code of Delphi 7, I tried to use it on Lazarus, but got faild.

The .dll file and interface file are included in Delphi7_Example(En).rar.

:) I need your help,Please!


--- End quote ---
Where is the converted Lazarus project? You didn't even try to convert it did you? See attachment...

--- End quote ---

I did, and tried the converted code . :) .  I suppose it's a version problem of Lazarus, So I uploaded the orignal delphi code.

the interface file :  ControlCAN.pas  and ControlCAN.dll .

import the controlCAN.pas, put controlCAN.dll into the project folder.      you don't really need to write too many code .


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit Unit1; {$mode Delphi}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,ControlCAN; type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    procedure Button1Click(Sender: TObject);  private   public   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject);begin     VCI_OpenDevice(1,0,0)end; end.
[Edited to add code tags: Please read How to use the Forums]

lijinjie:
I was tring to make it as a widget for the Lazarus.  than I could easly use the USB-CAN interface.

Navigation

[0] Message Index

Go to full version