William Hemsworth 1,339 Posting Virtuoso

I don't know, maybe you parents actually care about you :)

William Hemsworth 1,339 Posting Virtuoso

Hello from Vista :) I will probably be getting it soon, not quite sure I look the new task bar so much though, looks big and blocky in my opinion, definitely worth a try though.

William Hemsworth 1,339 Posting Virtuoso

Perhaps the PlaySound function?

PlaySound("H:\\sissys.mp3", NULL, SND_FILENAME);
William Hemsworth 1,339 Posting Virtuoso

I dont?

I remember him by this thread, when he had a long debate with Narue.
Obviously that's 4 years before I joined, but it's like the most popular C++ thread there :P

William Hemsworth 1,339 Posting Virtuoso

What are the errors?

William Hemsworth 1,339 Posting Virtuoso

Depends on so many things, it could take a month if you did it intensively, or a year or two if you do it as a hobby every once in a while.

William Hemsworth 1,339 Posting Virtuoso

I AM SURE THE CODE DOESN't matter here....
if you want here it is

#include<iostream.h>

void main()
{
cout<<"Hello";
}

With getch();

I know.. that's what I said. By the way, don't use void main, use int main, and use code-tags when posting.

William Hemsworth 1,339 Posting Virtuoso

My best advice for you right now is to learn how to program before you try anything big. Read books, tutorials, whatever.
If you plan on doing this in Windows, you should try this tutorial [link], but be sure you understand everything you read.

William Hemsworth 1,339 Posting Virtuoso

I don't know what's causing it to go out of bounds like that, but I really doubt it's something to do with your code.

William Hemsworth 1,339 Posting Virtuoso

Just hope my progressbar will still work

As long as you have a valid handle to the progress bar, it will work, good luck :icon_cool:

William Hemsworth 1,339 Posting Virtuoso

That's what happens when people revive old threads, other people post in it assuming it's a recent thread since it's been bumped to the top.

William Hemsworth 1,339 Posting Virtuoso

Use multiple threads?

William Hemsworth 1,339 Posting Virtuoso

I'd go with option B, but that's me. Rashakil Fol's right, do what you enjoy, learning a new language when you already know one is usually easy. I've been doing C++ for a few years and just now I have to start learning Visual Basic, the only change big change is the syntax, which takes some getting used to.

William Hemsworth 1,339 Posting Virtuoso

put something, such as getchar(), at the end of main() to prevent the window from closing.

Maybe re-read the question :) I think he said he has already done that part.

William Hemsworth 1,339 Posting Virtuoso

Show some code.

William Hemsworth 1,339 Posting Virtuoso

I do.

William Hemsworth 1,339 Posting Virtuoso

Thank you William Hemsworth,

you code sniplet is very helpful, although when shown in notepad is simply shows

"%d %d %d %d %d %d %d(%.1foC) %d %d(%s) %d(%.2f) %d(%s) %d\n" instead fo formatting the output to this.

do you know a way in which I could overcome this?

Thank you for your help!

That's the format of the string, if you want to use that, research sprintf.

William Hemsworth 1,339 Posting Virtuoso

Open a file stream, here's a small example:

#include <iostream>
#include <fstream>

int main() {
  std::ofstream out("myfile.txt", std::ios::out);
  out << "File content here";
  out.close();
  system("notepad.exe myfile.txt");
}
William Hemsworth 1,339 Posting Virtuoso

You can save them to a file, and open the file with notepad.

William Hemsworth 1,339 Posting Virtuoso

Haha :D I like how he tried so hard to get up.

William Hemsworth 1,339 Posting Virtuoso

If these up/down votes are of such little significance, why bother with them at all? Better yet, why tie them to ppl's profiles in the form of an active report?

They have significance, but people shouldn't whine over them. I like knowing what people think of my posts, so I don't complain if I get a down-vote, which is what he was doing.

Nick Evan commented: Yes +0
William Hemsworth 1,339 Posting Virtuoso

If it's the default tab-control, then your event handler should look somewhat like this:

case WM_NOTIFY:
      {
        HWND tabs = GetDlgItem(hDlg, IDC_TABS);
        switch ( ((LPNMHDR)lParam)->code ) {
          case TCN_SELCHANGE:
            {
              selectedTab = TabCtrl_GetCurSel( tabs );
              // Code here
            }
            break;
        }
      }
      break;

But looking through your resource code, I don't see any sign of a SysTabControl32 box, what are you using for your tabs?

William Hemsworth 1,339 Posting Virtuoso

How can I say, if the tab button is pushed, use SetFocus() ?

Show me your code.

Have you already programmed the functionality of the tabs? and do you have a HWND of the text box? If not, these are small details I can still help with.

William Hemsworth 1,339 Posting Virtuoso

If you use SetFocus on the handle to the text box, it should move the text cursor to there.
Just tried it, it worked.

William Hemsworth 1,339 Posting Virtuoso

Have you tried SetFocus?

William Hemsworth 1,339 Posting Virtuoso

Same here.. I spend most of the night on here :)

But then I work graveyard shift in a very quiet callcenter so I have plenty of time to be bored :)

I also have done some photography, although not recently.. some of it is still up at http://stuff.elvenblade.com/camera if anyone is interested.

Make a few friends in china so you have people to talk to :) Also, you have some pretty neat photos there, with a little bit of touching, they could be even nicer. Like this into this.

William Hemsworth 1,339 Posting Virtuoso

Well, anything's better than nothing I guess. Remember, use code-tags in your posts or I wont bother responding.
This is what you have so far:

#include <iostream>
using namespace std;

int main()
{
  int x, y;
  cout << "enter a number:";
  cin >> x;
}

Now you should create a frame for your program, remember, one thing at a time. You need a function to convert an integer to words, and for that you first need a function to read individual digits, be happy I wrote that for you.

#include <iostream>
using namespace std;

// Works right to left
int getDigit(int value, int digitIndex) {
  while ( digitIndex-- ) {
    value /= 10;
  }

  return value % 10;
}

void toWords(int number, char *buffer) {
  [B]// Your turn[/B]
}

int main()
{
  int x, y;
  char text[100];

  cout << "Enter a number: ";
  cin >> x;

  toWords( x, text );
  cout << "Text: " << text;
}

This is one of many ways to do this, may not be the best. Now I want to see some effort from you.

William Hemsworth 1,339 Posting Virtuoso

Tried searching the internet? [link]
This is a very commonly asked question, show us your code so far and we'll help you if you get stuck.

William Hemsworth 1,339 Posting Virtuoso

Could someone explain to me why I received a down vote for my reply to this thread. Seems a little undeserving.
Or better yet, why doesn't the person who down voted my reply man-up and say why.

Am I missing something here.
Sure seems like a sure-fire way to discourage people from posting and possibly not even returning to DaniWeb.

Calm down, they don't mean much, plus they're subject to opinion, not whether the post is actually of good quality or not.

William Hemsworth 1,339 Posting Virtuoso

I have to remove my hands from the keyboard, find the mouse, move it to the button, click it, move the cursor between the two tags, move my right hand back to the keyboard, and begin typing again. All that's just too much effort.

Simply put, "I have to click the button" :icon_wink:

To use the keyboard, it takes 15 actions, one for each letter you type, you only listed 7 for using the button :) Also, I usually select the code first then click the button, seems easier.

The only tags I type are the [b][/b] and [I][/I] tags, because they're short.

edit: You're welcome niek ;]

William Hemsworth 1,339 Posting Virtuoso

People who want less disk space will pay less for a smaller hard drive. What are you worried about? that the world will have too much free fisk space? :icon_eek:

majestic0110 commented: lol good post +0
William Hemsworth 1,339 Posting Virtuoso

Really? After implementing the buttons I asked if people noticed a difference and everyone said they did :(

I notice a difference, now some people actually use it on their first post, before almost no-one did, so don't worry, your efforts there haven't gone to waste :icon_cool:

I think it also looks generally nicer than the '#' icon you had before too.

William Hemsworth 1,339 Posting Virtuoso

If you place a static variable inside a function lets say, it is declared once, and is only destructed once the program is closed. For example, try compiling this:

#include <iostream>
using namespace std;

// Returns the static variable 'total'
int addNum(int num) {
  static int total = 0;
  total += num;
  return total;
}

int main() {
  cout << addNum( 2 ) << '\n'; // outputs 2
  cout << addNum( 3 ) << '\n'; // outputs 5
  cout << addNum( 6 );         // outputs 11
  cin.ignore();
}

The example should be clear enough.

William Hemsworth 1,339 Posting Virtuoso

That is an expensive camera

Sure is, combining my own money and christmas to be able to afford it. After that, the next step is to save up for [link].
What an expensive hobby :idea:

William Hemsworth 1,339 Posting Virtuoso

William, great pictures. I especially like the Lighting up the Path pic. They look very professional. Keep up the good work.
Also, good luck with piano. Learning an instrument takes lots of patience and practice.

Why thanks :) I'll be getting this camera soon [link], I can't wait. Those pictures were taken with my awful Samsung S570, it will be nice to use a real camera for once.

William Hemsworth 1,339 Posting Virtuoso

If i am that bored i go and garden. Or practice piano

Sounds good :) I'll be starting piano lessons soon, expensive though. When I'm bored, I'll try something new, for example i've started getting into photography now, here are some I've taken fairly recently.

Why do people limit themselves to the PC only sometimes? :icon_lol:

William Hemsworth 1,339 Posting Virtuoso

Heh, I did the same thing, the first time it was williamhemswort, a typo in my username! Then got it split to
william hemsworth, then decided I wanted it capitalized to William Hemsworth :icon_lol:

Thanks again for your patience happygeek :)

William Hemsworth 1,339 Posting Virtuoso

Double post, and no code tags.

William Hemsworth 1,339 Posting Virtuoso

That's not correct, that just turns into:

#include <stdio.h>

int main() {
    printf("%s","string");
    return (0);
}

Once the preprocessor's done.

William Hemsworth 1,339 Posting Virtuoso

It isnt working. Plz do help me. It am going mad thinking about it. Plz do something

How isn't it working? we aren't psychic, you have to tell us what's going on at your end.
What errors do you get, and show me the code you tried compiling.

William Hemsworth 1,339 Posting Virtuoso

Plz reply fast i am witing brother

Two things, firstly this may be urgent to you, but it's not for us. Secondly, I've already answered your question! Have you tried doing what I said?

William Hemsworth 1,339 Posting Virtuoso

Same applies for movie and description, they need to be character arrays.

William Hemsworth 1,339 Posting Virtuoso

I should have seen that coming a mile away, use code-tags from now on, or i wont bother replying.
I'm pretty sure your name has more that one letter, doesn't it?

[B]char name[100][/B];
char description;
char movie;
int regular = 40;
int children = 30;
int english = 50;
int newer = 100;
int days;
int total;
William Hemsworth 1,339 Posting Virtuoso

Okie Doke.

William Hemsworth 1,339 Posting Virtuoso

Now plz tell me how can i solve this problem. Thanks

Start by showing us some effort, what have you done so far?
We help step by step with specific problems, don't expect anybody to give you large chunks of code that just work.

William Hemsworth 1,339 Posting Virtuoso

You have no excuse for not using code-tags, you managed on your first post.

William Hemsworth 1,339 Posting Virtuoso

Ahh, that's C+ code, didn't realize which forum this was. Try this:

#include <stdio.h>

int main() {
  printf("Hello"),
  getchar();
  return 0;
}
William Hemsworth 1,339 Posting Virtuoso

Here the statement finishes with a comma, not a semicolon:

#include <iostream>

int main() {
  printf("Hello"),
  getchar();
  return 0;
}
William Hemsworth 1,339 Posting Virtuoso

Couldn't be much more vague. If you want to find out whether or not a key is down, read about GetAsyncKeyState.

William Hemsworth 1,339 Posting Virtuoso

Well i didnt know if it would work @ first,i put all the words i saw IN MY ADDRESS BAR then copy/pasted them into the field on the page :D (Of course you can only do that once (Before the timer starts))

That sounds very slow and much harder! I could always make a character interpreter and keyboard simulator to cheat for me, but where's the fun in that :icon_lol: I'm aiming for 100wps.