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

It would be helpful to tell us the functions that are giving you problems. I'm not going to read all that code to try and guess what you want.

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

I almost never read any of those blogs because they rarely have anything that is interesting to ME to read. But after reading this thread just now I went to have another look -- and sure enough there were a few non-technical blog entries, such as the one written by Happygeek and our President-Elect Obama. I will pay more attention to the DaniWeb blogs if they become less geeky.

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

You also need to get out of that chair and walk around often to keep your ass from filling out that chain! As the months go by your ass will get broader and broader.

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

Nobody cares.

Maybe that's part of the problem -- nobody cares enough to fix it. Lets hope the new Obama adminstration will be able to solve this financial crises. If not, then all you young people are in for an awful rude awaking at the bread lines with no job and no money. Don't bother to travel to California to get free oranges to eat like people did in the Great Depression because they tore all the orange groves out and built houses on the land.

Alex Edwards commented: You tell 'em! =) +5
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I suppose there are as many ways to design your program as there are people to program it. But if I were going to do it I would not put the menu in the Bank class at all but put it in the main() function.

int DisplayMenu();
const int DONE = 5 // menu item 5
int main()
{
    Bank bank;
    int option;
    while( (option = DisplayMenu()) != DONE )
    {
          switch(option)
          {
               case 1:
                   // do something here
                   break;
               <etc, etc for the other menu items
          }
      }
}
int DisplayMenu()
{
int choice = 0;
system("cls");
draw();
cout << "Main Menu" << endl;
draw();
cout << "1 - Accounts Menu" << endl;
cout << "2 - Cards Menu" << endl;
cout << "3 - Lending Menu" << endl;
cout << "4 - Investements Menu" << endl;
cout << "5 - Exit" << endl;
draw();
cout << "Please Make Your Choice: ";
cin >> choice;
return choice;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The vector class keeps track of how many numbers you put into the array. So if you entered only 5 numbers, then aList.size() will be 5. For example, the following code will display the values of all the numbers in the vector regardless of its size.

for(int i = 0; i < aList.size(); i++)
{
   cout << aList[i] << "\n";
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes. You will find some examples here, though I presume you can find them in hundreds of other places too.

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

WTF??? I have no idea what that question is asking ????? Are you sure you quoted the problem correctly and accurately?

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

I think this will only work in Visual Studio...

Visual Studio is a compiler, not a language. What I am asking is do you have to create a CLI managed project to use that feature. I tried with a normal c++ program but could not add a reference that way. I don't normally write managed code.

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

No, it is a win32 api function so it will work with both console and MS-Windows GUI apps. If you are writing a game using some type of game engine such as OpenGL or DirectX then use whatever that game engine provides.

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

>>and my complier sayes "vector undeclared"
you have to include <vector> header file

You don't have strings named string1, string2, string3, ... What you have that I posted is an array of strings, so if you want to reference the first string you would use aList[0], the second string is aList[1] etc. Makes programming life a LOT simpler if you learn arrays.

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

How about the win32 api function PlaySound()

I have not attempted to generate a wave file, but if I did I would probably start here

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

In Solution Explorer you can also use Add reference to add a dll to your project.

Does that work with ordinary c++ programs? Or just CLI managed programs?

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

you don't need a loop. Just multiplication and the mod operator will do it

int main()
{
    double n = 123.45;
    int x = (int)(n * 100);
    x = x % 100;
    cout << x << "\n";
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

don't. Head files only contains class declarations, defines, typedefs, and function prototypes.

Have you notices that your program contains a lot of duplicate code? You can use a loop and arrrays to chop down the size of your program to just a few lines

string answer;
int stopped = 0;
vector<string> aList;
for(int i = 0; stopped == 0 && i < 10; i++)
{
    cout << "Enter string #" << i+1 << "\n";
    getline(cin, answer);
    if( answer == "done")
    {
        stopped = i+1;
        cout<< "ok, you are now finished entering #'s\n\n";
    }
    else
    {
        aList.push_back(answer);
    }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you do not have the *.lib that normally comes along with dlls then you can use LoadLibrary() to load the dll into memory, then GetProcAddress() to get a pointer to a function in the dll. See this for details.

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

Have you tried replacing FILE with fstream and replace malloc()/free() with new/deleteo[] ? See example program here

Then, of course, replace fputs() with cout statements.

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

What gives you the impression that creating such a macro would be more efficient than without it? Obviously each compiler might do it differently, but if you look at the disassembled code for VC++ 2008 Express compiled for Debug all the compiler has to do is push the address of the std::string object on the stack, the address of the string literal on the stack, and call a std::string method to concantinate the two. Seems to me that inserting your _MyMacro would just complicate things and slow it down, not speed it up, or it would have absolutely no affect one way or the other.

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

you don't want to use getline() since the data is integers. And you don't need alongarray either. You can replace lines 26-39 with just these few lines.

vector<long int> dateList; // no need to specify size in advance
long int num;
while( inFile >> num )
{
    dateList.push_back(num);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 14 is wrong -- in the format string replace the comma with a space like this: scanf("%d %d", &base, &exponent);

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

>>Can someone please tell me whats wrong with my code
Weeeeellll, since you didn't post your code and I can't see your monitor from where I sit, the answer is obviously NO.

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

If its only one click of the mouse to check it, then its also just one click to unclick it. I usually check them, so having it checked by default makes sense to me. But can't please everybody all the time :)

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

Before doing anything you have to know what the data file looks like. Can you post a few lines from it? Or just attach it to your post.

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

All it wants you to do is create a function named findReading with one parameter, which is a reference to a Reading structure.

void findReading( Reading & rd)
{
   // put your code here.  use cout to display prompts and cin to get keyboard input.
}


// here is how to call the above function
int main()
{
    Reading rd;
    findReading(rd);

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

Multi-processing (siultaneous processing) does not truely exist on a computer with a single processor. Only one thread at a time can run. The processor switches threads so quickly that it only appears to the human eye that they are all running at the same time. Its impossible for a single processor to execute two instructions at the exact instance of time.

That is not the same as scheduling threads with priority. The scheduler will give the thread with the highest priority the most CPU time. And if you increase a thread's priority high enough it may even disable the entire operating system because it will get no CPU time.

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

The function prototype in the class does not have the same identical type parameters as in the implementation code. Change go void getDate(int&, string& ,int&);

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

I hope you realize that changing environment variables in a program is not permanent and good only as long as the program is running. Just like *nix, any changes made will disappear when the program stops.

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

In a timer thread do this:

class MyObject
{
public:
   ...
   void Destroy() {delete this;}
   ...
};

MyObject* obj = new MyObject;
// in a timer thread

obj.Destroy();
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Hi -- what do you mean by "make a project in IT" ? Please post questions in the appropriate DaniWeb board.

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

>>but how do i write a statement that will store the data for the farenehit and centigrade?

Here is how to access farenheight -- you should be able to figure out the other yourself. data.temperature.farenheit = 32; As for the second part -- do you know how to write a function? And how to use cin and cout ?

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

didn't you look at the code I gave you????

ref class Form4;
ref class Form3
{
public:
	Form4 ^SomeMethodA();
};

take that out of the *.h files because it isn't needed.

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

Are you adding those resources all at one time? Try calling EndUpdateResource() and see if that fixes your problem.

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

do you mean this compiler ?

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

The most common method is ODBC or MySql++

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

Any worse than this ?

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

I don't think that's very mature post Mr. Ancient Dragon.
.

What so immature about that? Just pointing out that if you donate to DaniWeb (see the DONATE thread at the top of the pags) you can get rid of the advertisements.

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

I am using Windows XP and Firefox 2.

I'm getting stuff not only from websites, but also from files on my hard drive. I AM using tabs, and also Windows Explorer. But when I return to the window with the post, the ad plays again. The ad often takes me to the top of the page, and when I scroll down again, the text is gone.

Could this be a cache problem?

Become a DaniWeb donator and you can get rid of those annoying ads.

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

move the implementation of button1_Click() from Form3.h to Form3.cpp. Attached are new files. It still has link problems for unresolved external functions, but you just have to implenent them in the *.cpp files.

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

All humans probably have a common human ansistor too, but that doesn't prove or disprove the theory of evolution. Human life probably started somewhere in Africa and spread around the globe from there. Same thing happened to those octopuses. Now, if scientists could some how PROVE that the original octopuse evolved from something else, then that would be an earth-shattering story.

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

zip up the project minus object files and post it so that we can see what the problem is.

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

Replace the "<namespace name>" with the namespace used in your programs. You can find this in the *.h file, for example

#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

#include "Form1.h"

namespace testform {

Yours will be different than mine -- the VC++ 2008 compiler generates the namespace name based on the project name when you created the project.

So I added this line: using namespace testform;

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

I think in the *.cpp implementation files you need to add using namespace <namespace name>; . That made it work in my test program.

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

because you have recursive includes -- form3.h includes form4.h which includes form3.h ...

Not a good idea, as you have found out.

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

Where was defined the type ptr?

See line 32.

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

I assume you are talking about MS-Windows operating systems. If not, then ignore this.

maybe the example in this link and this will help you. It shows you how to mount a network drive. If WNetAddConnection2() fails and returns ERROR_ALREADY_ASSIGNED then the drive is already mounted. Also make sure to read the remarks at the bottom of the page.

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

Node is defined within class AVLTree and only has scope within that class, so in order to use it as a parameter you need to declare its scope. Try this: void AVLTree<T>::levelorder(AVLTree::ptr& root)

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

Compare Machelle and Nancy with Jackie K.

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

Your program does not include <string> for std::string class, so how in the world are you getting it to compile????? Don't attempt to execute a program that contains compiler errors or warnings. Yes, warnings in your code are usually errors too.

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

>>for(i=i;i<10;++i)

should be for(i = 0 ...

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

How in the world could anyone look at that picture and NOT notice her dress ???? Someone on talk radio yesterday mentioned that Michelle will probably set another fashion trend just like Jackie K. did in her day. But somehow I doubt it. Jackie was a real knock-out and true First Lady -- no one has matched her beauty before or since then.