Lazarus

Installation => macOS / Mac OS X => Topic started by: Phil on May 30, 2006, 08:24:14 pm

Title: New OS X wiki pages
Post by: Phil on May 30, 2006, 08:24:14 pm
I've posted a couple of pages to the Lazarus wiki that should be of interest to FPC and Lazarus programmers on OS X:

http://wiki.lazarus.freepascal.org/index.php/OS_X_Programming_Tips

http://wiki.lazarus.freepascal.org/index.php/Using_Pascal_Libraries_with_.NET_and_Mono

Feel free to post any questions here.

Thanks.

-Phil
Title: Re: New OS X wiki pages
Post by: amartitegui on February 23, 2018, 01:29:58 pm
Hi Phil.
DOnw't know if you're still at hand.
I got a little problem trying to build a dll that can be used from .net
I has to do with structures / record.
Do you know a right way to use structure and record to pass to a dll (dll lazarus)?
Pointers dont work very well... or I dont get them right.
Passing a pointer to structure using mashal:
(NewFaborderis a structure like this)
 Public Structure FabOrder     
        Public NumOrder As Int32
        Public Material As Int32
        Public Numero As Int32
    End Structure

 BufPtr = Marshal.AllocHGlobal(Marshal.SizeOf(NewFaborder))
 Marshal.StructureToPtr(NewFaborder, BufPtr, False)


and using it at dll function:
Function ReceiveOrderAndShowNumOrder(Stringer:PFaborder):PFaborder;stdcall;
begin 
  Result:=Stringer;
end;               
Being:
PFaborder=^TFabOrder;
and
TFabOrder=record
   NumOrder:int32;
   Material:int32;
   Numero:int32;
 end;     
SHould return same NEWFABORDER.
but even it does not give any error or exception, data is not correct.
Am i confusing something?
TinyPortal © 2005-2018