This is an area that I am coming across at the moment a lot while working
with VST plugin callbacks.

One area that I really think looking at is the way one can easily
dereference pointers to get at structures, but one cannot use the same
syntax in memoryblocks. One has to go through the tedious StringValue()
stuff.

I am forever having to declare a pointer and assign it to a memoryblock
simply to get at a structure being held in the memoryblock, or in order to
do what I want with reference to declares and callbacks.

I think the memoryblock syntax should also be reworded to match the pointer
dereferencing. 

So  mb.UInt64Value(offset)  becomes mb.UInt64(offset)

And we would also be able to do:
   dim str as MyStructname

   str = mb.MyStructname

And also mb.MyStructname( byteoffset )

It is great to have the Ptr type as a "to the metal" variable, but I think
memoryblocks and ptrs need to be as interchangeable as possible.

Another common issue is when one is given a pointer to a structure -
forexample via a callback. Currently one can dereference this by
p.Structurename, but It would be really helpful if one could also just be
able to pass Ptr types into arguments declared as Byref myStructRef as
StructureName.   

For example I am working on VST callbacks which supply a GENERIC pointer to
various different kinds of structs, so I cannot simply define the structure
pointer argument in the callback as "Byref myStructRef as StructureName" ,
since the type of structure pointed to varies. So I am forced to leave the
argument as a Ptr.  But since the callback then calls different functions
depending on type, I would like to be able to set up each function argument
with as specific "Byref myStructRef as StructureName" so as to provide more
type-safeness, and to be able to pass on the structure pointer in a type
safe fashion.




On 1/5/07 06:26, "Tim Hare" <[EMAIL PROTECTED]> wrote:

> My point was that this should be a very clear choice.  Especially when
> deciding between "as Ptr" and "ByRef as Ptr".  They're worlds apart.  On the
> other hand, "as Ptr" and "as MemoryBlock" are practically equivalent.

Regards,

Dan



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to