Can I call COM functions from HLA?

All I really need to do is call CoInitialize and CoUninitialize so that I can eliminate these calls from Ernie's Image.lib, that I use to load large numbers of images, inside a loop. Repeatedly starting and stopping COM can cause unpredictable results.

Image.lib is writen in MASM32, but I wrote an HHF for it, so I can call it from my HLA code.

WK
Posted on 2004-01-16 21:55:39 by The Worrier King
Originally posted by The Worrier King
Can I call COM functions from HLA?


Sure you can.


All I really need to do is call CoInitialize and CoUninitialize so that I can eliminate these calls from Ernie's Image.lib, that I use to load large numbers of images, inside a loop. Repeatedly starting and stopping COM can cause unpredictable results.

Image.lib is writen in MASM32, but I wrote an HHF for it, so I can call it from my HLA code.

WK

I am afraid I've never done this, so I can't give you the exact details.
But you might look at the DLL example in the HLA Examples directory (linkage with COM files is very similar to DLLs).
Cheers,
Randy Hyde
Posted on 2004-01-18 14:39:35 by rhyde
Posted on 2004-01-20 05:17:45 by Odyssey
Thanks.

I just had to add this to one of my HHF files, and all's well. :grin:

procedure	CoInitialize(pvReserved:dword); @returns( "eax" ); @external("_CoInitialize@4"); 

procedure CoUninitialize; @external("_CoUninitialize@0");
Posted on 2004-01-21 07:20:17 by The Worrier King