William Hemsworth 1,339 Posting Virtuoso

Nice.

Although it's already been mentioned on that page, this one makes great use of the piano, despite it having something to do with Twilight apparently. [link]

William Hemsworth 1,339 Posting Virtuoso

Use windows hooks, look at my code snippets for examples. [link]

William Hemsworth 1,339 Posting Virtuoso

[link] First link on google.
The lack of effort is just disappointing.

William Hemsworth 1,339 Posting Virtuoso

Some of these are nasty :D
Fun site though.

William Hemsworth 1,339 Posting Virtuoso

Why the hell should we?

Salem commented: Hell Yeah!!!!!!!!!!!!!!! +17
William Hemsworth 1,339 Posting Virtuoso

I knew I bookmarked this somewhere, try this link.

William Hemsworth 1,339 Posting Virtuoso

What are these DEBUG and UNICODE? Can you give me an example?

If the compiler is set up to produce a debug executable (to allow the programmer to debug the program easier), then there's more information and instructions packed into the executable which would increase its size.

UNICODE is a type of character, normally a character in C++ is one byte, but if UNICODE is defined, then you would be using a two byte characters (capable of holding thousands more characters to support chinese and other types of symbols.

By resource files, do you mean to say header files?

By resource files, I mean files with the .res extensions which allow you to internally attach files such as images or videos into the executable. Nothing to do with header files.

The file size is dependant on so many things, If i statically link all the applications dependencies, then the program can turn from 10kb to 60kb.

William Hemsworth 1,339 Posting Virtuoso

And if you include 'resource files' to your application, the size will go up about the size of the files you include in it. As AD said, it's very often different because of the compiler and settings.

William Hemsworth 1,339 Posting Virtuoso

Loop through the characters until you find your first delimiter, save the index of that character, loop through the characters from the first index, and when you find the second delimiter, save the index of that too. Then pull out the characters between the two indicies.

William Hemsworth 1,339 Posting Virtuoso

cwarn23, the problem is you're limiting yourself to the digital world, there are no pixels or rectangles that make up our universe, That has about the same amount of logic as saying our universe has frames per second. This is maths not physics, numbers are continuous and don't have to be integers.

William Hemsworth 1,339 Posting Virtuoso

Why do you have a ptr variable if you're doing nothing with it? Try changing your code to:

#include <iostream>

using namespace std;
int main (void)
{
    cout << "This is a sample text." << endl;
    return 0;
}
William Hemsworth 1,339 Posting Virtuoso

Show us what you've done so far.

William Hemsworth 1,339 Posting Virtuoso

I wouldn't say that I'm ignorant but instead open minded.

I would say the exact opposite, being open minded means you accept certain facts and build on them, ignoring facts and making quick conclusions is stubborn.

tux4life commented: He must be narrow-minded then :P +0
William Hemsworth 1,339 Posting Virtuoso

Hmm.. if anybody's interested, here's the source project.

William Hemsworth 1,339 Posting Virtuoso

I'm planning on it :D

William Hemsworth 1,339 Posting Virtuoso

Another question, I have a dialog using OPENFILENAME that closes when I select a file. Is there a way to make the dialog close when I select a folder instead of a file?

Try using a folder browsing dialog instead:

#define ID3LIB_LINKOPTION 1
#pragma comment(lib, "id3lib.lib")
#include <windows.h>
#include <shlobj.h>

bool BrowseFolder(char *lpPath, const char *caption, HWND hwndOwner = NULL) {
   BROWSEINFO bi;
   ZeroMemory( &bi, sizeof(bi) );

   bi.lpszTitle = caption;
   bi.hwndOwner = hwndOwner;
   LPITEMIDLIST pidl = SHBrowseForFolder ( &bi );

   if ( pidl ) {
      SHGetPathFromIDList( pidl, lpPath );
      return true;
   }

   return false;
}
William Hemsworth 1,339 Posting Virtuoso

Not possible to use in-browser, the user has to download and execute it.

William Hemsworth 1,339 Posting Virtuoso
William Hemsworth 1,339 Posting Virtuoso

Well, you should get started, the function should start off looking something like:

bool isSymmetric(int *matrix[], int width, int height) {
   // Code here
}

The rest is up to you.

William Hemsworth 1,339 Posting Virtuoso

Instead of the WM_TRAYICON message, try WM_USER_SHELLICON.

William Hemsworth 1,339 Posting Virtuoso

Hopefully that's enough to find a common denominator :P

William Hemsworth 1,339 Posting Virtuoso

This includes the cast you've already corrected. So it's mostly just that anonymous struct you may want to look at.

Does giving the anonymous structure a name fix that?
Never thought there would be so many compiler issues, and I didn't realize that anonymous structs weren't allowed.

Thanks :)

William Hemsworth 1,339 Posting Virtuoso

Where I live, 16 is the age when you're legally allowed to drink alcohol. So when I turned 16, I went to a bar with friends and got wasted on beer and cheap vodka.

It's not legal here, but that didn't stop me :D
Usually I just watch a movie with a few friends, and go to a restaurant for dinner with my parents, but it varies.

Happy Birthday! :icon_razz:

William Hemsworth 1,339 Posting Virtuoso

Alright there mate.

I would definitely consider learning AS3. Fortunately for me I learned AS3 first so I won't have to unlearn any AS2, which is probably what you would have to do.

AS3 is considered a lot like other object orientated languages.

Plus the 3D stuff you can do outweighs all the cons...

Have you ever used stuff like papervision 3d? That's a whole heap of fun.

http://www.gotoandlearn.com/

Has a whole heap of vids for you to look at.

You can download cs4 trial for 30 days but it ain't cheap like...

Okay, cool :icon_razz:

In a way that gives me an advantage, I don't think I have to 'unlearn' much, I've been doing it for years, and probably will continue with it, but that wont stop me from trying a newer version.

Out of curiosity, have you uploaded anything you've made? And if you're interested [link] :P

I'll check out the site, seems good, thanks.

iamthwee commented: nice work +0
William Hemsworth 1,339 Posting Virtuoso

Pretty cool. Looks something someone will see if they were high of drugs.

Haha, what have you been smoking? I'd go crazy if anything turned out that intense.
Thanks alot for the feedback :icon_razz:

William Hemsworth 1,339 Posting Virtuoso

Sorry, I should have tested it with multiple compilers, replace that line with:

p->r = (unsigned char)(((cos(px + frameOffset * 10) / sin(py + frameOffset)) * cos(frameOffset * 3) * 10) * 127 + 127);

and it should work.

William Hemsworth 1,339 Posting Virtuoso

-Flash and actionscript 3.0.

I still use AS2, is it worth learning AS3 now? So far I've hardly seen something made with AS3 which can't be made with AS2, but I wouldn't mind learning a new language if it's good enough.

William Hemsworth 1,339 Posting Virtuoso

You could just use the free Microsoft Visual C++ Compiler / IDE, it comes with everything together. [link]

William Hemsworth 1,339 Posting Virtuoso

By the way, when did we introduce physics into this thread?
Even in physics, you can keep getting smaller and smaller.

It is because we are measuring so many atoms that pi appears to be so long. I have calculated that for about 1cm there would be just a little over 1,000,000,000,000,000 digits to pi.

How can I explain this, if you're calculating PI based from an atom count, how would you measure PI from a circle that's smaller than an atom? Circles have nothing to do with atoms.

William Hemsworth 1,339 Posting Virtuoso

Well I would hate to spoil the surprise but everything we see in the real world is basically digital. Made of atoms and energy. Then when measuring objects we use measurements that only measure a group of atoms the the number of atoms in that group always varies. It is because we are measuring so many atoms that pi appears to be so long. I have calculated that for about 1cm there would be just a little over 1,000,000,000,000,000 digits to pi. However if you make the circle much smaller (lets say 10 atoms wide) then that means that there hasn't yet been enough loops to get the first couple of digits.

Why stop at the atomic level? maths works with the infinitely small. What if you consider an electron to be spherical?

William Hemsworth 1,339 Posting Virtuoso

Sure, but I get the feeling you didn't search first. Try this:

#include <iostream>
#include <direct.h>
using namespace std;

int main() {
  _mkdir("C:\\My Directory");
}
William Hemsworth 1,339 Posting Virtuoso

Someone asked the exact same vague question not long ago.
Go and look for it.

William Hemsworth 1,339 Posting Virtuoso

It has to be this compiler being buggy or something.

Just because it doesn't work, doesn't mean the compiler has a bug. I changed it, and it worked. I just used the resource code from another project which had a auto-generated resource file.

There's one easy fix for all this, just don't do it manually :icon_lol:

William Hemsworth 1,339 Posting Virtuoso

Well, you better get started.

William Hemsworth 1,339 Posting Virtuoso

you've forgotten to include "resource.h"..

I'm pretty confident that's not how it works, the preprocessor just replaces #include "resource.h" with the content of the file anyway. I think it's something to do with your resource file code, it seems quite different to what's generated by the Resource Editor.

William Hemsworth 1,339 Posting Virtuoso

Or the OP just accidently pressed the big-black-bold-B button while typing a reply and the tags got inserted like here -> <- (press 'reply') to see them.

I already tested that with code tags, didn't do the same. Also, it appears to be html style tags, not BB code.

William Hemsworth 1,339 Posting Virtuoso

Might want to check that...

Ah :P Now I see her point, my bad.

William Hemsworth 1,339 Posting Virtuoso

I prefer mine :) Never quite finished it, but I think it was going pretty well.

William Hemsworth 1,339 Posting Virtuoso

I don't see your point, (2 / (2 + 1)) = 0.75, which is correct (edit, or not..).
Or, (Number of up-votes / Total number of votes)

jephthah commented: haha +0
William Hemsworth 1,339 Posting Virtuoso

If you're using windows then it's easy :)

void gotoxy(int x, int y) {
  static HANDLE hConsole = GetStdHandle( STD_OUTPUT_HANDLE );
  COORD c = {x, y};
  SetConsoleCursorPosition( hConsole, c );
}
William Hemsworth 1,339 Posting Virtuoso

When you get into problems with resources like this, just start over, it saves yourself trouble in the long run. Also, use a resource Viewer/Editor if possible, it prevents these sort of problems.

William Hemsworth 1,339 Posting Virtuoso

I'll keep an eye open, the only reason I found it was because I tried compiling it, and it came up with an error on that line, seems to be a rare one. It's also strange seeing as daniweb doesn't use those kind of tags.

William Hemsworth 1,339 Posting Virtuoso

On this thread, everything appears to be okay until you click Toggle Plain Text, I found that on line 89, this appears:

switch(LOWORD(wParam))
{
case IDD_ABOUT[B]<b></b>[/B]:
{

Instead of:

switch(LOWORD(wParam))
{
case IDD_ABOUT:
{
William Hemsworth 1,339 Posting Virtuoso

There are entire hospital management systems written in vb, and sold for big bucks.

I don't deny that, I just dislike the language :P

William Hemsworth 1,339 Posting Virtuoso

Could you elaborate on that?
I have the same feeling with VB, but I cannot tell exactly why that is.
I even did some programming in it.
I am beginning to believe that with programming languages it is the same as with food, people, cars... You either like them or you don't.

Yep, I've been forced to do VB in college, I really don't like it.
One of my favourite languages is Flash Actionscript 2.0, its syntax is very similar to C++/Java, and it's extremely flexible and easy to use.

William Hemsworth 1,339 Posting Virtuoso

That sounds really boring to me :icon_neutral:
I thought the problem would be a slightly less specific, such as to create a game of snake or tetris or make a program to achieve something within certain restrictions, where you can apply lots of creativity (obviously that would be Intermediate / Advanced), but that sounds more appealing to me.

William Hemsworth 1,339 Posting Virtuoso

All well and good, but does anybody actually have any great problem ideas to fit all these criterias? :P

William Hemsworth 1,339 Posting Virtuoso

Wow, people clearly didn't like my simple most obvious answer :P

William Hemsworth 1,339 Posting Virtuoso

I'm afraid the code is correct :)
The problem is a compiler setting, make sure the project is a "Windows Application".

And if you seriously can't figure out the compiler option (and you're using VC++), add this line of code to the very start of your program.

#pragma comment(linker, "/SUBSYSTEM:WINDOWS")
William Hemsworth 1,339 Posting Virtuoso

I could swear there was a similar thread about this somewhere, I'm up for idea though (: