STL String (VC++ 6.0) native code issue

  • Thread starter Thread starter Sai Kit Tong
  • Start date Start date
S

Sai Kit Tong

I have a native (legacy) library created with Visual Studio 6.0. It utilizes
STL for its string operation. In addition, most of public members of the
classes in this library return or use STL string as parameters. The
implementation for STL seems to change so I fail to using the IJW approach.
Is there a workaround?
 
Sai said:
I have a native (legacy) library created with Visual Studio 6.0. It utilizes
STL for its string operation. In addition, most of public members of the
classes in this library return or use STL string as parameters. The
implementation for STL seems to change so I fail to using the IJW approach.
Is there a workaround?

Not that I know of. The VC6 and VC.NET implementations of std::string are
not binary compatible. This is a versioning issue, not an IJW shortcoming.
 
Sai said:
I have a native (legacy) library created with Visual Studio 6.0. It
utilizes STL for its string operation. In addition, most of public
members of the classes in this library return or use STL string as
parameters. The implementation for STL seems to change so I fail to
using the IJW approach. Is there a workaround?

As Doug mentioned, this is a versioning/binary compatibility issue, not an
IJW issue.

One workaround I can think of:

In VC6, implement a library which wraps your legacy library in a plain 'C'
API. Compile this wrapper and your legacy library into a DLL using VC6.

In VC7{.1}, implement a library which wraps the C API in a new C++ wrapper
that exposes VC7{.1} STL classes. Compile this library with VC7 and link it
with your program.

Ugly, but it could be workable, depending on how wide the API to your legacy
library is.

-cd
 
Back
Top