these line isn't portable with Dev C++:
can you tell me how cai fix it?Code:__declspec ( property ( put = SetText, get = GetText ) ) string Text ;
Printable View
these line isn't portable with Dev C++:
can you tell me how cai fix it?Code:__declspec ( property ( put = SetText, get = GetText ) ) string Text ;
Not use property!:D As Paul already explained in another thread, this is not standard c++ (any version). If you want to use Dev c++ then you need to start using SetText(), GetText() etc in your code like the rest of us do!:eek:
Learn C++ from C++ language books and resources, and not Windows OS books, websites or tutorials.
If you did that, then there is no way you would have produced that line of code. I have been using C++ for over 20 years, and I have never seen any code like that.
Regards,
Paul McKenzie
As the MSDN link says, this is Microsoft Specific and is NOT standard c++. I try to avoid non-standard, vendor specific c++ 'features' as much as possible.Code::__declspec ( property ( put = SetText, get = GetText ) ) string Text ;
As 2kaud stated, the link says "Microsoft specific".
Again, if you had learned C++ in a more formal way, then there is absolutely no way you could have produced that line of code. If you're using Visual C++, then first and foremost, learn C++. Then apply the Windows API functions, structs and data types to your code. Even though functions, structs and data types aren't portable in the strict sense, they can be easily simulated by macros and dummy functions.
However do not try different syntax that states "Microsoft specific" -- that will always fail to be portable, and no amount of restructuring will get it to work.
Regards,
Paul McKenzie
Do you understand how compilers work? Just because the compiler sees the word "put" and "get" means nothing.
You have one line of code. The compiler must understand in total what that entire line is supposed to mean. It isn't just about seeing certain words. For example:
So if the compiler says something about "x" and "y", does it mean it knows that I have posted something valid, instead of nonsense?Code:x I am a good boy;
y I am a bad boy;
Regards,
Paul McKenzie
why i can't use some console functions in Dev C++?
the error is like they aren't declared. can you advice me?
Probably because Devc++ hasn't been updated since 2005 and so doesn't have the current Micorosft SDK! :eek:I wouldn't recommend using it. See
http://clicktobegin.net/programming/...dnt-use-dev-c/
after some time and more help, i did it heheheh
(and i share;))
my dev C++ verison is 5.4.1(2013).Code:#ifdef __cplusplusextern "C" {
#endif
//seems that here you can declare all functions you need hehehe
BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsoleOutput,BOOL bMaximumWindow,PCONSOLE_FONT_INFO lpConsoleCurrentFont);
COORD WINAPI GetConsoleFontSize(HANDLE hConsoleOutput,DWORD nFont);
HWND WINAPI GetConsoleWindow();
#ifdef __cplusplus
}
#endif
thanks for all
First remember that Dev-C++ is not the compiler. The compiler is gcc.
Second, in C++ you won't be able to use any functions if the functions are not declared. You can't compile any C++ module if you call a function that isn't previously declared, or if not declared, the entire function body exists before the call. Those are the rules of C++.
If you want proof, try to compile this simple program:
This will also not compile, since sqrt() isn't declared.Code:int main()
{
double x = sqrt(4.0);
}
Regards,
Paul McKenzie