* * *

Author Topic: New OS X wiki pages  (Read 4250 times)

Phil

  • Hero Member
  • *****
  • Posts: 2653
New OS X wiki pages
« 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

amartitegui

  • Jr. Member
  • **
  • Posts: 82
Re: New OS X wiki pages
« Reply #1 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?

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus