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

The contents most form controls are always empty when first displayed. If you want them to display something then setl OnInitialUpdate() event handler.

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

what do you mean by empty form? A form with no controls or buttons? Just set the properties of all the controls and buttons to be not visible, then your program will have to explicitly set the visibility property when desired.

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


In fact, searching on Google gives matches at Rent-A-Coder.

OMG! I didn't realize this was going on. :-O And to think I have been working my buns off for the last 20 years when I could have been drinking a beer while letting RentACoder do my work. I would hope universities will expell any student who does that.

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

>>how to initialize a one dimensional array

you can initialize an array at the time it is declared, like this int array[25] = {0}; >>how to read the data into the one dimensional array
use a loop and read each element one at a time. Details should be in your textbook and depends on whether you are writing C or C++ program.

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

>>i want after filling 5 textboxes application should wait for 5 Seconds. and after that all entries should be clear and ready for next user input.

>>but for the next input round the application clears the input. but i am not able to edit it

you will have to make up your mind how you want this, you can't have it both ways. You can do what other database programs do and that is to add two more buttons titled "<<" and ">>" that let you scroll through the items you have already entered. The "<<" button retrieves and displays the previous record while the ">>" button retrieves and displays and record next in line after the current record.

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

getting files from HD is pretty easy -- as Walt said. Writing to CD is much more problematic because you can't use standard stream io on it but go through the CD's device driver. I don't know how that's done because I always use a commercial cd writer program.

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

Apparently you can use Microsoft's ADOX DLL

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

I take it that the console app is program that runs on a PC and compiled with a different compiler -- you can't compile PC programs with eVC++ 4.0. Or do both programs run on the same target device?

I know that VC++ 2005 is capable of doing what you want -- that is setting dependencies among projects. Not sure about eVC++ 4.0, I doubt it. What you might have to do (and how I did it in the past) was to write a small batch file to compile the programs in the desired order from the command-line.

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

If on the MS-Windows os you can use win32 api functions or any of several other gui libraries such as xwindows. All of these require solid underatanding of C or C++ languages.

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

I can no longer see any of the mod threads in Coffee House. Also lost my mod status :(

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

That's great news :) :) Hope they throw that guy in prison for the rest of his life.

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

I closed this thread becuse it has become a pissing contest.

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

It compiled and linked ok for me with that compiler. Must be the way you set up the project. First, create a new empty console project. Copy the *.cpp and *.h files into the project folder, then use menu Project --> Add To Project --> Files, and select the files you added above.

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

>>Where did that isvalidInt come from?

You wrote the program, we didn't. You will probably have to write that function yourself because it is not standard C or C++ function.

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

attempt to open the file, or you can call GetFileAttributes() and it will return -1 if the file does not exist. Another more expensive way is to call FindFirstFile().

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

Here is one suggestion. Download the source code and adapt it to your problem.

Browse around that site and you will find thousands of useful programs.

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

>>_CRTIMP FILE* __cdecl fopen (const char*, const char*);

The above is a function prototype. It has an open parentheses '(' and close parentheses ')' with or without arguments between the parentheses.

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

The Secret of Life. Live with a person you love, and love him/her always. Don't cheat on your partner, and never go to bed mad at your partner -- all disputes should have been resolved by then.

Now, you can wire-transfer my psychoanalysis bill of $1,000.00 USD to my bank. :)

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

If you are starting from scratch you will be way way over your head attempting to do what you want to do. Start at the beginning, learn the language first. See the Read Me threads at the top of this board for lots lof links to get you started.

But to answer your question: DirectDraw or DirectX SDKs are probably best, which can be downloaded free from Microsoft site. And yes, you can use c++, which their sample programs are written in.

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

See CreateFontIndirect and visit the links at the bottom of the page.

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

Here's another link that may interest you.

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

You will probably need to create a function that checks for keyboard hit (such as kbhit() from conio.h) and time() to get current time, something like this. This won't work if your compiler does not support conio.h, which is a non-standard header with non-standard functions.

It also assumes MS-Windows os because of the Sleep function. If you are using *inux os then replace it with sleep() (lower-case 's')

bool chkinput()
{
   time_t t1, t2;
   t1 = time(0);
   while( !kbhit())
   {
         Sleep(100);
         t2 = kbhit();
         if( (t2-t1) >= 30)
            return true;
   }
   return false;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Investigate the ioctl function. But you'd better be prepared for some very advanced c programming.

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

_getcwd(). Its not a win32 api function. or GetCurrentDirectory() which is a win32 api function.

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

Well being that far away
will we ever get there
the answer is of course No

I wouldn't be so confident about that. Yesterday's science fiction is tomorrows fact. We have had StarTrek's communicators for several years now. And one day space ships might travel at worp speed.:-/ Shoot, even going to the moon was just so-much science fiction prior to 1960.

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

what programming language is this? And why is it not posted in the appropriate board? I'd move it but don't know what language it is.

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

Looks like Mel forgot regular members can't view threads from the moderator forum. ;)

I didn't realize that was mod only forum.

By the way, congrats on that "featured poster" badge!

Thanks -- I hadn't noticed it. :)

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

Still though I just like to hope that all people who ask for help (including me) aren't tarred with the same brush, but are looked upon individually because I have seen some people put some effort when they've posted questions.

We do our best to help those who try to do the work themselves.

And as a small aside, does Daniweb by any chance use a css file that means that visited links don't change colour? Just something I noticed...:-p

See this thread

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

how to draw a line depends on the operating system. If you are using MS-Windows you can use the win32 api graphics functions. If you are in MS-DOS you could probably just use a line drawn with dashes, in a loop of some sort.

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

Your algorithm doesn't work either with strings that contain nothing but junk characters. It will do nothing in that case.

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

works ok for me. your problem must be something else. what compiler? what are the errors?

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

Believe me , if you just download some project from internet and submit it as your assignment, you will get caught with more than 50% probability

And more than likely get an F in the course, or expelled from the university (worst case).

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

I don't think you can get just part of the SDK. But I think you can get it on CD for just a few $$$.

The _TCHAR allows the compiler to compile for either UNICODE or not. If your compiler doesn't understand that macro you can replace it with char

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

rewind moves the file pointer back to the beginning of the file so that it can be read all over again.

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

The problem is not the data files, but that you are using feof() to test for end-of-line. That doesn't always work the way we would like it to. Here's a better solution

else {
           
           printf("%-20s%-13s%-20s%10s\n", "EmployeeNumber", "Name","EngineeringDicipline", "YearOfBirth");
           printf("________________________________________________________________\n");
           fscanf(cfPtr, "%d%s%s%d", &employeeNumber,name,engineeringDicipline,&yearOfBirth);

// changes start here
           while (fscanf(cfPtr, "%d%s%s%d", &employeeNumber,name,engineeringDicipline,&yearOfBirth))
           {
                if(employeeNumber!=0){      
                    printf("%-20d%10s  %-20s%7.2d\n",employeeNumber,name,engineeringDicipline,yearOfBirth);
                }
           }
           fclose(cfPtr);
           system("PAUSE");          
      }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you have to zip them with WinZip or PkZip which will given them a .zip extension.

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

What operating system and compile are you using? Where did you get those two files? If you are using MS-Windows and you got the files from someone running linux/unix, then your program may not know how to interpret the end-of-line characters correctly.

Also, if the files are small you can zip them up and attach them to your post so that we can have a look at them.

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

Plzzzzzzzzzzz post your code very quickly and someone will help you.

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

this is a frequently used alogrithm called trimminging -- trim left moves all characters to the left to fill up all the spaces to the left of the string. trim right moves the null-terminator to the left until it reaches the first non-white-sace character (spaces and tabs).

To trim left you need to first find the first non-white-space character in the string. For example " Hello", the first character would be 'H'. then move all the rest of the string to the left so that the result is "Hello". You can use either pointers or indexing with loop counters to do that.

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

yes -- post your code and we will help you with the problems

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

Here are some examples

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

this works with VC++ 2005 Express and the Windows Platform SDK installed You have to add User32.lib to the list of link libraries.

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

int _tmain(int argc, _TCHAR* argv[])
{
    HWND hWnd = GetConsoleWindow();
    MoveWindow(hWnd,100,100,300,400,TRUE);
    cin.ignore();
	return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Can anyone please resolve this.
not if you don't give us current, compilable code. No point wasting our time on old obsolete code.

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

Your question seemed clear enough. Most people won't respond if they don't know the answer. And I don't know of any way to do it.

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

Here are the win32 api console functions. include windows.h and you will probably have to have the Windows Platform SDK, free for download from Microsoft.com

First call GetConsoleWindow() to get the handle to the console window, they you can call MoveWindow() to move it to wherever you want. I have not done it myself with a console window.

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

interrupt 2c returns binary numbers, not ascii. You have to convert them to ascii before displaying them.

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

your program will not even compile correctly so why are you trying to run it. arrays can not be allocated the way you are attempting in line 4 below. You need to make variable tests a pointer and use new to allocate the memory after line 6, at which time the value of numScores will be known.

int main()
{
    int numScores;
    int tests[numScores];
    cout << "Enter the number of test scores:";
    cin >> numScores;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

argv[0] contains the full path to the program. I don't think the PATH environment variable will help you because it contains a huge number of semi-colon separated directories.

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

lines 9, 11, 17 and 19 -- they are looping too many times, causing data overflow. Replace "<=" with just "<".

line 16: accessing a row in the array that does not exist. Since array elements begin with 0, there is no 6th row.

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

please see this thread.