View previous topic :: View next topic |
Author |
Message |
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Mon Apr 15, 2013 4:58 pm Post subject: Calling CoTaskMemAlloc from within FTN95 |
|
|
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 |
|
Back to top |
|
 |
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Tue Apr 16, 2013 3:39 pm Post subject: |
|
|
ok, sussed it... i think:
Code: |
STDCALL CoTaskMemAlloc_ 'CoTaskMemAlloc'(VAL) : INTEGER*8
INTEGER*8 :: ILOCN
ILOCN = CoTaskMemAlloc_(260)
|
and include OLE32.DLL in my link.
K |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Apr 16, 2013 4:58 pm Post subject: |
|
|
You would normally use INTEGER*4 for the returned pointer but it probably won't do any harm to use INTEGER*8. |
|
Back to top |
|
 |
|