Does Microsoft still have C++ container limitations when passing to DLLs? [duplicate]

Microsoft has had a fair amount of trouble in the past when passing STL containers like string and vector pointers and references to DLLs. See, for example, You may experience an access violation when you access an STL object through a pointer or reference in a different DLL or EXE.

Question: Are those types of problems still present today in Visual Studio 2010 and 2013?

I know the question is a bit open-ended. I am asking because I’ve experienced them in the past, I’m working on a new design, the design could include a plugin architecture, and I would like to to pass a string or vector reference to a plugin DLL. If the problems still plague Microsoft, then I have to change the design (or come up with a workaround to avoid the crash).


Related, Did C++11 address concerns passing std lib objects between dynamic/shared library boundaries? is similar (thanks for the link). But it does not really answer the question, though it does seem to acknowledge the same problem.

Also, Microsoft’s KB Q168958, How to export an instantiation of a Standard Template Library (STL) class and a class that contains a data member that is an STL object, implies it can be done. But that’s around the time I recall having the problems, so I am curious if it still applies (and if it actually works now in Visual Studio 2010 or 2013).

The problem I am running into was highlighted by Robert and Doc: I can test for the presence of bugs, but not the absence of them. So I might not be able to trigger problems during testing, but the problems may really exists (and surface at the worse time).

13

Export a C interface.

Not only does that solve the DLL problem, but it allows for plugins in languages other than C++.

Then write a C++ wrapper for the C API as a header only library.

You can’t use C++ non-standard-layout objects in the API because there is no standard ABI for them, so you would be requiring the library and users to all be compiled with the same compiler and libraries. This is particularly bad for plugins — it is less of an issue for libraries as the library user can statically link the library with the executable, or at least bundle the two in a single installer.

Note that a non-POD object can still be standard layout, starting with C++11.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

Does Microsoft still have C++ container limitations when passing to DLLs? [duplicate]

Microsoft has had a fair amount of trouble in the past when passing STL containers like string and vector pointers and references to DLLs. See, for example, You may experience an access violation when you access an STL object through a pointer or reference in a different DLL or EXE.

Question: Are those types of problems still present today in Visual Studio 2010 and 2013?

I know the question is a bit open-ended. I am asking because I’ve experienced them in the past, I’m working on a new design, the design could include a plugin architecture, and I would like to to pass a string or vector reference to a plugin DLL. If the problems still plague Microsoft, then I have to change the design (or come up with a workaround to avoid the crash).


Related, Did C++11 address concerns passing std lib objects between dynamic/shared library boundaries? is similar (thanks for the link). But it does not really answer the question, though it does seem to acknowledge the same problem.

Also, Microsoft’s KB Q168958, How to export an instantiation of a Standard Template Library (STL) class and a class that contains a data member that is an STL object, implies it can be done. But that’s around the time I recall having the problems, so I am curious if it still applies (and if it actually works now in Visual Studio 2010 or 2013).

The problem I am running into was highlighted by Robert and Doc: I can test for the presence of bugs, but not the absence of them. So I might not be able to trigger problems during testing, but the problems may really exists (and surface at the worse time).

13

Export a C interface.

Not only does that solve the DLL problem, but it allows for plugins in languages other than C++.

Then write a C++ wrapper for the C API as a header only library.

You can’t use C++ non-standard-layout objects in the API because there is no standard ABI for them, so you would be requiring the library and users to all be compiled with the same compiler and libraries. This is particularly bad for plugins — it is less of an issue for libraries as the library user can statically link the library with the executable, or at least bundle the two in a single installer.

Note that a non-POD object can still be standard layout, starting with C++11.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật