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

Is it even possible to change thread titles beyond marking them as solved?

Yes, mods can change them. And I will change this one in January 2013 if I'm still around. :)

[edit]Oops! No I can't because I don't monitor Geek's Lounge. Here I'm just like anyone else (almost)[/edit]

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

Only free the rows that are malloc()'ed. But if you declare/initialize tab_veld as previously posted then malloc() will not complain about giving it a NULL pointer. So if you are getting general protection error then those pointers have either not been initialized to 0 or had already been free'ed. It's always good to reinitialize pointers to 0 after freeing them to avoid that problem.

free(tab_veld[y]);
tab_vels[y] = 0;

>>Sorry for those weird variable names, i'm from belgium and those are in dutch.
No need for apology, we don't all live in English-speaking countries.

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

>>When using CreateProcess with any of the debug flags
Do you mean the debug flags that can be set in the Process Creation Flags of the CreateProcess function ? BTW: I have never used this feature

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

Yes I agree with iamthwee -- you should just scrap that whole program because it is horribly wrong. Start with the basics by reading an introduction to c book from page 1 and don't skip ahead. I could point out a few problems in your code but there are so many errors that is isn't worth it.

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

The loop that begins on line 11 of the code you posted: where in that loop do you increment g to point to the next node in the linked list? Don't you want something like this?

while(g != NULL)
{
  ... <snip>
   g = g->next;
}

Also I don't see any need to save the original parameter pointer because it is never used again in that function. You could just delete g and use t instead.

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

You have basically two choices: either MFC or ATL, per this article. Read the whole article for a more in-depth discussion.

C++ is a great language for writing performance-critical ActiveX components. With C++, you can create small, fast objects, if you take your time and are careful. MFC can get you up and running fast, but you may take a one-time download hit using its run-time library. ATL might be the answer for you if you want to create compact and fast ActiveX controls. ATL 2.0, which provides all of the updated ActiveX support, is currently in beta release and will soon be available on the Web

Note the article was writen in 1996 so that last sentence is outdated.

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

The function you posted is incorrect. Below is the correction, but the if statement may be wrong. You have to declare newBal at the top of the function so that it has scope in the entire function.

double newBal(double minimumPayment, double balanceline, double lateFee, double APR)
      {
           double newBal = 0;
      if (balanceline - minimumPayment <= 0)
            newBal = 1; // TODO:  Correct this statement!
      
      else newBal = ((balanceline - minimumPayment) * APR) + lateFee;
            
       return newBal;
system("PAUSE");
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If all you want them to hold is a single character then you don't need them to hold strings. You can simplify the table to this: char* tab_veld[80]; which is an array of 80 pointers (or 80 rows of unspecified number of columns). If you want each row to have 100 columns, then tab_veld[0] = malloc(100); Each column can hold one of the 5characters you previously specified, that is 'X', '|', 'J', '-', or the space ' '. Note that this are NOT strings, but single characters.

char*tab_veld[80 = {0};
// assuming [b]lengte[/b] is the number of columns in each row
 for(y=0;y< 80; ++y){
       tab_veld[y] = malloc(lengte); 
       memset(tab_veld[y], ' ', lengte); // set each column in this row to a space
 }
// I don't know what posvisser means so I can't tell you if the next two lines are right or wrong.  But what you want to do is just set a sincle cell to a single character.
 tab_veld[0][posvisser] = 'X';
 tab_veld[posvishaak][posvisser] = 'J';
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

start here

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

>>would any of you guys mind to go to this site and sign this?
No. What makes you think we need to interfere with mother nature ?

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

Are you new to c and c++ languages? You are asking a 1st semester student type of question. If you are then attempting to write an MFC program is way beyond your current level of knowledge. Get an introduction to computer programming book and start studying from page 1. Then in a year or so you will be ready for that MFC program.

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

what makes you think you can compare integers and strings ? Ain't going to work. If the strings contain numeric digits then convert them to integers before doing the comparison.

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

>>It 5.32 am where I am now
GO TO SLEEP! You can't learn very well when you are that tired. The world will not come to an end if you get a good night's sleep. Tomarrow is just another day in your life. Good night, I'm going to sleep too (10:36 pm at my house).

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

try reading what you posted. Your program is only doing exactly what you told it to do. Look at the last two lines and you will see for yourself why it is asking you to enter the string twice.

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

>>I could not have them done
Does that mean no one else will do your homework so now you are begging us to do it ? I don't think you will find anyone here willing to do your homework either.

Hint: I think what your assignment is asking you to do is derive more classes from those aready derived, such as derive tempSalaried from SalariedEmployee and tempHourly from HourlyEmployee. But then I could be completly wrong too.

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

it keeps repeating that because you told it to repeat it in line 17. If you don't want it repeated then move line 17 outside that loop.

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

>>strcpy(&is,im[0]);
Look at the second parameter -- it is not a char*

That line can be written without using strcpy() if(is[i]=='d') is[i] = im[0]; or even more simply if(is[i]=='d') is[i] = 'p';

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

oh i see

i didnt even get an interview to serve hamburgers, just a striaght no :( they hired a load of chinese people instead

Where is that McDonalds? I think (but do not know) that they hire people of the same general race as the people who eat there. You might look a little out of place working at a McDonalds where everyone else is chinese and you don't even know the language. It might be considered racial discrimination, but not being a lawyer I really don't know.

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

Spanking? Absolutely -- beat the living hell out of the little crumb snatchers :) But if you do that your kids will hate you for the rest of your life.

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

lol ancient, my application got rejected from mcdonalds wtf

I have no idea -- maybe you are too opinionated and don't like people telling you what to do and when to do it. But I don't work for McDonalds -- I just evaluate them and make reports back to the main office. I'm only one of hundreds of evaluators that to this around the world.

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

I guess I'm somewhat confused -- why is my Solved Threads nearly twice as Narue's even though she has been around longer than I have and has nearly as many posts as I have. ~S.~O~S is similar -- more posts than I have but half the Solved Threads. Am I over-rated or are they under-rated?

And Dima: I do occasionally mark some threads solved when I am pretty sure they OP has indicated the problem is solved. It doesn't happen very often, maybe a couple times a week at most.

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

I'm going to McDonalds in about an hour -- and get paid for doing it :)

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

By the way that rank was for 2005 the 2007 rank is here. http://www.arwu.org/rank/2007/ARWU2007_Top100.htm

Well UK faired even worse in that link -- Cambridge dropped from 2nd place to 4th place.

Maybe we ought to change the topic of this thread...i know i played a part in the alteration of the original discussion...but it has turned out to be quite interesting!...It's pretty much the repuation that the USA has..for example...and NO disresect to anyone from there....but let us say I had a PhD from a poor, worn torn african nation..and lets say you have the same degree/experience/qualification from the USA..which sounds more appealing? ...

I doubt Africa has any universities, but might be wrong. But generally it would depend on those Ph.D's. I can buy one here in USA for about $100USD or so that isn't worth the paper it's printed on.

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

I don't suppose it was actually an American that set up that rank page. It looks like some countries were not even tested on that rank.

Look at the bottom of the page -- it was NOT America that produced that ranking.

Copyright © 2005 Institute of Higher Education, Shanghai Jiao Tong University, All Rights Reserved

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

Look at this ranking of world's 500 universities Harvard (USA) is ranked #1 in the world, Univ Cambridge (UK) is #2. In the top 10, 2 are from UK and all the others are USA. France ranks a low 46, even the Netherlands is ranked (41) better than that.

Other rankings have several variations on this but all of them that I looked at showed USA universities doninated the top 100 and even the top 20.

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

all you have to include in your program is windows.h and it will include all the others that are needed.

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

i had an error in the visual studio 2005 that for no reason, the menu bar is no longer there !!!!
i cannt see the "File", "Edit", ....... menus
even the help menu is not there
so i contacted microsoft by e-mail, support, and telephone.....
the didnt reply, they just called me back, asking me to pay some hundreds of dollars so they can look into my problem !!!!
what kind of support is that, i found a bug in their product and wanted them to fix for their low reputation to at least raise it, and they are asking for money......

anyway i have some snapshots of the studio plus i recorded their call and response.

That is not a bug -- its called "dockable windows". You have the ability to add/remove the windows and menues that you want. But I too find it invonvenient at times, wish there was a way to lock them so that I can't accidentally change them.

As for M$'s support -- yes, they do not provide free support. But you can post on their forums for free. Just look on their support web page and you will find the link.

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

curt22: if you re-read that tutorial you will see where it talks about mywindow.cpp, located about 3/4th down in the tutorial.

The only thing left to do, is to implement our "MyWindow" class ...

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

why do you need such huge arays? The calc function at line 97 only uses a 30x30 array.

What compiler are you using? From the errors you posted my guess is that you are using ancient/fossile such as Turbo C. Use a modern 32-bit compiler such as free Dev-C++ or free VC++ 2005 Express and you will not get either of those errors.

There are also quite a few syntax errors in the code you posted. It appears to have been originally written with a c++ compiler. Changing to a C compiler will require some rewriting to conform to C standards. Examles: in main() move all data declarations to the top of the function and remove them from the for declarations. The newest C standard permits declaring objects in other places like c++ does but not very many compilers support that yet.

I just noticed that the code you posted also uses c++ class that you will have to rewrite with C linked list. See line 136.

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

You mean your instructor gave you only one hour's notice for taking the exam ??? I never heard of such short notice exams except possibly pop quizes, and with those you are expected to have already studied the material.

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

Great going, and good luck in the future. Hope you passed the class with flying colors :) :) :)

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

What's this new category under our reputation ?

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

>>Using the !(in.eof()) thing gives me an extra line at the end
Yup -- that's why we never use eof() like that. Here is one way to do that loop

while( in>>a )
{
   // your code here
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>strtok() I dont have learn about this funktion and i dont know how to use it
Did you think to search google for it? There are hundreds of example to follow, such as this one.

>>i realy dont have any idea ?
Get the above working first and worry about the rest after that. Do a little at a time and you will not get so overwhelmed.

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

Do the program one step at a time and soon you will have it done. Looks like you have the first two requirements written -- counting the commas and spaces. Next you will probably want to count the number of "the" words. After line 16 add another loop using strtok() to extract the words.

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

In that case the other comment I made should be the cause of all those errors.

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

>>.\Final.cpp(83) :
So why didn't you post the code that's in Final.cpp ?

line 56 of the code you posted: ItemRemove is a std::string while *IteratorList is not, so the comparison is illegal, unless you wrote an == operator, which you did not do.

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

I really don't care what you have to say. You have no business telling me what I am or am not alowed to view.

True, but your school does because its their computers, not yours. Buy your own computer and do the research at home.

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

>>i mixed with a c++ clas. right?
Yup.

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

cbSize is a member of a structure that you set to the structure size before calling win32 api functions with it. For example:

struct foo
{
    unsigned int cbSize;
    // blabla
};

struct foo MyStruct;
MyStruct.cbSize = sizeof(struct foo);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>I have a practical exam after 1 hour
You gave us just one hour to respond ? :) :) Please read the DaniWeb rules. BTW: how did you do on the exam ? My guess is that you flunked it.

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

>>3c0x1 or 3c2x1
I don't know what those are.

Lets not hijack this thread.

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

CStrings are required when interacting with MFC objects such as CEdit, CListBox, etc. Other than that, you can use whatever you like. Using std::string might bloat your program up a little though. If you are concerned about the size of the final executable program then try to avoid std::string.

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

>>and I am DEP USAF
That explains a lot about you -- Air Force Brat are you :)

>>What was your career field?
Statistical Analyst for the Comptroller (moneybags). Worked closely with Accounting & Finance as well as Budget. We used to loose millions of dollars just in rounding the money to the nearest 100 million. That's probably why I can never keep my personal checkbook balanced, and why I let my wife do it :)

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

Ok maybe I over reacted. I apologize for calling you all those names.

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

>>One thing I'm confusing. I'm using a string type variable, not a CString. Actually in an MFC application.

What's so confusing about that? Just because you have an MFC project doesn't mean you can't use the c++ STL and other classes such as io streams. I like MFC and CString for interacting with MFC object. But I find std::string can be more useful for other things. And I normally never use CFile class because it sucks cannel water. fstream is much better, unless you want to serialize MFC objects.

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

>>Are you kidding me?
No. Now everyone in the world has access to your computer.

>>I notice you have a good 6k post under your belt are they all this dumb?
No, only the really stupid ones for opening their computer up to every hacker in the universe.

>> I put a restriction on so that not just anyone can access the web page
You are a trusting soul aren't you? Do you really think that is going to stop a good hacker? I logged in using the user name and password, had no problems at all, but I made no attemps to hack your computer.

>>Just cause you are a Moderator that thinks he knows everything doesn't mean you get special treatment and get to bad mouth people
I agree -- don't think of my post as one from a moderator but just a normal poster. If I was going to use my mod skills then I would have deleted your post and given you a very bad infraction. But I won't do that in your case.

>>P.S. Read it again and let me know if you get it
Don't need to re-read it. My point is that you opened your computer up to every hacker. My comment about wanting to destroy your computer was really toung-in-cheek, an idle threat, wishful thinking.

joshSCH commented: There was no need for you to bad rep me. You were way out of line in this thread, and everyone knows it -2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>yeah, with that values. I'm still having a hard time figuring out because the ini file that I generated in windows is compose of wchar_t characters

Ohhh that is not very good. The sizeof(wchar_t) in Windows compilers is not the same as in *nix compilers. The last time I checked Windows = 2 (short int) while *nix was 4 (long). So to read the file in *nix you will probably have to read each character as a short then convert it in memory to wchar_t (a long).

I doubt you will find any *nix library that will read that windows-generated file because of the size problems I mentioned above. But what you could do is write a program to convert the entire file then use one of those library functions to parse it.

jaepi commented: Lean Mean Detailed Info Producing Machine +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The semicolon is missing on line 26.

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

>>string filePath = FullPath.GetFileTitle();
std::string does not have a method called GetFileTiele(). That is in the CStirng class :)

you can use stringstream class

#inlcude <sstring>
...
int ID;
stringstream stream(groupID);
stream >> ID;