|
I think the OP would be more interested in this information.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
As well as Richard's link if you do a search for ODBC you'll find (IMHO) the best interface to use databases through while programming in C or C++. While there are other methods to plug into databases ODBC has the advantage of being portable at both ends of the connection - so your C++ code can use any RDBS that has an ODBC connector AND your C++ code can be compiled on another compiler or operating system.
And instead of a concrete link I'd like to recommend a very good book - "Inside ODBC" by Kyle Geiger - instead. It's out of print but you can pick up cheap second hand copies on Amazon marketplace [1]. It's well worth a read and got me started on the rocky road to being an informed C++ DB programmer.
Cheers,
Ash
[1] At least you could 20 minutes ago when I recommended it as part of an answer to another question. I might have caused a run on them.
|
|
|
|
|
Dear All,
i'm beginner in c++ and I write template somethin like this :
template< class Type > class T1
{
bool MyMatch( int in )
{
return true;
}
public:
typedef bool (*T1<Type>::Match)( int in );
bool DoSomething( int& out, Match inConditionMethod )
{
return true;
}
};
but after compile i get this error :
error C2061: syntax error : identifier 'Match'
I google it and read MSDN but i can't find my mistake please help me to solve it.
sorry for my poor english
|
|
|
|
|
Should not be "MyMatch" ?
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Shahin_ke wrote: typedef bool (*T1<Type>::Match)( int in );
what are you trying to do here?
|
|
|
|
|
I try define something like delegate for compare two data in my template data. I need user can implement match and pass it to T1::Get(Match) and get find correct data and return it.
my original template more huge and complex and I minimize it to show the problem. I use the match typedef in Test project and it work good but when i need use it in my template i give this error.
thanks for your help
|
|
|
|
|
are you trying to add a member function to an existing class? (you can't do that in C++)
|
|
|
|
|
Check the way you've typedeffed the Match member function pointer, you've got the asterisk in the wrong place.
A pointer to a member function of A which takes a B as a parameter and returns a C is declared as:
C (A::*funct)( B );
So change your typedef to the same style and you're good to go!
Cheers,
Ash
|
|
|
|
|
how to use a linked list to store all data of clients connected to server???????????
|
|
|
|
|
I think point 2 from this[^] link is helpful for you.
|
|
|
|
|
|
Member 8771416 wrote: ...all data of clients connected to server??????????? Really?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
What data are you trying to store? What about a linked lists don't you understand? Your question is vague... need to rephrase.
|
|
|
|
|
I want to put text and image in Windows Clipboard with MFC. For example, put two lines of text and three other pictures.
Anyone can help me?
Thank you in advance!
|
|
|
|
|
You will probably need to create some form of memory structure containing your data and use a Registered Clipboard Format[^] to identify it.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Dear All,
How do I know the Mfc Lib files referring MFC dll.
Ex : knowing MFC42D.dll referencing LIB files.
|
|
|
|
|
It is common practice to give the library file the same name as the DLL file. So the libary file for MFC42D.dll will be MFC42D.lib.
|
|
|
|
|
Should be easy, you won't even get to the dll linking stage (which happens after compilation) if you don't have the necessary lib files included for the linker, so you'll get an error.
...and like Jochen already mentioned, it's customary to keep the same name.
|
|
|
|
|
except the "gethostbyname"function way,,Thanis in advance
|
|
|
|
|
You might need to ask your question again. gethostbyname function retrive the ip using host name such as "www.google.com". If i am not mistaken this ip is retrieved from DNS server. if you dont have a DNS server IP but another name you may not be able to connect with internet
|
|
|
|
|
You may use the getaddrinfo() function [^].
|
|
|
|
|
In file atldef.h
#ifndef ATLASSUME
#define ATLASSUME(expr) do { ATLASSERT(expr); __analysis_assume(!!(expr)); } while(0)
#endif // ATLASSERT
I do not know why use do{} while(0), not { }.
|
|
|
|
|
Because its not while iteration it do-while iteration.
you must need to know the structure of do-while
the structure is
do
{
...
...
}while(condition);
the basic difference between while loop and do-while is
in case of while loop first it will check for condition. if it is not true statements in the while loop wont be executed.
but in case of do-while first the statement would be executed then it will check for further execution.
|
|
|
|
|
Thank you for you reply.
I know the different between do-while and while.
I do know why this Macro why not defined as following:
#define ATLASSUME(expr) { ATLASSERT(expr); __analysis_assume(!!(expr)); }
because the loop "do-while(0)" will be execute only once.
|
|
|
|
|