How to write a Declare for a sub?

  • Thread starter Thread starter **Developer**
  • Start date Start date
D

**Developer**

How to write a Declare for a sub? For example:void CoTaskMemFree(
void * pv
);Strict On does not like:Public Declare Function CoTaskMemFree Lib "ole32"
(ByVal hMem As IntPtr)because it has no "As clause"Thanks
 
How to write a Declare for a sub? For example:void CoTaskMemFree(
void * pv
);Strict On does not like:Public Declare Function CoTaskMemFree Lib "ole32"
(ByVal hMem As IntPtr)because it has no "As clause"Thanks

Sure!
A function must have a return type.
Use Sub instead.
 
What can I say?
I've done Declares many many times and always it was Function (and I used to
write C) so I never occurred to me - oh well!

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top