> Then you're in luck: Delphi's WideString type is nothing more
> than the Microsoft BSTR type. Any programming language that
> can call SysAllocString and SysFreeString can use Delphi's
> WideStrings.

I knew that from the COM work I've done in the past, but for some reason
never made the connection between it and useability in other languages
through a plain old DLL. I might go back and switch everything over to
WideStrings as I'm still at the (relative) start of the project still.
At the very least it will make the code look a little cleaner. 

> That often indicates that you're trying to free something
> that wasn't allocated using the same memory manager. That
> could also happen when trying to free something that wasn't
> allocated at all, such as a string literal.

I twigged to the memory manager thing, after reading some old newsgroup
posts. Then my problem was that I hadn't allocated enough space for the
#0 character on the end. One of those traps that, again, I knew about,
but I still fell into it. Once I allocated the extra bytes it all worked
nicely. 

Thanks again for your help Rob.

Regards,
Darren
--
Darren Ferguson
Senior Software Engineer
Clinical Software Division
Medtel Australia
Adelaide, South Australia
 
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to