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

I prefer them too, but they are not compatible with other languages or most win32 api functions. If you are not concerned with either of those then by all means use std::string.

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

<deleted>

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

For MS-Windows operating systems you want to write a Windows Service program The first few google links will tell you how to do that.

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

Whether you can specify the new window's size and location will depend on the program you are trying to launch. Some program, apparently like Notepad.exe, do not honor such requests. In this example I created a Windows Forms program. The code below will change its initial x and y upper-left coordinated but the window size does not change.

#include <Windows.h>
#include <iostream>
using std::cout;

int main(int argc, char* argv[])
{
    STARTUPINFO info;
    PROCESS_INFORMATION pinfo;
    memset(&info,0,sizeof(info));
    memset(&pinfo,0,sizeof(pinfo));
    info.cb = sizeof(STARTUPINFO);
    info.dwX = 150;
    info.dwY = 150;
    info.dwXSize = 300;
    info.dwYSize = 600;
    info.dwFlags = STARTF_USEPOSITION|STARTF_USESIZE;

    BOOL rval = CreateProcess("C:\\dvlp\\addressbooki.exe",0,0,0,
        0,0,NULL,NULL,&info,&pinfo);
    if( rval == FALSE)
    {
        char buf[255] = {0};
        DWORD dwError = GetLastError();
        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,0,dwError,0,buf,sizeof(buf),0);
        cout << buf << '\n';
        return 1;
    }
    cout << "All ok\n";
   // The next line is optional -- only needed if this program
   // needs to wait until the spawned program has finished initializing
   // itself.
    WaitForInputIdle(pinfo.hProcess,INFINITE);



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

system() will not let you specify the screen size.

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

why are you doing that one character at a time? You can write the entire buffer all in one function call using fwrite(). You will want to open the file in binary instead of text mode. bytewritten = fwrite(buf,1,payload,fp);

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

line 12: how is variable c defined? fgetc() returns int, not char.

You need to post the code that write the file. Also attach a copy of the file or post the first few lines if the file is text.

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

win32 api function CreateProcess() will let you do it, and I think it will even let you specify the screen size in the startupInfo parameter.

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

Lots of programs that do it -- MySQL Workbench. For a simple version such as what you want you will need to know SQL so that you can retrieve the information (table names, and information about each of the columns in the table). Then you will have to know how to update, insert and delete rows on the tables. Once you know how to do all that you are about half way home to writing your program.

Writing the GUI side of the program can be fairly simple if you use CLR/C++ Windows Forms because creating the forms are done visually via drag-and-drop capability of the Microsoft VC++ 2010 compiler. You can create the forms in just a few hours. If you have a lot of tables and you want the forms to be dynamic for each table then the gui part might be a bit more tricky, such as adding list boxes or text boxes and labels at runtime instead of at design time.

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

You can write your own large number library using character arrays to hold each digit. Here is one such library (c++ class)

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

>>Otherwise, you should try a new compiler.
Don't blaim the compiler for your own failed code. You still have not fixed what other people have told you is wrong with that function.

>>Otherwise, you should try a new compiler.

A different compiler won't help. The only want to get rid of the error is to fix the problem.

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

You are experiencing a very common problem for new coder. When you enter Y for answer then you also press the Enter key, which is '\n'. That key stays in the keyboard buffer because your program only extracted the first character that was typed. You have to flush all the remaining charactgers from the keyboard to that the the program will want for you to type the answer to the next question instead of just getting whatever characters are already in the keyboard buffer.

One way to do that in c++ is described in this article written by Narue.

Khoanyneosr commented: Thanks very much! I'm pretty new to coding, I've only coded C++ for about six months and really appreciate your help. +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>There is so much more you can do with Linux.

Care to elaborate? What more can you do the Linux that you can't do with MS-Windows? IMHO just the opposite is true -- I can do a lot more in MS-Windows than linux, for example, I can play movies on my DVD player in MS-Windows which I have not been able to make work on Ubuntu.

Business software: There are hundreds, maybe even thousands, of programs available for MS-Windows that are not available on linux. Just look at Programmer's Paridice magazone or online store to get the idea.

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

The first parameter is not char** but char*. Delete key1 and key2 because neither
are needed. And the last parameter is a pointer to your comparison function, which will be something like the following.

Is variable catFreeEntry the number of elements in the catalog array of structures?

int compare(void* k1, void* k2)
{
   struct catPage* p1 = (struct catPage *)k1;
   struct catPage* p2 = (struct catPage *)k2;

   return strcmp( p1->????, p2->????); // compare the two structures
}

bsearch(key, catalogue, catFreeEntry, sizeof(struct catPage), compare);

Also note that the first argument to bsearch needs to be of the same type as the second argument, in your program the first argument needs to be struct catEntry. So you need to copy key into a struct catEntry so that you can pass it as the first argument. The reason for doing that is because bsearch() will pass it to the comparison function.
Read more details about bsearch() here

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

You have to declare functios before they can be used. Add a function prototype for menu() befor main().

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

Use a calculator if you have to but 256*256 = 65536, not 65538.

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

There is no correct solution to the problem because:

1. The variable x is undefined and we don't know its initial value.

2. The value of x never changes, therefore that is an infinite loop

3. There is no if, so the else is incorrect.

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

65536 is 10000 hex. Why 65538?

Huh??? What are you talking about?

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

Post what you have done because nobody here is going to write it for you.

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

You mean you want to write one, or do you want to find out if there already is one?

>>(my windows compiler is visual c++ 6)

You should replace it with VC++ 2010 (the Express version is free).

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

buffer overruns

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

where did you define MAX?

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

I think you have mis-understood the assignment. Read it again, it doesn't want you to create a class named incrementMinutes but that is jusst the name of one of the class's methods. The name of the class is probably Time.

I think you should post the exact wording of the assignment so that we are all on the same page. But be careful -- many instructors don't want you to post assignments here. So make sure it's ok before posting.

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

Looks ok, what errors are you getting?

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

can not have function name the same as a variable name. Change one of the two.

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

You can simplity all those if statements if you convert menuinput to either upper or lower case. And then you can use a switch statement. You can also delete all those variables on line 11 and initializations on lines 16-33.

menuinput = toupper(menuinput);
switch(menuinput)
{
   case 'A': // blabla
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Possibly a related problem: Using IE8, the "Unanswered Threads" and "Threads I've Posted In" buttons don't always work. Have to click them twice in order to get valid lists. The first time I click either of those buttons the browser seems to do something but when all done the screen doesn't change at all. Refreshing does not change it either. The second time I click the button everything works normally. I can make this happen consistently every time I try it, and have noticed the problem for the past day or so.

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

i know. what i'm asking is....how do you create a regular windows .dll instead of an .exe from that compiler?

From which compiler? VC++ 2010 or VB? You can create DLLs from both of them.

In VC++ just create a DLL project and the IDE will generate all the basic code for you. I'm not sure about VB, probably something similar.

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

That tells us nothing.

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

20 years ago it would make a lot of difference where you put include files due to slooooow compilers and slooooow operating systems. Under MS-DOS 6.X I used to start a compile and go read a book or two. We tried to speed things up by including only the header files that were absolutely necessary.

Todays high-speed computers, operating systems, and compilers do not have that problem, except for very very large programs or groups of programs.

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

is the program gui or console? What operating system? What compiler? We need a lot more information before anyone can give you any help.

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

The first word in each line appears to be the account number. Everything from the end of the first word up to the first numeric digit can be assumed to be a name. After the name, everything up to either +, -, or a digit is the address.

There's a couple ways to solve the above.
[1]Read the file one character at a line and add the charactrers to the appropriate field in the structure.
[2]Read the entire line at one time then use a pointer to parse the input line.

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

You will have to post relevant code if you expect any help from here. Or you would get better help by joing one of IBMs forums specific to the compiler you are using.

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

The code you posted requires the program to read just 3 lines of text. What happens if there is only 1 line, or 20 lines, or 1,000 lines? You certainly don't want to have to count the number of lines before reading the file.

A solution is to
1. Create a structure to hold all the information for one person

2. Use a vector of the structors so that the vector can hold as much or as little data as there is in the file.

3. read the file until end-of-file is reached.

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

Huh?? What is "qcheck=all"? Is that a compiler option in Aix Unix os, such as this one?

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

In that case your tobinary() function is just wrong. Read some of these links to see how its done.

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

If you ever used a Microsoft compiler you would know that they always produce stdafx.h, which is a catch-all for other includes. The most useful use of it is to compile c++ programs with pre-compiled headers. But this is a C forum and not C++ so precompiled headers is not relevant to the discussion.

I've used a combination of header files that include other header files which are common to all *.c files in the project. Header files which are not common are put directly into the *.c file that uses them.

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

>>printf("%s", bin);//pass

bin must be a null-terminated character array if you want to use printf() to display its contents. For example. Note that you don't have to specifiy its size, the compiler will figure that out for you from the list of initializers. char bin[] = {'0', '0', '0', '0', '0', '0', '0', '0',0};

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

>>strcpy(address,NULL);

strcpy() hates that statement because it expects a valid pointer as the second argument, not NULL pointer. If all you want to do is initialize the array to 0 then use memset(), e.g. memset(address,0,sizeof(address)); , assuming that address is not a pointer. Or you can just simply do this: address[0] = 0;

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

The if statement on line 5 is wrong. You should be calling one of ifstream's metods. Sould be like this: if( install.is_open())

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

I think pipes will work for you. Here are a few links you might want to read.

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

Yes, its working now. Probably caused by some changes you were making this morning.

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

why don't you ask Facebook???

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

Whether you can find it with google or not will depend on the problem you want to solve. The source code for most programs are proprietary and are not posted anywhere on the internet.

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

Insert Link button gives "File Not Found" error.

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

Not all DLLs have to be registered. Just because it uses COM doesn't mean it has to be registered. Just put it in one of the folders in the PATH environment variable.

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

Oh nevermind -- the problem seems to have fixed itself.

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

I get this error for every thread I click in the c++ forum. C forum seems to be ok.

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

I'm not going to write the program for you, but to get the Enter keys

while(_kbhit() )
{
   int c = getche();
   if( c == '\n' )
   {
      printf("got one\n");
   }
}