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

My grandaughter was born on a Friday the 13th. For her 13th birthday my son bought her the complete collection of Friday the 13th movies. She is now 24.

susheelsundar commented: Great. :) +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Depends on the type of job you want -- you could start now applying for jobs that only require a BS or BA degree. That will give you some practicle experience while completing your masters. And that might open more doors for you with the company you are already working for because many companies like to promote from within before looking outside.

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

Link your program with the libraries, just like you would like to any other library. Each version of Microsoft compilers does it a little differently. For vc++ 2010 do this:

Select menu Project --> Properties (at the bottom of the menu). Expand the Configuration Properties tab on the left pane. The expand Linker --> Input. On the right pane the first item is "Additional Dependencies". Add the library names there. Once that is done, select Linker --> General. On the right pane you will find "Additional Library Directories". Add the path to where the NOMAD libraries were installed.

Another option is to use a pragma inside one of the source files for your program #pragma comment(lib,"nomad.lib") Replace nomad.lib with the name of the library. Use multiple pragmas if you need to link with more than one library.

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

You will also have to install MySQL on your development computer because that also installs the *.lib files you will need with MySQL++.


>>2: Can you find what you're looking for by doing a quick Google search?
NO


Did you try this?

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

If you smoke cigarettes, then you are addicted. Doesn't matter how much or how little you smoke. It only takes 1 cigarette to do the dirty job.

If you don't think you are addicted then stop smoking because there is no point to it and you will save some money too.

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

Ok, I'm going to pretend this is not just spam and put in my 2 cents worth. I quit smoking in 2001 after some 40 years. It was one of the most difficult things I have ever done, but well worth it. I tried patches but they didn't work for me, most likely because I continued to smoke while wearing them. Finally I just told my wife "enough is enough" and tossed the cigaretts away. I substituted things to eat, like carrots. I ate so may carrots my skin turned yellow. And I ate everything that wasn't nailed down -- gaining about 50 lbs.

Now I don't miss them at all, and have saved over $65,500 figuring today's prices ($6.00 per pack), or enough to buy me two new cars or a new house.

susheelsundar commented: Yay!! +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I would tak triumphost's approach. Start a new CLR/C++ Windows Forms project so that you can graphically design the form(s) the way you want them. That is a hell of a lot easier and faster than using pure win32 api functions. Then add in the code you wrote for that console program. How hard or easy that will be depends on the console program -- some may have to be rewritten to be integrated in with the CLR/C++ program.

NicAx64 commented: I'm still learning CLR/C++ I think it's a good technology,I'm with you. +7
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Just say the word and I'll gladly go to c++ forums and make sure your rep drops to -10000 too :)

jon.kiparsky commented: You're so very public-spirited, it's just heart-warming. +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Terrorist groups are as plentiful as McDonalds francises.

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

I think we already to something similar -- people who post "gimme the code" are ignored and/or down voted. Regular DaniWeb members do not generally provide answers to postes who show little or no effort. That's probably about the best we can expect.

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

Of course USA and europe are not without sin either. Reference the Salem Witch Trials and the Christian Crusades of the 2nd century AD. Even today American Christians sing Onward Christian Soldiers in church most Sundays.

jingda commented: Was salem involved +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

mfc, win32 api, windows forms, or something else?

For button push, just implemement it on the OnButtonClick even handler (might be called something else depending on what gui you are using).

For F1 you will have to override the WinProc() event handler or enable a keyboard event handler function. Some of these google links might help you.

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

I know someone who gets a pension of some kind from UK and she told me that UK takes some money out of her pension every month to pay for that wedding. I'm rather shocked about that, I would have though the Queen and royal family would have footed the bill not the UK citizens. Maybe Prince William and Kate should have just eloped and saved everyone all that expense. Of course I know they couldn't have done that, but still ....

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

>>Which is the best way of earning money

With a HP printer. Of course that will also get you some free room and board at tax payer's expense.

diafol commented: chortle +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Just how many times do I have to tell you how to do it. I answered that question three days ago in this thread (here)

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

I've seen that same behavior too on occasion.

jingda commented: Glad we are in the same boat +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Open the original file for reading. Open the new file for writing. Then in a loop read a block of data from the input file and write it back out to the output file. Since we don't know whether the original file was write in text or binary mode its always safest to assume binary mode. And I like to read blocks of data in chuncks of 255 bytes, but you can make it almost anything you want.

open input file in binary mode
open output file in binary mode
loop
   read a block of data from input file
   write the block to output file
end of loop
close both files
kumarmpk4u commented: His views helps me a lot +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Forgot to post this in Form1.h

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
                 ChangeFormText(this);
             }
jonsca commented: Nice job wrangling this thread into submission :) +14
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Portgas D. Ace commented: Good Form +0
Arbus commented: nice +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes, I like the miniseries (its not a movie) V. Its just as likely to be as true as anything in Star Trek or any other sci fi flick.

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

UFO = Unidentified Flying Object -- it doesn't mean the UFO came from some other planet, all it means is that no one knows what it is. Most UFOs are eventually identified.

Now if you asked us if we believe there is intelligent life on other planets, my answer would be most definitely yes. We are not alone, but we may never be able to prove it one way or the other due to distances between stars.

Have I ever seen a UFO? Yes, but it eventually turned out to be a military hilicopter (I live near a military installation that has lots of aircraft).

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

all graphics are out of reach of beginners (< 6 months studies). You better have a firm foundation in c and/or c++ before starting down that road.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
sergent commented: 3 +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Your teacher is correct. You do not put executable code in header files (there are a few exceptions) because the code gets duplicated in each *.cpp file in which the header file is included. Lets say you have two *.cpp files, and each one of those includes the header file. The compiler won't complain when compiling those two *.cpp files, but the linker will produce duplicate declaration errors.

The simplest way to solve the problem is to put the implementation code in one of the *.cpp files, and put a function prototype in the header file.

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

There are commercial grid controls that will let you do that, if you're willing to spend a few $$$. But you can also get a very good free one from here. I used that one for 5 or 6 years in some of my projects. Its over 10 years old now and has been tested by dozens of programmers in countless projects. And since you get the source code for free you can customize it to do anything you want, but customization is probably not necessary for your purpose.

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

I got that stupid message too, so I disabled it. If you are running Norton 360, click that green tool on your desktip and it will bring up a Norton window. On that window select menu item Settings, then Antivirus link. From there you can turn off SONAR Protection.

With VC++ 2010 Express (which I also use) you have to put the file you want to open in the same folder as the program's *.cpp files.

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

How did this topic turn from MFC to Windows Forms? Which one is it anyway?

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

When your grandchildren are in college or get married.

jingda commented: Hey ! that is what i said before +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

c++/CLR String class is not the same as c++ string class declared in <string> header file. Look up system::String class and review its methods

You can not use <string> in CLR/C++ programs, so you might as well delete that header file.

Example:

using namespace System;

int main(array<System::String ^> ^args)
{
    String^ s = gcnew String("Hello ");
    s = String::Concat(s," World");
    Console::Write(s);
    Console::Read();
    return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Microsoft does not directly support a grid control that is editable. To solve that problem I have used this grid control very successfully. For your project you will have to use either ODBC or ADO (depending on the databas you want to use) to do the queries and get the result sets, then populate the grid control with that data.

Suggest you upgrade your compiler to VC++ 2010 to get the benefit of compliance with current c++ standards and the .NET os. I don't know without some research if .NET has an editable grid control. Nor do I know what kind of database access it supports.

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

He was banned not for what he said to and about me, but for spamming all the forms on PFO with a post nearly identical to this one. And I closed his threads to avoid pissing contests and/or flame wars, which is where those threads were headed. Up until he spammed all the forums his posts were entirely within the limits of the Rules, therefore no infractions or warnings.

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

Just delete all the code previous to the line starting with POSITION. Its all useless code anyway.

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

Visual Studio 98??? That is almost as ancient as I am. Upgrade your version of VB to a more recent one. Start out with the free VB 2010 Express to see if that resolves your problem or not.

WaltP commented: I didn't know you were a teenager! Are you old enough to be here? :o) +16
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>CPtrList& templateList =AfxGetApp()->GetFirstDocTemplatePosition();


That makes no sense at all. You need to do some serious reading if you intend to use MFC. Look up the functions you are trying to use and read what they return. In this case the function return POSITION object, not CPtrList object. You can't just toss random code at a program and expect it to work.

Yes, MFC is difficult to learn -- I'v read the average learning curve is about one year to learn it well.

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

I compiled and ran your program without changing anything and did not get that error. It ran and produced this output file

The number 550 was read in

Maybe there is something wrong with your input file? Attached is the file I used

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

>>I get an error whenever I try to run it.
What was the error?

>>x = (int*)malloc(length*4);

what makes you think the size of an integer is 4??? Maybe it is, and maybe it isn't. The size of an integer depends on the compiler you are using. A more portable way to write that is x = malloc(length * sizeof(int)); And notice that C language does not require the typecast like C++ does. So if your source code file name has .cpp extension then you are writing c++ code, not c code.


line 42: Depending on the values you put in the two arrays, summing p like that could easily cause integer overflow. Might be better to use a 64-bit integer to reduce that chances of that happening.

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

use the example code snippet I posted here, but instead of putting the line just read into a linked list copy it into that array you posted.

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

This link has an example of how that function works. If you know how sprintf() works then you're nearly home with vsprintf(). Then if you read this thread you will see that the second parameter to vnsprintf() is the number of characters in the buffer. When compiled for UNICODE sizeof(TCHAR) will be greater than 1, the actual size will depend on the operating system you are using. MS-Windows sizeof(wchar_t) is 2, but *nix it is 4.

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

Reagan was probably one of the best presidents in my lifetime, including JFK. A long-time movie star he knew how to capture his audience, for example this YouTube clip

jwenting commented: vive la Reagan Revolucion! +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>What on Earth are you talking about? There are robust cross-platform libraries for everything in C++

Agreed, but the libraries are os-specific. If you are going to write a library then you most likely will have to use os-specif function calls. If you look at the source code for boost libraries I'll bet you will find os-specific functions. That is what I had in mind.

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

I don't think there is anything like that for c++ because c++ programs are pretty much operating system specific. Yes the language itself is os independent, but to make c++ programs do anything worthwhile they have to make os-specific function calls, and the programs have to be recompiled for each target platform.

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

Oh I give up too. I tried to help but all I got was shit. Let him solve the problem himself.

VernonDozier commented: Everyone here knows you're not at fault. +13
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I agree with Fbody that you probably have multiple copies of transinfo.txt. Suggest you search your hard drive and delete all of them except one.

And try being a little nicer, or you might find yourself banned for awhile.


>>thanks everyone else who's not a d-bag like A-Drag
I'll have you know I'm no d-bag. I'm an ass hole, or so I've been told. But did I post profaniy??? NOoooooooooooo. Now whose calling the kettel black.

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

>>Am doing migration from 16 bit code to 32 bit... help me to solve the issue...
There were some very major changes to MFC between the two versions. Which 32-bit version of the compiler are you using? I hopt it will be vc++ 2010.


Look up the function GetFirstDocTemplatePosition() and you will easily see what the problem is. This should have taken you no more than 60 seconds to find the problem with your code. Once you get the POSITION returned by that function you have to call GetNextDocTemplate() to get a pointer to the CDocTemplate class in which the CPtrList object exists that you are looking for (there could be more than one CDocTemplate objects in the program). Once you get that, you can typecast it to your specific document class (CDocument is derived from CDocTemplate), such as CMyDocument, and that will let you gain access to the CPtrList object in the document.

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

MySQL is very popular. But I don't know what you mean by "light". Its either SQL compliant or it isn't. I also don't know about its ability to recover after a crash. Since its so popular I can only assum that it can do it.

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

The problem is that the structure contains std::string objects, which can not be written to binary files like that. You need to either change the structure by replacing std::string with fixed-length char arrays or change the way the files are written, which can be somewhat tricky with std::string. IMO the simplest way to solve the problem is to change the structure

struct Book_Record
{
int ID;
float price;
char requestor[80];
char call[4];
char invoice[80];
// etc etc for all the rest of the structure members
bool deleted;
};

The next thing you will have to do is make minor changes in the rest of the code to call strcpy() in order to copy the strings into the structure. For example, instead of getline (cin,Book.name); you will have to do something like this:

getline(cin,dummy); // where dummy is std::string
strcpy(Book.name,dummy.c_str());

There are some pitfalls in using strcpy() like that -- you have to make sure the length of dummy does not exceed the size of the character array. In the example above, you need to make sure dummy.size() < sizeof(Book.name). That means more error checking in the Add function of the program.

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

You need to learn to organize your programs a lot better than that. What will you do with a program that contains millions of lines of code? Put them all in main()??? Of course not. You need to learn to write functions that perform specific tasks. For example if you have a switch statement that contains 5 cases then you will want to write 5 functions, one for each case, and then call those functions from within the switch statement.

I briefly looked at the code you posted and, to be honest, it needs a major overhaul so that its more understandable and better formatted. I can see why you are having so much trouble with that program.

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

Yes the reader should also lock with the mutex. I suppose you could have just one queue for all readers, as long as the objects in the queue have something to tell you what message goes to whom. Something like that is what MS-Windows does with the windows messages -- each message contains a handle to the destination window.

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

You can use some non-standard functions found in conio.h, assuming your compiler supports them.

time_t t1 = time(0);
time_t t2 = t1 + 60; // one minute timeout
while( !_kbhit() && t1 < t2)
{
   // do count-down timer
   Sleep(100); // delay 100 milliseconds
   t1 = time(0);
}

if( t2 >= t1)
{
   // timeout expired
}

// not do the cin stuf here
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You don't need a switch statement for that.

objectclass* objects = new objectclass[numberfobjects];

or use a vector of objects

vector<objectclass> objects;
objects.resize(numberofobjects);