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

Tutorial. It doesn't show you how to draw, but shows how to create a window. After that you using win32 api GDI functions to do the drawing. You might also check these out.

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

>>Microsoft Visual C++ is the win32 API, correct?
No -- its a compiler. You get the win32 api by including windows.h, and most any compiler that runs under MS-Windows os can do it as long as the libraries are installed.

>>i thought VC++ was only for windows, is that incorrect?
Yes. But with special software (I forget its name) you can run it under *nix too.

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

This is writing some unwanted character to the binary file. I have opened the file in Edit Plus.

Of course it does -- afterall that's what a binary file looks like. google for definition of binary file See post #5 above.

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

Can you please explain what a bit bucket is?

Click here

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

>>Error E2034 binaryfilewriting.cpp 64: Cannot convert 'int *' to 'const char *' i

>> out.write(&counter, sizeof(int));
That should have been typecast, like this: out.write((char*)&counter, sizeof(int));

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

If you want to convert that to c++ then you will also have to select a platform, such as MS-Windows, MAC, *nix, etc. Then you have to select a GUI library. wxWidgets and QT are pretty portable among platforms. You can use pure win32 api functions, but of course you loose portability.

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

line 26: that just caused a memory leak. Where did the memory allocated by new operator on line 16 go??? Answer: the Bit Bucket. You have to call delete[] before reusing that pointer on line 26.

>>I am not able to perform the step "out.write((char *)&i,5);",
Suggestion: Create a static counter at the top of the write2() function, increment it, then write it. That way it will not have to depend on something else writing it

int write2()
{
    static int counter = 0;
    counter++;
    out.write(&counter, sizeof(int));
    // rest of function here
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

First figure out the algorithm on paper, then code it.

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

Do you know how to move the window? MoveWindow() will do the trick.

Selecting a random number between 1 and 3 is easy -- int n = (rand()%3) + 1

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

You might try AttachProcess() -- beyond that I don't know.

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

Does it work on mothers-in-law too :)

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

A little easier one to use is ShowWindow() Get the first parameter by calling GetConsoleWindow()

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

I saw that too, just yesterday.

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

>>mins = int(sec / 60)
Its not necessary to use the typecast. sec/60 always returns an int when sec is an int.

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

>>She will be met in the afterlife by her husband, Raymond, her son, Paul Jr., and daughter, Ruby.


Yes -- use the mod operator. such as seconds = secs % 60.

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

the present corrupt political system

It's not the system that is corrupt but some of the politicians. The system itself is the greatest on earth today. But its run by humans, who are far from perfect.

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

>>She will be met in the afterlife by her husband, Raymond, her son, Paul Jr., and daughter, Ruby.

I doubt it. From what we read in the Druge Report she will be met by that thing with the long red horns in a very hot place.

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

The chimpanzee is real cute!

But which one is the monkey?

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

What is the client sending? If "Hello" does it xmit the terminating string NULL byte? (6 characters) ?

Have you printed out what the server is receiving? Does DieWithError() ever get called?

>> if(test == echoBuffer)
That will ALWAYS fail because all that is toing is testing the address of the two buffers, not their contents. To compare the contents you need to call strcmp().

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

>>1. Sort link list A in ascending order using a special sorting function by passing a pointer to the function.

Your selection_sort function does not mee that requirement. Is selection sort algorithm required? or can you use any sort algorithm you want? And where is the parameter ?

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

Linky here

I thought that is pretty funny -- but I hope some of you don't get pissed off at me for this :)

~s.o.s~ commented: Nice one. :-) +23
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>The outcome is not write.
write means to scribble something on a piece of paper or in a file. What you want is the word right which means correct.

1) All arrays are numbered from 0 to the number of elements in the array. In your example the array has elements numbered 0, 1, 2, 3, 4, and 5. Count them on your fingures -- that is 6 elements.

2) why does i get incrementd from 1 to 32 when the array only has 6 elements? After the program will just scribble all over memory and what happens can be any one's guess (called undefined behavior).

Take another look at those two loops, count them on paper or in your head so that you can see in your mind what is wrong with them.

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

That ancient Borland compiler probably wants <iostream.h> and leave out the using namespace std; statement.

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

What you want to do can be done if you have enough knowledge of either c or c++ to develop MS-Windows gui program. If you do it with c++ CLI/Windows Forms, C# or VB your job will be a lot easier than using plain win32 api functions.

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

What you want to do can be done if you have enough knowledge of either c or c++ to develop MS-Windows gui program. If you do it with c++ CLI/Windows Forms, C# or VB your job will be a lot easier than using plain win32 api functions.

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

what compiler and os are you using? Are you trying to compile a C file with *.c extension?

The only CString class I know of is in Microsoft's MFC library.

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

Oh I see now what you meant. I thought you meant sizeof(char) in c++ is different than in C.

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

I can't, but you might start your research with these google links

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

Watch the video here

To compile a C program just create an empty console application then add the *.c file(s) to it.

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

What can't you figure out? Do the math on paper first so that you can easily find the total pay. if the hours exceed 40 then you have to pay 1.5% for overtime.

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

McCain needs your vote!

He wil get my vote when hell freezes over :)

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

They have not happened yet, and the date has nothing to do with the olympics. Its nearly the same date every 4 years. The democrat convention begins Aug 25. The republican convention starts Sept 1.

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

In essence, char type in C (but not in C++) is a very short int, that's all.

I think you will find char data type is the same in both c and c++.

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

This question has been asked and answered millions of times. Click here.

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

reboot the computer.

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

world greatest commercial thing iscoffee houses.

Nope -- would have to be Wal-Mart since its the world's largest retailer. Starbuk's coffee houses are going under because people don't want that expensive stuff.

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

the earth is round, just like a pancake.

A pancake isn't round, at least the ones I make aren't. circular-shaped isn't round.

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

but i don't know what's goin on it's really hard to me to do this project so i'm stuck here,,,,
peace out

OMG! If you think this is hard just wait until you have to learn all those billions of chemical elements and 400-level math courses. As someone I know once said "Honey, you ain't seen nothing yet!"

William Hemsworth commented: hehe :) +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

> cat my_file.txt | grep ^ | wc -l

That doesn't satisfy the c++ requirement. If the op is writing shell scripts that would be perfect, but this isn't shell script programming.

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

Welcome to DaniWeb. And your English is perfect :)

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

Here is how to test command-line arguments. Run this program from a cmd.exe command prompt to see how to get the arguments into the program

#include <iostream>
using std::cout;

int main(int argc, char* argv[])
{
   for(int i = 0; i < argc; i++)
       cout << argv[i] << "\n";
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

try flooding comstat with 0s before calling ClearCommError().

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

I usually issue warning and/or infraction for users with more than 5 posts who don't use code tags. And it normally has taken no more than one two-point infraction to get someone to mend his/her ways because I remind him that he could get banned for not using code tags, which would be a real shame.

And I often give a first-time poster good rep for taking the time to actually Read the Rules and use code tags correctly.

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

What compiler are you tring to compile it with? And what operating system (version too)? That 15-year-old program was more than likely written with a 16-bit compiler -- especially seeing that it uses old obsolete dos.h header file.

What compiler errors? Or link errors?

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

Microsoft Visual Studio 5.0 (and newer) Professional version also compiles for Mobile 5.0. But it costs about $800.00 USD.

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

I am running Vista Home, created a CLI/Windows Forms project and still only get Win32 solution platform.

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

What TV or radio commercials really stick in your mind? Here's one that I really liked

http://www.youtube.com/watch?v=VXHHaGi4grc

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

2. But the problem i am facing now is that the printf statement that i wrote in my demo C program is being output only in the Command prompt screen, not in the Text area which i have for the input and output to the C program. As we all know that C returns only int, float double etc. i am facing this problem.

If anybody helps i will be grateful!

Are these programs run in MS-Windows os? If yes, then when the C program starts you can delete the C's command-prompt window, C program prints everything to a file, then when back to Java program have it read the data file and display the info in its window.

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

Did you use your compiler's debugger and setp through each line of the program? What was the value of hWnd (NULL or something else)?

In WinProc() I think you need to add code for WM_CREATE. The Hello World program you compiled should have had one.

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

Blah, I've lived in AZ for most of my life, can't wait to get outa here.

The grass is always greener on the other side of the fense :)

R0bb0b commented: Ya it is +1