Re: Exporting stl class
From: David Webber (dave_at_musical.demon.co.uk)
Date: 05/03/04
- Next message: P.J. Plauger: "Re: Binary searching"
- Previous message: andrea catto': "Re: Binary searching"
- In reply to: Boris Sargos: "Re: Exporting stl class"
- Next in thread: Boris Sargos: "Re: Exporting stl class"
- Reply: Boris Sargos: "Re: Exporting stl class"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 3 May 2004 17:29:01 +0100
"Boris Sargos" <bsargos@wanadoo.fr> wrote in message
news:c73uk7$l66$1@news-reader4.wanadoo.fr...
>>>=========
Thanks for your answer.
After hours and hours searching on the web, I found some help here :
and it seems to work with valarray too. I'm not completly sure
because I still have errors with slice_array.
For the warnings, I used the following pragmas:
a.. #pragma warning (disable : 4786) //disable warnings on 255
char debug symbols
b.. #pragma warning (disable : 4231) //disable warnings on extern
before template instantiation
c.. #pragma warning (disable : 4018) // disable warnings on
incompatibiliy signed/unsigned
d.. #pragma warning (disable : 4251) // disable warnings on std
and dll
Thanks.
=====<<<<<<<<<<<<<<<<<<
For the record here (schematically) is what I have to do in the
header file:
#pragma warning( disable: 4251 ) // VC++7 - was ok in VC++6.
#pragma warning( disable: 4231 ) // MSDN article Q168958 tells me to
ignore this warning.
#include <vector>
#include "myclass.h"
//...
//******************************************************************
**********************
// Exported from DLL:
//******************************************************************
**********************
#ifdef MY_EXPORTS
#define MY_API __declspec(dllexport)
#define EXTERN_MY_API
#else
#define MY_API __declspec(dllimport)
#define EXTERN_MY_API extern
#endif
//
********************************************************************
******************
// Instantiate a vector:
// This is necessary if the class derived from vector is to be
exported.
//
********************************************************************
******************
EXTERN_MY_API template class MY_API std::vector<CMyClass>;
//******************************************************************
*********************
// class CMyArray
//******************************************************************
*********************
class MY_API CMyArray : public std::vector<CMyClass>
{
//................
};
Dave
-- David Webber Author MOZART the music processor for Windows - http://www.mozart.co.uk For discussion/support see http://www.mozart.co.uk/mzusers/mailinglist.htm
- Next message: P.J. Plauger: "Re: Binary searching"
- Previous message: andrea catto': "Re: Binary searching"
- In reply to: Boris Sargos: "Re: Exporting stl class"
- Next in thread: Boris Sargos: "Re: Exporting stl class"
- Reply: Boris Sargos: "Re: Exporting stl class"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|