allocation of untagged structures

From: Douglas G. Danforth <"Douglas>
Date: Sun, 29 Dec 2002 12:06:15 -0500

----boundary-LibPST-iamunique-255580307_-_-
Content-type: text/plain

Folks,

I am attempting to do a very simple COM interface following
the suggestion in Platform-Specific Issues Using COM without
special Direct-To-COM compiler.

I had thought this would be easy but NEW cannot be used
to allocate untagged structures which are needed by COM.
So how can I allocate an arbitrary number of instances
of a COM object?

Must I count the number of bytes in the data structure
desired then allocate a BYTE array of that size
using NEW and then assign the address of the first
element of that array to an untagged pointer?

That doesn't seem too safe for when releasing the
data when the reference count goes to zero I somehow
must recapture the actual pointer to the BYTE array
and set it to zero for actual garbage collection.

How do I keep the reference count and garbage collection
processes separate?

-Doug
--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-255580307_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
c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