|
thanks
|
|
|
|
|
Hello I have a small question that maybe you could help solve. I am using a CHtmlview in my application and I want to display a FTP directory on another computer so I just called the Navigate2(ftp://myftp); and this all works great, the only problem is that when the user clicks on a folder it open a new window and no event is thrown, meaning I tried catching this but could not. Have any ideas?
Thanks,
gil
|
|
|
|
|
This[^] is driving me insane
I just want a wofstream to stream out Unicode i.e. the following code to work the way you would expect:
wofstream outputFile( "test.txt" ) ;
outputFile << L"fsck!" << endl ;
instead of converting everything to be narrow first!
I'm thinking maybe I can imbue the wofstream with a locale/facet that doesn't do the narrowing of the data but I'm not having much luck.
Surely someone has hit this problem before. Any ideas...?
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Taka Muraoka wrote:
I just want a wofstream to stream out Unicode
Since the standard knows nothing about Unicode, the standard is not going to help you.
My suggestion would be to try to create a 16-bit-handling streambuf and instantiate an ostream on that one. I'm absolutely NOT sure this will help you, but at least one suggestion is better than banging ones head against the wall.
|
|
|
|
|
Banging my head on the wall? If only I had been doing just that
It's not really a question of being Unicode-aware. If a basic_ofstream is templated using 16-bit characters, then it should write out 16-bit characters, fer crying out loud!!!
Anyway, I've just about got something going[^] although it's taken me *ages* to get it working under Stlport.
Boost has a submission[^] open that looks much more elegant but doesn't compile under VC6
This is one *major* can of worms
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Hi, i'm currently learning programming with visual c++. I am using the active X ADO data control in my dialog to link up with my access db. I need help with the commands used to access the features of the the adodc. For example, how can i access the recordsets from the database without the use of active x(textboxes) controls that links to the datasource. If i were to use eof to determine if the pointer is at the last record, how should i go about writing the code?
|
|
|
|
|
Not to insult you or anything but this question cannot be answered with just a few lines of text. Database programming is involving and you should read some texts and check out some examples first. MSDN has some good and simple examples. Check out this link [^] and if you're not satisfied with it, search for ADO tutorials in MSDN.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
|
Thanks, i'll try to look through the links.
|
|
|
|
|
i have a rowset to be update,insert,delete, and i want to known all modify infomation about the rowset,Is ole db or odbc support this?
or any idea else?
thank you!
i am realfly8)
|
|
|
|
|
|
I'm learning about vector STL containers, is this also considered an array?
|
|
|
|
|
No. But it can do many of the same types of things that an array can, and a bit more. Vectors are dynamic arrays, in that they can grow as you add elements to them. They are similar to arrays in that they provide the subscript operator[] (you can use standard array notation).
Use a vector if your code might throw exceptions.
Use a vector if most of your inserts will be at the back, and few near the front (otherwise consider deque or list).
Use a vector to support better initialisation.
Always prefer standard containers, list, vector, deque to arrays. less code, cleaner code, better support for copying - and in the end easier to work with.
[edit]Most vectors are internally implemented as arrays, but that shouldn't matter to the end user.[/edit]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Andrew Walker wrote:
[edit]Most vectors are internally implemented as arrays, but that shouldn't matter to the end user.[/edit]
IIRC a vector must be implemented as an array, because &(vector[0]) is a legal expression to get a C pointer to the array. (ref. herb sutters Effective STL)
(Strings, OTOH, need not)
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
peterchen wrote:
IIRC a vector must be implemented as an array, because &(vector[0]) is a legal expression to get a C pointer to the array.
Yeah, I believe that is correct
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
That was left out of the original standard but has been (or will be) added. William would know for sure.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
yes, it want to be a safe one
i am realfly8)
|
|
|
|
|
Good explanation Andrew,
Thanks everybody.
|
|
|
|
|
please link to :http://www.my1489.ni8.net
please tell me what controls is this ,where could download it?i am very confused!help me
chinese girl
|
|
|
|
|
http://www.codeproject.com/miscctrl/TimeTestMfc.asp?target=mourad
i am realfly8)
|
|
|
|
|
thank you 1谢谢!where are you ?你在那个国家?
|
|
|
|
|
|
Ok here is the goal of the program:
Create a C++ Program that acts as a calculator for the user. The program should start off by printing, to the screen, a menu that offers the user one of five options. The menu should look somethings like this, but feel free to dress it up any way you want to make it look nice.
1.Add
2.Subtract
3.Multiply
4.Divide
5.Exit
The user wil then select one of the options. Then the program must prompt the user forthe input data and print the results to the screen. After the user has found the desired results, the menu should then reappear to allow the user to do another calculation. Do not let the user out of the program until the user has typed 5 for exit.
Rules: The program must use at least 5 functions, not including MAIN.One funtion will be for the menu and one function for each of the calculations.
Input for the program will be data that is in the integer range, and you can make the assumption that I will NOT type 0 to force a divide by 0 error ( Nice instructor eh?? . However, if the user types in a menu item number that does not appear, then the program should return the user an error message that they have typed an incorrect number and allow the user to retype a valid number.
Ok with all that said below is the source code that I have written in MS Visual C++. I am thinking I am running into problems with my functions, although I am not to sure. And thanks in advance for anyone who takes the time to offer some help.
#include <iostream>
#include <conio.h>
using namespace std;
int sum = 0;
int ssum = 0;
int msum = 0;
double dsum = 0;
int x = 0;
int y = 0;
int menu();
int c = menu();
int main()
{
do
{
int menu();
if(c == 1)
int add();
else if(c == 2)
int sub();
else if(c == 3)
int multi();
else if(c == 4)
double div();
}
getch();
return 0;
}
int menu()
{
int sel = 0;
cout<<"Please select a menu choice..."<<endl
<<"1. Add"<<endl
<<"2. Subtract"<<endl
<<"3. Multiply"<<endl
<<"4. Divide"<<endl
<<"5. Exit program"<<endl;
cin>>sel;
if(c = 5)
cout<<"Thank you for using the calculator!"<<endl;
else if(c > 5 && c < 1)
cout<<"You have entered an invalid selection!"<<endl;
return sel;
}
int add()
{
cout<<"Please enter a number..."<<endl;
cin>> x;
cout<<"Please enter your second number..."<<endl;
cin>>y;
sum = x + y;
cout<<"The answer is "<<sum<<endl;
return sum;
}
int sub()
{
cout<<"Please enter a number..."<<endl;
cin>> x;
cout<<"Please enter your second number..."<<endl;
cin>>y;
ssum = x - y;
cout<<"The answer is "<<ssum<<endl;
return ssum;
}
int multi()
{
cout<<"Please enter a number..."<<endl;
cin>> x;
cout<<"Please enter your second number..."<<endl;
cin>>y;
msum = x * y;
cout<<"The answer is "<<msum<<endl;
return msum;
}
double div()
{
cout<<"Please enter a number..."<<endl;
cin>> x;
cout<<"Please enter your second number..."<<endl;
cin>>y;
dsum = x / y;
cout<<"The answer is "<<dsum<<endl;
return dsum;
}
*Edit* Hopefully this helps now
|
|
|
|
|
Hi Fightingbee, welcome to CP. It's hard to read your code, please edit the post and either wrap your code in a <pre> block, or check the "Display this message as-is (no HTML)" box so spacing is preserved.
From a quick glance, your function calls are wrong.
int add();
is only a prototype, telling the compiler that a function add() exists and returns an int . When you want to call the function, you write
add();
--Mike--
"I'm working really, really fast at the moment, so a 3 minute outage becomes, due to time dilation, a 5 minute outage."
-- Chris Maunder, relativistic system administrator
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Well I tried pulling the int out of the int add(); and likewise functions ( when they are called and when I am defining them and the compiler threw up about 7 errors at me. So I am not sure exactly what it is I am to do.
|
|
|
|