Internal Error Using CSharp DLL from Lazarus lazarus / 21-General ---------------------------------------------------------------------- ADMGNS · 2024-06-22 23:17 hello I am trying to use hqxSharp library written in CSharp like below to scale up an image by 4, but mister Lazarus says "Compilation raised exception internally". I don't understand the problem what.. Pls help.. Thanks Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  IHqxSharp = interface  ['{e23ca469-25ad-4601-83d0-fcefb0193147}']  end;   type THqxSharp = type class(IHqxSharp)    bmpInput: TBitmap;  bmpOutput: TBitmap;    //function Scale4(bitmap: TBitmap): TBitmap; stdcall;    function Run(scale: integer = 4): TBitmap; stdcall;  end; procedure TfrmMain.cmdHq4Click(Sender: TObject);var  hqx: THqxSharp;begin  hqx := THqxSharp.Create;   with hqx do  begin    bmpInput := TBitmap.Create;    bmpInput.Assign(imgInput.Picture.Bitmap);     bmpOutput := TBitmap.Create;    bmpOutput.Assign(imgInput.Picture.Bitmap);     Run(3);     imgOutput.Picture.Bitmap.Assign(bmpOutput);  end;end; ---------------------------------------------------------------------- Fibonacci · 2024-06-22 23:28 Seems fixed in trunk, the error there is Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Error: Syntax error, "identifier" expected but "CLASS" foundWhich goes away of you change Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type THqxSharp = type class(IHqxSharp)to Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type THqxSharp = class(IHqxSharp) ---------------------------------------------------------------------- jamie · 2024-06-22 23:38 I can be almost 100% sure, you still have a lot of code rewriting ahead of you. Basically, the bitmaps the sharp lib is expecting is most likely a Handle to a Windows Type bitmap. What you are supplying is a lazarus (LCL) component which isn't the same.  Now, you maybe able to extract the Handle from that instead? ---------------------------------------------------------------------- ADMGNS · 2024-06-23 00:01 Hello Could it be version problem?? Mine is Lazarus is ver 3.0, on Win10. Actually at side of CSharp, definition is a class type.. and output is visible COM object in a dll.. (see attch) So, but, at Lazarus side, it must be class 'type' derived from interface (via with an GUID).. Now.. When I've changed it by your suggestion, this time mister Lazarus says rightly "No matching implementation for interface method 'QueryInterface(constref TGuid;out ):LongInt; StdCall;' found" Perhaps, the best way might be do exporting the library from ground to FPascal/Lazarus.. Thanks ---------------------------------------------------------------------- jamie · 2024-06-23 00:25 You need to build the class a little differently. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  THqxSharp =  class(TIntegerFacedObject, IHQxSharp) ....End; May help ---------------------------------------------------------------------- jamie · 2024-06-23 00:49 This may also help, too. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   IHqxSharp = interface(IUnknown)  ['{e23ca469-25ad-4601-83d0-fcefb0193147}']  end; ---------------------------------------------------------------------- myisjwj · 2024-06-23 03:03 Is it possible that C # is managed code, and when loading DLLs in Lazarus, the libraries required for C #'s DLL are not loaded into the main program, such as NET Framework, etc. The DLL generated by calling VC, C++, etc. is unmanaged code and can be executed without loading other DLLs. C # has this problem, and a large part of the reason for abandoning C # back then was that C # is managed code.