Silverfrost Forums

Welcome to our forums

Calling CoTaskMemAlloc from within FTN95

15 Apr 2013 3:58 #12065

For reasons too complicated to go into here, i've been advised by a 3rd party, that to use their DLL, I need to allocate string memory using CoTaskMemAlloc before passing the buffer to them. They know nothing about FTN95, I know nothing about their DLL.

What combniation of STDCALL or whatever do I need to implement a call to the following?

http://msdn.microsoft.com/en-gb/library/windows/desktop/ms692727%28v=vs.85%29.aspx

TIA

K

16 Apr 2013 2:39 #12079

ok, sussed it... i think:

    STDCALL CoTaskMemAlloc_ 'CoTaskMemAlloc'(VAL) : INTEGER*8
 
    INTEGER*8   ::  ILOCN

    ILOCN   =  CoTaskMemAlloc_(260)

and include OLE32.DLL in my link.

K

16 Apr 2013 3:58 #12081

You would normally use INTEGER4 for the returned pointer but it probably won't do any harm to use INTEGER8.

Please login to reply.