[quote=379584:@Bernardo Monsalve]tnaks for answer, I add the attibute StructureAlignment to 4, but does work, chk the offsetof in vc and change to match the offset, I don’t know if I do it well, just change uint16->uint32, uint8->uint32, and so on, I see the correct valuesn in xojo, but i still have issues, maybe chk a docens of structures. Meanwhile… structures are a chunk of memory, maybe i write wrong the structures, but I do nothing with it, just hold it and pass to other declare function for do some work, in that case, that particulary case, does not matter if I’m wrong with the structure, the other fuction shoud be do the job, or I missing somthing?
thanks again, @anon20074439 , @Andrew Lambert , thank you for take the time to answer[/quote]
If you are not using the structure then using a memoryblock of size 20 will be fine to receive the data and pass it onto another call.
[quote=379588:@Bernardo Monsalve]Another question: with this code:
[code] Dim result As Int32
Soft Declare Function some_function Lib TheLib (par1 As Ptr, par2 As Ptr, time As UInt32) As Int32
result= some_function(myPar1, myPar2, time)
Return result[/code]
In step by step debug the cursor salts from line “result= some_function(myPar1, myPar2, time)” to another part! dont pass for “Return result”, no shows errors or debug messages, obiously doesn’t do the function job.
Any idea? I appreciate your input![/quote]
The data you’re sending to the call might be incorrectly formatted which could cause unexpected behaviour. If you put a “Break” (not a breakpoint) after the call to some_function does it ever stop there? If your app is threaded it might yield there and take you off to another part of the app, when it comes back it should hit the break on the next line. If the call to some_function creates a thread, that might also cause an issue. There’s so many factors, without knowing the call its a bit hard to advise any further.