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

Lets say you want the file names to be
MultipleFileCopyModule1.exe
MultipleFileCopyModule2.exe
MultipleFileCopyModule3.exe

To accomplish that you have a couple options:
1:) call CopyFile three times

std::string filename = "C:\\Dev-Cpp\\Programs\\MultipleFileCopyModule";
CopyFile((std::string)(filename+".exe").c_str(),  (std::string)(filename+"1.exe").c_str(),false);

CopyFile((std::string)(filename+".exe").c_str(),  (std::string)(filename+"2.exe").c_str(),false);

CopyFile((std::string)(filename+".exe").c_str(),  (std::string)(filename+"3.exe").c_str(),false);

2) Use a loop if the number of names is unknown at compile time, something like this:

#include <sstream>
#include <string>
...
...
std::string filename = "C:\\Dev-Cpp\\Programs\\MultipleFileCopyModule";
for(int i = 0; i < n; i++)
{
     std::stringstream newname;
     // create a new filename
     newname << filename << i << ".exe";
    // copy the file
     CopyFile((std::string)(filename+".exe").c_str(), newname.str(), false);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The good news is C++ has what is called global data objects -- objects that are declared outside any function are considered visible (scope) and usable to all functions/classes within the entire program. The bad news is global data is very frowned upon because they make the program more difficult to understand and debug. A better solution is to declare the objects local to a function then pass them around as arguments to the other functions/classes that need them.

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

why do you think CopyFile won't work for you? Its one of the easiest win32 api functions you can use.

for(i = 0; i < NumberFiles; i++)
{
    CopyFile(OriginalFilename, filename[i], FALSE);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>> powershell
Thanks for that, never heard of it before. :) :)

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

>>the following hightlighted text
There are no highlishted text. Do you mean lines 5, 6 and 7 ? That is doing the same thing as if there were a series of if statements, like this:

if( port == S1)
    rsensor = ROTATION_1;
else if( port == S2)
    rsensor = ROTATION_2;
else
    rsensor = ROTATION_3;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

we will be glad to hlep you when you show us your effort to do it yourself.

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

just write it multiple times using a different filename each time. Or write the first file then call os-specific command to make additional copies.

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

pass the array as a parameter

int pick(int choice[])
{

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

>>create thread is returning a void *
It actually returns a HANDLE, which is probably a void*. As long as hThread[0] is a HANDLE your code should be ok.

For your 2nd question, yes you can pass a pointer to a class object. just typecast it to void*

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

>>This occurs in the EnableLogging() function
I doubt it -- that function only has two lines of code, neither would cause that problem. You need to learn to use your compiler's debugger and step through the program line-by-line to find the real problem.

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

>>I might hazard a guess the Daniweb has more forums than any other website.
You would be wrong. see www.codeproject.com for one example. DaniWeb is, however, more diverse than any other site I have visited. Most other sites are devited to just one thing, DaniWeb has a lot of different things -- "one stop shopping" if you will.

>>But whether it works for the unregistered visitor is an unknown.
Unregistered users can not start new threads or post to existing ones. All they can do is read the threads.

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

just found this on that link

System Requirements Windows XP, XP 64-bit, Vista or Vista 64-bit; Mac OS X v 10.2.8 or higher; 35MB hard drive; available USB port; CD or DVD drive; DirectX compatible video card

So its definitely not compatible with your linux box. The first thing you will have to do is learn how to communicate via USB ports. I have not done that myself but others have posted link about it. After that you might have to contact the manufacturer to find out if you can do what you want to do.

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

you are getting ahead of yourself. READ THE MANUAL.

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

The manufacturer will provide the libraries (if there are any) and interface API instructions. You'll just have to read their manual to find out how to do it. The devices I worked with did not have libraries, but just a set of command that the program running on the PC could send it. For example if I sent the command "SPEAK" it might return the string "CHIRP".

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

if the command is in a std::string, just look at each character. Its not really all that difficult to do, so don't make it more complicated than it really is.

std::string command = "I1";

...
switch(command[0])
{
    case 'I':
    {
          int lineno = -1; // default is current line
          if( command.length() > 1 && isdigit(command[1]))
               lineno = command[1] - '0'; // make line number binary
          // rest of code here
     }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

PC and Mac compatible

IMO it is not compatible with linux, but could be wrong. Do you actually have one of those devices? The CD must tell you how to program it afterall that's one of its advertised features.

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

probably the easiest solution is to do a switch statement on the letter entered and then process the number(s) following it inside the case. Might want to write separate functions for each case to make the switch statement smaller and more manageable.

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

.
It is all a lot more complicated than many forums users even expert users think.

Maybe more complicated than something like MySpace or chatrooms but about the same as other computer programming boards.

For example, forums threads are often spoilt by users who reply to a thread with what is actually a new thread. My initial problem was that I didn't know where I should post my query as my problem could be posted in more than one category or in Daniweb's case Forums.

Yes we realize there is often some confusion and that's one of the mods job is to move threads to appopriate boards. I know of no one who got scolded for posting on the wrong board. But you will get thrashed for posting the same question on multiple boards, and we rarly have a problem of that kind.

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

If you use LoadLibrary() and GetProcAddress() you may not have to have the *.a library. See MSDN for details

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

delphi programs call win32 api functions all the time and all those functions are in DLLs written in C language. Find out how your delphi compiler links those programs and you will have your answer.

<snip>

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

I've never had to buy my own except though my employer. HMOs aren't worth the paper they are printed on.

This is a list of several plans in Illinois. The one from Aenta was what my previous employer offered and it was very good, I had PPE option which meant I had to select a doctor or service that was registered with them (In-Network Service). I see they only offer PPO on that site, which is nearly the same and PPE and also pretty good plans. In 10 years I never had a problem getting medical service that I needed.

But again you have to check out the plans from your state.

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

you might find the answer in one or more of these google links.

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

maybe this will help you.

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

There are several ways to implement your problem, but the simplest for you is to just use a series of if statements

if( function == "foo")
   foo();
else if( function == "foo1")
   foo1();
// etc etc

There are a lot more efficient ways to code it but I doubt at your level you would understand them. Probably the best is to use a <map> and function pointers. If you think you can do it then by all means go for it.

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

Except for the facts like C++ has more keywords, so int new; will not compile in C++, but it will work without any problem in C.

you have that backwards. the new operators is in c++ not C.

What's the difference between C and C++. Hundreds of differences. You can't take a C program and expect it to compile with a C++ compiler, and vice versa. Think of them as two completly different languages. As with most languages there are many similarities but there are also many differences.

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

>>Daniweb know how many users are not able to use forums other than to post replies to existing posts?

What! are you in second grade or something? You mean you can't see that big yellow button that says "START NEW THREAD" ? If not then you need glasses much worse than I do :)

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

Available insurance would have to depend on what state you live in. Here is the insurance available to Illinois residents. A simple google for your state might give you something similar.

If you have a local home owner's insurance policy you might ask your insurance agent for some advice.

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

post your code because I can't see your monitor very well from my house :) argc parameter tells the number of arguments on the command line plus one for the program name itself. In your example, argc should be 5, and the valid strings in argv are

argv[0] = program name
argv[ 1] = -bg
argv[ 2] = red
argv[3] = -fg
argv[4] = blue

If you attempt to read other strings in argv then your prog ram will most likely core dump.

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

First, the new thread must be either a static class method of a simple function. A DWORD is just an unsigned long, but don't count on that being the case in all versions of Windows.

To pass multiple parameters, create a structure with all the variables you want to pass and pass a pointer to that object in CreateThread.

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

if you are an independent contractor why does a company that you have a contract with provide you with insurance? you are not their employee so why should they provide you with medical insurance (I assume that's the kind of insurance you are talking about).

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

Ok this is a second part I m working on atm. It opens the file...reads a line. checks the lenght of te line and the if statement is checking if a character in the line is a letter ... and now i dont know what to do.... to check which letter and where to remember the times the letter appears...

Im from macedonia so the program is written in macedonian . ...

if you want to count the number of times each letter appears in the file then you will have to have an int array with 255 elements. use the letter itself as an index into the array. for example:

int letters[255] = {0};


for(brojac=0;brojac<dolz;brojac++){
   if( isalpha(zbor1[i]) )
         letters[zbor1[i]]++;
}

now when the loop above finishes you will have the count. Take a look at any ascii chart (see google for them) and you will see that the letter 'a' has an ascii value of 97, so zbor1[97] is the numbe of times that the letter 'a' appears in the file.

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

go to www.codeprject.com and search for tab control examples. They have a lot of mfc code that you can look at to see how its done.

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

!a returns a boolean value which can not be incremented.

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

what is the value of i when that read loop finishes? Is it greater than 300 ?

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

My parents bought their previous home for 35K Guilders in 1970. They sold it in 2000 for 1.5 million.
Admittedly they'd added a 1 acre garden along the way, but still it's a major difference.

In the Netherlands :-O I'm supprised homes are that expensive there.

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

lefthandedness has been associated with a greater than average ability for logical thought and problem solving.

Ahhh -- so that explains why my son is so bright (he has a BS in computer science) :)

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

you forgot ambidexrous

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

the easiest was is to use streamstring class

#include <sstream>
...
...
stringstream sqlquery;
int seconds = time (NULL);
string characters; 
characters = "text from user input";

sqlquery << "INSERT INTO chatlog (datetime, message) VALUES ('"
          << seconds << "'','" << characters << "')";
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Of course, these will vary even inside a single country, but here's a few I can estimate quickly for my area:

new house in a smart neighbourhood: $600,000+

houses are a lot more expensive on west coast USA than in mid-west where I live. your 600,000 house is only worth about 250,000 here.

To put your argument into perspective for me, when I was first married in 1962 I could fill the back of a full-size station wagon for $65.00 USD. Today, I could only get MAYBE two sacks.

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

.sugar -- 10 lbs is $1.49 USD

That should have been 4 lbs of sugar, not 10 lbs. sorry for error.

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

i don't think you want such a list because the list is so long. we buy hundreds of things every month. how about you giving us your list and we give you our prices. i would think this information should already be available someplace.

sugar -- 10 lbs is $1.49 USD

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

bill gates did it.

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

If all the functions are in one *.c file then you can declare all the internal functions with the static keyword and the symbols will not appear in the libraries or be accessable outside the *.c file.

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

convert both times to seconds then subtract the two. Finally convert the difference to normal hours, minutes and seconds. To convert to seconds = hours * 3600 + minutes * 60 + seconds. Converting the difference back you need to use the mod operator % and division operator /. Example: hours = diff/3600, and the remaing seconds is diff % 3600. That will become the new diff to calculate the minutes.

To illustrate: assume the difference is below. Here we use integer arithmetic, so there are no fractions.
diff = 1 hour 24 minutes 30 seconds = 5070 seconds

Now to convert the seconds (5070) back to hours, minutes and seconds, do this:
hours = 5070/3600 = 1
new diff = 5070 % 3600 = 1470

minutes = 1470/60 = 24
new diff = 1470 % 60 = 30

seconds = 30

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

why don't you just use nested for-next loops?

int a = 0;
int b = 0;
char array1[10][10];
char array2[10][10];
for(a = 0; a < 10; ++a)
{
    for( b = 0; b < 10; ++b)
    {
         array1[a][b] = array2[a][b];
    }
}

or an even easier way to do it is like this:

char array1[10][10];
char array2[10][10];

// copy array1 into array2
memcpy(array2, array1, sizeof(array1));
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

is it a programming problem? Yes, then what language ? First, go here and select the language of your choice. Let's say you want c++. When you click the c++ link you will see this page. See the yellow button near the top called Start New Thread? Just click it and fill in the blanks.

If you have just a general question that doesn't include any specific programming language then select Computer Science And Software Design on the same page as the c++ link I mentioned previously.

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

>>I'm really having trouble figuring out how to create this function
How to creat the function or how to calculate the time interval? To compute the interval you also need the date (day, month and year) because time intervals can span days or even years. Believe it or now but there are standard C funcions to do that -- see difftime function in time.h.

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

In addition to the Read Me threads, here's another that has a list of free ebooks.

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

>> cin>>"goldennumber";
remove the quotes. it should be like this: cin>>goldennumber;

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

you forgot to include <string>

>> system ("pause") ;
Don't do that. Just use cin.get()