|
I found VC++ 6's STL support good enough for what I wanted to do. Maybe I'm an insufficiently advanced STL user? I view these things as tools. If the MFC collection classes do what you want then use them. But if there is functionality available in STL which is not in MFC we shouldn't be afraid to use it. Especially as STL is part of Standard C++.
Kevin
|
|
|
|
|
Kevin McFarlane wrote:
I found VC++ 6's STL support good enough for what I wanted to do.
same here.
i never understood all the complaints about VC6's STL.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Chris Losinger wrote:
same here.
i never understood all the complaints about VC6's STL
For single-threaded programs it was mostly fine (unless you were passing STL containers accross DLL boundaries). However, for multithreaded it was dangerously broken, unless you applied these fixes[^] (especially the one for xtree)
Yep, I discovered it the hard way
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
|
I don't want to seem judgemental but he's an idiot or a C programmer who doesn't want to learn.
Elaine
The tigress is here
|
|
|
|
|
He was quite a clever guy. But he did seem to have a fondness, not so much for MFC, but for "C-style" C++. Lots of low-level methods, void*s and unnecessary dynamic allocations. But as his code generally seemed to work I guess his attitude is: if it ain't broke, don't fix it. Problem is it's not very friendly to the coder who has to understand his code.
Kevin
|
|
|
|
|
Hello,
does anybody of you know about how to connect to Cisco Call Manager 4.1(2) ? I'd like to monitor incomming calls... I don't want to use CiscoTSP, so the only? way to do this is SCCP, which communicates through h323 protocol. Are there any libraries which could I use ? (I found openh323 library, but no examples on how to use it). My biggest problem is the connection to call manager (Using TAPI 2.x and h323.tsp I was not able to change the IP addres where it should look for call manager) ...
|
|
|
|
|
I use CAsyncSocket class in my client application, if the server use proxy,
how can the client connect to server (passing the proxy)?
thanks in advance
Ika
|
|
|
|
|
1. Speak CERN proxy syntax to the proxy server at PROXYIP:PROXYPORT
e.g "CONNECT MYSERVERIP:MYSERVERPORT HTTP/1.1"
2. Use WinInet API instead
e.g Use InternetOpen() with Flags INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY
or
INTERNET_OPEN_TYPE_PROXY
|
|
|
|
|
Hi,
I have to store 10 strcture in vector.
struct
{
int
int
int
int
};
Can you please help me. I am new to stl programming.
Thanks
|
|
|
|
|
Do something like that:
Suppose the structure is called YourStruct.
The vector is declared like that:
std::vector<YourStruct> YourVector;
To add elements in the vector:
for (int i=0;i<10;i++)
{
YourStruct TestStruct;
YourVector.push_back(TestStruct);
}
|
|
|
|
|
Is it possible to create IP address box without using MFC?
i mean a plain Win 32 application
|
|
|
|
|
ask_you wrote:
Is it possible to create IP address box without using MFC?
Yeap
ask_you wrote:
i mean a plain Win 32 application
here is the class SysIPAddress32 you have to pass in CreateWindow to dynamically create IpAddressCtrl
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thanx
i tried to implement the IP address using the following code
hWnd = CreateWindowEx(NULL,ClsName,WndName,WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 300, 200, NULL, NULL, GetModuleHandle(NULL), NULL);
HWND IPAddrWindow = CreateWindow("SysIPAddress32",NULL, WS_VISIBLE|WS_CHILD,35,55,250,30,hWnd,NULL,NULL,NULL);
But its not created... only the blank base window is displayed. where am i wrong?
|
|
|
|
|
Can i ask you 1 more question , (if u dont mind)
How can i ask the user to insert a string , and to be saved in Title
i believe if it was a char[30] i can use
char Title[30];
cin.getline(Title,30);
But what is the case if it String??
My regards,
Bahy
|
|
|
|
|
What about this:
char Title[31];
cin.getline(Title,30);
std::string String1 = Title;
Remark: don't forget that if you want to store 30 characters in a char string, you will need to store one extra character that is the null-termination char. Thus you have to declare your array like that: char Title[31];
|
|
|
|
|
it did not solve the problem
ok..i wana make it a string , with unfixed length so its gona be like:
string Title;
but how can i ask the user to cin??
is it cin>>Title;
umm it wont work , because the string got spaces , so what will be the command ??
|
|
|
|
|
ana_bahy wrote:
Can i ask you 1 more question , (if u dont mind)
You do not need anyone's permission to post questions here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Ok I`ve got this weird problem here....
In a certain func I wrote I need to split a double into 2 integers, the fractional part up to x digits and the decimal part.
See here for the splitting part:
void AFunction( double dNumber, int acc )<br />
{<br />
int nDecim = (int)dNumber;
<br />
int nFract = (int) ( (double)(dNumber-nDecim) * pow(10,acc) );
<br />
....
}
the bizarre thing is that the calculation of nFract works in most of the cases, except in some cases where there is only 1 decimal (e.g. when acc=3, 2.222(nFract=221) and 1.111(nFract=110) fail, but 3.333 doesn`t nor does 22.222 or 11.111...?? )
So I figured, maybe the compiler got confused or so . I split the calculation of nFract in 4 lines and debugged...
(results I mention are with params dNumber=2.222, and acc =3
<br />
int nDecim = (int)dNumber;
double dTemp = dNumber - nDecim;
int nFactor = pow(10,acc);
int nFract = dTemp * nFactor
double dInterMd = dTemp * nFactor;
nFract = (int)dInterMd;
once again 22.222 with acc 3 works fine 1.111 has similar problem 3.333 works fine...
I`m at a loss here... What the hell is going wrong?????
|
|
|
|
|
GDavy wrote:
In a certain func I wrote I need to split a double into 2 integers, the fractional part up to x digits and the decimal part.
What about this Code Mr Davy,
CString MainStr,;
int Num1,Num2;
MainStr.Format("%e",100.200);
Num1=atoi(MainStr.Left(MainStr.Find('.')));
Num2=atoi(MainStr.Right(MainStr.GetLength()-MainStr.ReverseFind('.')-1));
I havn't tested this code, but i believe it will work
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
thx for the reply..
I`m trying to avoid conversion to string and getting the data out of there, to avoid excess memory and process time..
I know in modern days noone cares about mem or process time anymore, but the devices I write for have limits.
(and keeping Cosmos 1 in that undetectable orbit requires process speed )
|
|
|
|
|
Did you try converting the double value to string and manipulate from there, like finding the '.' character and extracting the string before and after it?
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
thx for the reply..
I`m trying to avoid conversion to string and getting the data out of there, to avoid excess memory and process time..
I know in modern days noone cares about mem or process time anymore, but the devices I write for have limits.
(and keeping Cosmos 1 in that undetectable orbit requires process speed )
|
|
|
|
|
GDavy wrote:
What the hell is going wrong?????
From the MSDN, about conversion:
From double To long , Method: Truncate at decimal point. If result is too large to be represented as long, result is undefined.
~RaGE();
|
|
|
|
|
Thx for the reply..
the numbers I pass as parameters are small enough to be contained in an integer (see the values I passed in original post where problem occurs)
The problem lies in rounding I found out... somehow it keeps some rounding bit around when converting the double to int. So going from there I will fix the problem I think (hope)
|
|
|
|