WolfPack 491 Posting Virtuoso Team Colleague

Do you know either C# or C++ ?

WolfPack 491 Posting Virtuoso Team Colleague

Linked List
You can also try googling.

WolfPack 491 Posting Virtuoso Team Colleague

Do you have a GUI and a Menu? If so, then you should search on the subject of keyboard accelerators
This may also help.

WolfPack 491 Posting Virtuoso Team Colleague

This snippet sends the string at zero based index 3, to the position at index 0.

HWND hList = GetDlgItem(hwnd, IDC_LIST);
char buf[100]="";
SendMessage(hList, LB_GETTEXT, (WPARAM)3, (LPARAM)buf);
SendMessage(hList, LB_DELETESTRING, 3, 0);
SendMessage(hList, LB_INSERTSTRING, 0, (WPARAM)buf);

The original order of 0 1 2 3 4 5 will endup with 3 0 1 2 4 5

WolfPack 491 Posting Virtuoso Team Colleague

Yeah. But won't deleting an item from it's original location and inserting it in it's new location change the order of the items?

WolfPack 491 Posting Virtuoso Team Colleague

I don't know. It was just a hunch. I am too lazy to try it and see. Another straightforward way seems to be the use of LB_INSERTSTRING. Since you can specify the index of the position that you want to insert the string to, I think you can use it to change the order of the items.

WolfPack 491 Posting Virtuoso Team Colleague

Yeah. There is no such function in the API too. But I don't know if the list box will flicker if you remove and add the items all at once. Can't you do it by using the LB_SETITEMDATA message? I think it would be much faster.

WolfPack 491 Posting Virtuoso Team Colleague

How about looking at the facilities offered by the API?

WolfPack 491 Posting Virtuoso Team Colleague

Densha otoko remake? I guess that was the inspiration behind your nickname (Orewa Cho Otoko Da? )

Aia commented: Let's make it count. +6
WolfPack 491 Posting Virtuoso Team Colleague

Loading a PNG file to memory won't be of any problem if you have done file handling in C++. To break down the information of the file, just google for the specification of the PNG file format.

Where and how do you want to display the PNG file. Are you planning on displaying it on a dialog created on your own? Or would it be okay to let a third party function create that for you too?

WolfPack 491 Posting Virtuoso Team Colleague

Read this tutorial. Searching for C++ File IO in google will also give you more than enough results.

WolfPack 491 Posting Virtuoso Team Colleague

You can use the SetWindowPos Function.

WolfPack 491 Posting Virtuoso Team Colleague

Why don't you look up the documentation of the function that you are using? If you are using printf, look for the documentation for printf in .net 2003. It will have the valid format specifiers and the corresponding data types.

WolfPack 491 Posting Virtuoso Team Colleague

Put a semi colon after the declaration of the class. (After the closing brace at the 49th line)

WolfPack 491 Posting Virtuoso Team Colleague

(smoking!=party animal)

That's wrong for two reasons

1. Humans are 100% animal, there's no "partly" about it.

Either you are dyslexic or you ought to change your spectacles. Or I missed the joke.

2. I have never seen another creature on this planet who smoked. Humans are the only creatures that do it, and we are supposed to be intellectually superior to all others :-O

Actually humans started smoking because they ARE of superior intelligence.

WolfPack 491 Posting Virtuoso Team Colleague

Hello

Hello


Is this normal?

No. Errors are not normal.

Or how can i prevent this?

By telling the linker where your library files are. There is a option in your project settings to specify the directories to search for library files. Use that.

Thanx in advance

You are welcome.

WolfPack 491 Posting Virtuoso Team Colleague

What happended to
1. Test that you are not reproductively challanged
2. If 1 is false, say bye bye to your fatherhood dream
3. Get a Girlfriend
4. Test that she is not reproductively challanged
5. Repeat 3 and 4 until 4 is true
6. Get Married (I am a conservative)
7. Do it without protection until the wife gets pregnant
and those stuff?

Must be difficult to fit it into the alphabet I guess.

joshSCH commented: This is for reading Siddhartha :) +11
WolfPack 491 Posting Virtuoso Team Colleague

Nothing wrong with the Message handling part. Must be something else. Try adding

return FALSE;

at the end of the Windows Procedure function.
Like

LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)                  /* handle the messages */
    {
        case WM_RBUTTONDOWN:
        {
             MessageBox(0,0,0,0);
        }
        break;
    }
    return FALSE;
}

I don't think your windows proc even compiles since it is not returning a value.
If that doesnt work, post your full windows procedure.

WolfPack 491 Posting Virtuoso Team Colleague

Are you sure that passing all parameters as 0 into the MessageBox function will work?
Are the other windows messages working properly? If they are not, then maybe the Windows Procedure isn't properly bound to the Main Window.

WolfPack 491 Posting Virtuoso Team Colleague

Use some imagination here.
You know where you clicked inside the client area. (From lParam)
You know the rectangular limits of the stati control (Lookup GetWindowRect).
So you can find out if you clicked inside the control or outside.
If it is inside, then do what you want to do.

The other way will be to subclass the static label control, which is unnecessary and hard work.

WolfPack 491 Posting Virtuoso Team Colleague
WolfPack 491 Posting Virtuoso Team Colleague

And its not that only immature people play or discuss about games. There is Narue, me, Mel and the others.

What makes you say that they are otherwise?

WolfPack 491 Posting Virtuoso Team Colleague

Yeah. Post in a geeks lounge thread, and say I agree. That will get you all the reputation you need.

Serunson commented: i loved ur idea! +3
WolfPack 491 Posting Virtuoso Team Colleague

Must be talking about the Internationally Reputed Criminals. Yeah nobody likes them.

arjunsasidharan commented: ;) +3
WolfPack 491 Posting Virtuoso Team Colleague

I used to go on IRC but not anymore i dont like the people there

Who are there?

WolfPack 491 Posting Virtuoso Team Colleague

Good Luck.

WolfPack 491 Posting Virtuoso Team Colleague

You can edit your own post only within 30 minutes of posting it. After that, unless you are a moderator of that forum, you won't see the Edit Post button.

WolfPack 491 Posting Virtuoso Team Colleague

If you are not good in C++ how come you are trying to do something as complex as Keypress event handling? Going through GetAsyncKeyState functions with little or no knowledge of C++ will only confuse you.
Wouldn't you be better off with trying to just write code for

RPM = TPP * 74.5 + 750;
KPH = RPM * 0.0075;

and C++ if else branching?

Forget about the KeyEvent Handling part for now. Write a program to get user input from keyboard, and display it. Then try decision making in C++ (if, else).

Go through the resources listed in here for a start.

WolfPack 491 Posting Virtuoso Team Colleague

Because the Trace function is to be used as a general purpose function, the writer of the code doesnt know what type of arguments and how many arguments will be passed. In other words Trace is a variable argument function. You can know if a function is a varibale argument function by looking at the ... ellipsis at the argument list in the definition. The va* family of functions are used to extract the number of parameters passed during runtime, and extract them.

Also see if you can understand this.

WolfPack 491 Posting Virtuoso Team Colleague

! As you know,it's impossible to study C++ well without English.

If you have good C++ books written in or translated to a language you understand, English is not a necessity. Ask any Japanese C++ programmer. You will find it hard communicating in an English IT forum like this, but you can learn C++ without English.

WolfPack 491 Posting Virtuoso Team Colleague

Doug,

I don't think it is a problem with the resource file. Show the code where you are displaying the menu.

WolfPack 491 Posting Virtuoso Team Colleague

If the _DEBUG flag is not defined, the code inside the #ifdef #endif preprocessor directives will not be compiled and linked.

The code inside the directives makes the program slow and bulky. So allthough you want it for debugging, you will not want that part of code inside the release version of the executable. Erasing it all before releasing is tedious and you may leave some behind. By using the preprocessor directives, you can produce a bulky slow, debugging version by defining the _DEBUG flag, and produce a smaller faster release version by not defining the _DEBUG flag. You do not have to make any changes to the code, since the compiler can be directed to define the flags by the command line and usually it is done by the makefile.

For Visual C++ it is /D_DEBUG . For gcc, lookup the compiler manual under preprocessor directives. cl /D_DEBUG Trace.cpp will compile and link the Trace.cpp file with the _DEBUG flag defined. cl Trace.cpp will not define the _DEBUG flag.

Easy.

WolfPack 491 Posting Virtuoso Team Colleague

Rather impractical smilie I'd say. Winking and sticking your tongue out at the same time is not exactly the easiest thing to do..

WolfPack 491 Posting Virtuoso Team Colleague

Create a Text Editor Application.

WolfPack 491 Posting Virtuoso Team Colleague

I think RSA means Republic of South Africa.

WolfPack 491 Posting Virtuoso Team Colleague

I knew a little bit about India back during the days I courted Aishwarya. So I know what Punjabi and Punjab is.

WolfPack 491 Posting Virtuoso Team Colleague

Go through this and this. Try hanging around the Daniweb C++ forum and answering some of the problems.

WolfPack 491 Posting Virtuoso Team Colleague

> How many languages do you know fluently, Sanjay?
Hindi (our national language), English, Marathi and my native language. So four in all. :)

What is your native language?

WolfPack 491 Posting Virtuoso Team Colleague

I like it. Best feature in Daniweb so far, after Dani that is. :D

WolfPack 491 Posting Virtuoso Team Colleague

Nurses always seem to be hot over here for some reason. It's a phenomenon I've observed over my lifetime.

I bet it has something to do with their uniforms. A girl who doesn't look good in a nurse's uniform is beyond help.

Aia commented: Ha,ha,ha. +4
WolfPack 491 Posting Virtuoso Team Colleague
WolfPack 491 Posting Virtuoso Team Colleague

I had the stroke last year and I healed.
when I got a serious case of pneumonia and valley fever in march ,,, I got a bunch of compllications .. liver, kidney and lung problems. I gotta go to alot of labs and see alot of specialists .. and that takes a chunk of my time ..almost like a full time job.
Because I'm on heavy duty meds and I'm just building up my body so I can be normal again. I'm on oxygen therapy, dizzy and nauseted alot of times.

Duh. You must be like a walking hospital. Get well soon.

WolfPack 491 Posting Virtuoso Team Colleague

Check the C++ Books Readme.

WolfPack 491 Posting Virtuoso Team Colleague

You will have to do some console handling for that. At first glance the procedure will be something like below.

Press a key
  Look what the key is
  If another key is pressed within the given time limit
        If it was the same as the previous one
                  Erase first character and update buffer with the next one
        else 
                   Update buffer with the pressed key 
    Else
         Update the buffer with the pressed key

There is no portable way of getting it done, unless you do some serious console scrolling. So you may have to use either a 3rd party library or the API of the operating system you are using.

WolfPack 491 Posting Virtuoso Team Colleague

What hardware are you supposed to use?

WolfPack 491 Posting Virtuoso Team Colleague

First debug it part by part and localize the error. Without knowing what is expected for the output, we are not in the position to debug all that long code. So you will be better off doing it yourself.

You should have compiled and tested it part by part in the first place, while writing that code. Compiling once after writing all that code, and then dumping the code into a IT forum is not the way to be a programmer.

Salem commented: Damn straight on the code "dumping" +7
WolfPack 491 Posting Virtuoso Team Colleague

canadian people hate being called american.

Aren't they american?

WolfPack 491 Posting Virtuoso Team Colleague

For books I would recommend Charles Petzold's .

WolfPack 491 Posting Virtuoso Team Colleague

They are helped, and they give positive rep, but It doesn't count for anything.

Who says they don't count for anything? The people who helped them don't care about the color of the dot. They will care about the gratitude of the OP, and the positive comments they leave. If I remember correctly, the first reputation I recieved was also gray, but it had a very good positive comment on the lines of "Helping the OP without giving any code", i.e. showing the way. Man didn't that feel good. If a moderator or someone with higher reputation power that frequents that forum thinks it fit, they will hand out reputation for that particular helpful post, and it will increase the reputation count. I think that was Dani's philosophy in making the whole reputation handling business public. Other people can judge the post by looking at the reputation received for that post, and by whom it was given. And if they too find it helpful, they will handout some reputation too.

I think I said in a previous post, I count a single grey reputation from a newbie that I help worth more than the 200 or more points I received during the past few months in the geeks lounge.

Dani commented: You're right about my philosophy +10
Aia commented: Mine is not grey, but I hope it will count for you. +2
WolfPack 491 Posting Virtuoso Team Colleague

Unless you want boiled meat balls for dinner I suppose.

arjunsasidharan commented: hee hee.. :D +3