String in VS C++ Express


Hi guyz.... i have a problem with C++.

I was trying to pass the values of type 'string' into the constructor the following way:

static__declspec(dllexport)void MyAttributeDll(string ProcessName,string Command,string RawData,string Instance,string Instance_Key,string ErrorMessage,int iOccurrence);

the compiler gives me a following error on that line:

error C2061: syntax error : identifier 'string'

if anyone can give a hand with it ...it would be greatly appreciated.

Thanks in advance

Dimmi

[960 byte] By [Mapa3matuk] at [2007-12-21]
# 1

If it is a string from stl than it resides in the namespace std. Either aus std::string or place a using namespace std; at the top.

BTW: It is not wise to export a DLL interface that uses STL objects...

MartinRichter at 2007-9-10 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 2

Thanks for the replu Martin,

If you say it is not wise, then i would like to know your suggestion if you can please.

What i want to do it to have c++ 2005 creating dll's and then a sepparate project that's gonna be calling appropriate dll dependidng on the parameterd passed in.

what would be the best way to solve the problem,

im fairly new to this so indepth help would be really appreciated.

Many thanks in advance...

Dmitry

Mapa3matuk at 2007-9-10 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 3
Pass neutral parameters like string pointer to buffers. If you use string classes that are based on templates you force each caller to be 100% code compatoble. If you use simple buffers and pointers your interface is indemendent.
MartinRichter at 2007-9-10 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...