Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

does your browser allow cookies on your computer? I never (hardly) have to specifically log in -- I'm auto logged in every time I visit DaniWeb and have never had a login problem.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

worked ok for me on Vista using VC++ 2005 Express. If you are using *nix maybe it does not have a pause shell command ???

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>how about you refute the multiple studies done showing that intelligence is inversely related with religion

Although that may be true -- it also might indicate those people are too smart for their own good. High intelligence doesn't mean there is no God, it just means such people are too narcissistic and incapable of understanding anything but their own self-awareness. I'd say such people are so smart that they don't recognize commen sense if it hit them in the head.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Thx but didnt find if u have then send the link

Here is just one of severl threads. Look around on the C board and you will find others

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The calculation for month is incorrect. You can't just simply divide by 31 because not all months contain 31 days. If you do not know about arrays yet then you can get the month with a series of if/else statements, something like this:

if( sunday > 334)
{
    month = 12; // December
}
else if( sunday > 304)
{
    month = 11; // November
}
<snip>
...

I normally have to make myself a chart that looks like below. The first column is the number of days in each month and the second column is the number of days from 1 Jan to the beginning of the month.

31 0	// Jan
28 31	// Feb
31 59	// Mar
30 90	// Apr
31 120	// May
30 151	// Jun
31 181	// Jul
31 212	// Aug
31 243	// Sep
31 274	// Oct
30 305	// Nov
31 335	// Dec
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Couldn't help but notice that unless there is some bug in daniweb.com this is most read thread I've seen so far.. ! 17,751 times.. :)

:cool: :sweat: you need to report that to Dani

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Do i have to install another release of OpenCV?
No, apparently the file contours.cpp already contains a main() function. You can remove the main() that you added to skeleton.cpp, or remove contours.cpp from the project.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Also, where do the 'if' and 'else' statements come into play with such a program?

The variable sun in that equation is the julian day (1=Jan1, 365=Dec 31) for Easter Sunday. Now you need to add code that will calculate the month, day, and year. The if statement comes in when determining whether the year is a leap-year or not. If its a leap year then February will have 29 days otherwise it will have 28 days.

You should create an array of 12 integers that contains the cumulative number of days from 1 January to the 1st day of the months. For example, Jan = 0, Feb = 31, Mar = 31+28 = 59, April = 59+31 = 90, etc. Then use the sun to determine which of the 12 months contains Easter. If sun = 95 then Easter is in the 3d month (counting at 0 for Jan).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is a link to basic win32 api gui programming. It doesn't teach you how to write games but it does introduce you to adding buttons and other controls/resources to windows.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I think thekashyap is right about uninitialized variables -- add a constructor to the node_type class that initializes the variables to 0.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Since you have already started the project and added the *.cpp files you may have to turn off precompiled headers for each individual *.cpp file. In File View select a *.cpp file then turn off precompiled header as previously explained. Do that for each *.cpp file you sdee in File View. If there are lots of files it might be faster and easier to just start a new empty project, turn off precompiled headers, then add the *.cpp files to it.

Another way to resolve the problem is to add #include "stdafx.h" at the top of each *.cpp file (before any other include directives)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You can turn off precompiled headers by selecting menu item Project --> Settings, select the c++ tab, in "Category" select "Precompiled Headers" then select the "Not using precompiled headers" radio button.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That error message means that when line line 12 is executed variable x has not been assigned a value yet so it just contains some random value. Programs are normally executed in the same order that you code them, so line 12 is executed immediately after line 11, and line 13 after line 12, etc.

To correct the error you received you need to move lines 18, 19 and 20 up between line 11 and 12 so that the value of x is entered at the keyboard before attemtping to execute lines 12 thru 16.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Also try reading the useful information in this thread

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

depending on the compiler there is a non-standard function in conio.h kbhit() that returns true if there is a key waiting at the keyboard buffer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you could use some os-specific api calls such as Sleep()(ms-Windows) or sleep() (*nix) in a loop to delay a bit then check for keyboard hit.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you don't start debugging in the dll itself, but start with a host program because the host program calls funciton(s) in the dll as if they were actually part of the host program. If you want to test the functions in the dll write a test host program that just calls the dll functions.

>>Also I know most of the people that write plug ins for Maya use visual basic
Is Maya written in C++ ? I assume plugins can be written in VB but I don't know that much about VB. I know VB can call c functions (but not c++ due to name mangling).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

No you don't run cmd.exe at all, read about the parameters at MSDN here -- the second-to-last parameter has an option to run the process without a window. And CreateProcess() will run without waiting for the process to finish.

>>for *nix I think you can postfix your command with &.
I don't think that works inside a c++ program, only from a shell program.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You can't do any of those things with system() function. You need to use more os-specific api calls. MS-Windows use CreateProcess(), don't know about *nix.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

moved

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Er, is really this vista-compatible?

Yes, that's the os I'm using.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

A process is a program that is running, a DLL is just a collection of functions or resources that can be used by processes. The contents of a DLL can be shared by many processes.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

. A thousand years of good fortune to you both..

OMG! I don't want to live that long :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>while (i <= len)

index values range from 0 to but not including len. So just use the less-then operator.

a for loop would be better

for(i = 0; i < len; ++i)
{


}

>>first time I tried failed
post the code.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

yes, it works now. :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Since you want the user to enter either 'Y' or 'N' it must be entered as a string, not a bool. You should redeclare choice as a std::string because data type bool only accepts a 0 or 1.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Did a search for "arrays" and selected "In Code Snippets" then pressed Search it changed the selection to "Entire Site" and produced a list of 3 pages. But it will display only the first page even when I select one of the other two pages. No matter what I do I can't get it to move to either page 2 or page 3.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

An array is a sequence of continuous characters. In my Hello example, the first character in the string is 'H', followed by 'e', 'l', ... Each character can be accessed by an index value starting with 0 and ending with the length of the string -1.

std::string word = "Hello";
word[0] = 'H'
word[1] = 'e'
word[2] = 'l'
...
word[4] = 'o'

Now all you have to do in the code you posted is create a for loop and print each character with the loop counter

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't understand what you want -- are you asking how to turn the *.cpp file into *.exe ? How to compile a program ?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The string of characters is accessed just like any other array

std::string word = "Hello";

char oneChar = word[0];

Or in the above replace the word[0] with a loop counter such as word.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

ok, lets just start with this, how can i make my program a zipped file on my desktop?

You need to download a program called WinZip -- free evaluation version from here. When you run WinZip it will create a *.zip file that contains whatever you want it to contain.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Reinstall the os -- you DO have the original CD don't you? When you start the cd it will probably ask you if you want to repair the current installation.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You are using an editor of somekind, such as Notepad to write your program. Just copy it to the clipboard then paste it into
DaniWeb's edit box, and please surround it with code tags.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>I did thatbecause it worked
no it doesn't. This is how it should have been coded

case OAPI_KEY_K: // start
       if (0 ==start) 
      {
             PlayVesselWave3(MySoundID,START,NOLOOP,255,22100);
             start=1;
      }
      else
      {
              start = 0;
      }
      return 1;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

that switch statement you posted doesn't make any sense. If start is 0 why set it to 0 again ? Can start be anything other than 0 or 1 (such as can it ever be 2) ? If not then how does it get set to 1?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>X - Expect them to obey

children are not our slaves.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Look at the prototype of that Draw() function in the header file -- it is either missing or contains a different set of parameters.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is the correction output.open(fileName.c_str());

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The 85 million-year-old creature was 35 times heavier than other known similar species, and is thought to have had a beak and sporadic patches of feathers, according to a paper to be released in UK science journal Nature on Thursday

Well so much for that article. Everyone knows the Earth is only about 10,000 or so years old :D

There may be hundreds, if not millions, of long-extinct species we know nothing about.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Hallo,
i have a programm, it works without errors

, the only problem i have is that the .exe file works for one line and then it closes from itself

Those two statements contradict each other. Apparently the first statement is false.

Post your program so we can see and test it. Do you mean you don't have a chance to see the program's output because the program closes too fast? If that's the case then put a getchar() just before the return statement in main().

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes, that works. There are a couple other ways to accomplish it

int main()
{
    Album collection[5] = {
        {"Private Investigations","Dire Straits",
            {"Sultans of Swing",2,"Romeo and Juliet ",4,
            "Money for Nothing ",9,"Walk of Life ",10}}

    };

You can also use vector instead of c-style arrays.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Don't bother. Use the 5 gig drive as a door stop and buy a 350 gig drive.

>>I want to partition my Hard disk (C:) into 2 or more pieces. Please tell me how can i do that without purchasing a Partition Manager Software.

Reformat, repartition, then reinstall the operating system(s). But don't expect Vista to run in such a limited space.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Did you ever get the compatability warning when you start any of those screens ? Most likely the games can't be run on Vista.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You still have not given any good reasons why not to have a gaming board. So what if its full of LOL and ? posts Nobody is going to force anyone to read all that stuff. As for HS objection -- the minimum age for registration at DaniWeb is only 13 (yes I still remember my 13th birthday) and I think there have been a few of them here. And I would even be in favor of abandoning the "leet speak" rule for that board.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

No. see the comments at the top of this link

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That error means the linker can not find a library. Check your computer file system to see if it exists. It has nothing to do with the code you posted.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I doubt DaniWeb was ever intended to attract only professional IT people -- afterall most of the people who post in the Software Development boards are students, not professionals. The number of professionals there could probably be counted on one or two hands and the majority of them are mods. So what's wrong with DaniWeb having the best of all worlds? Just have active moderators to filter out the bad chaff and there will probably be no other problems.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I think most of you posters should be ashamed of yourself for being so overly critical of darkfura, who apparently English is not his mothertongue. He is probably having a difficult time expressing himself in English and all you guys can do is bitch about how lazy you think he is. Good grief people have you not ever had similar feelings over the frustrations you have felt trying to get some program code to work right? Instead of kicking him in the teeth you should be tring to encourage him.

I don't like the use of the word they in an attempt to be pc either. It reads and sounds terrible. Anyone whose mother tongue is English should know better.

jbennet commented: i agree +17
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Ancient Dragon

time is a command.
usage: time <command>

Oh. I thought you were talking about the time functions in time.h

know if time has been ported to Windoze.

I don't think so.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 2 in your first code snippet: use the boolean == operator instead of the assignment = operator.

lines 4-7 -- you need to use braces "='{' and '}' in order to put lines 5-7 inside the else block on line 4.

In the second code snippet its difficult to see what is going on because it is so poorly formatted.