Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

We are using COM dlls to be called

Status
Not open for further replies.

rajeessh

Programmer
Apr 11, 2002
207
0
0
IN
We are using COM dlls to be called from ASP to perform backend operations.
We pass the outoput to ASP throught [out] VARIANT *
so to pass the values we do
pVariant->BSTR = szRetVal.SysallocString()

The return value is being used by ASP to write results to clinet

How to free the allocated memory in this case.
will dllhost.exe takes care of that.
Pl advise
 
BSTR y = szRetVal.SysallocString();
pVariant->BSTR = y;
.....
//free y
SysFreeString(y);

If the code above crashes then you should not care about memory leaks in this place and remove SysFreeString.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top