|
|
in the header file it says,
<br />
typedef UINT WPARAM;<br />
typedef LONG LPARAM;<br />
typedef LONG LRESULT;
so WPARAM can be anything as long as you dont want to pass a negative values,
LPARAM can take negative values,
Also both are used for polymorphic values, so anything from number of trees to pointers can go there
I generally use LPARAM for pointers only.
-Prakash
|
|
|
|
|
The guideline is indeed tied to the event. That's the point, a generate purpose param that can hold whatever the event wants to pass.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
HWND is a handle, so you dont know what value it would hold, so i would put that on LPARAM.
-Prakash
|
|
|
|
|
I am not sure if this still hold true, maybe someone else knows, but the WPARAM used to get trunated to the lower 16 bits when it passed through some message filters. Therefore, I am careful, still, to only pass 16-bit or less values in WPARAM. LPARAM never had any such issues.
|
|
|
|
|
Blake Miller wrote: but the WPARAM used to get trunated to the lower 16 bits when it passed through some message filters
Can you suggest message filters. I would like to know.
So in your opinion what should I do for consistency sake. A few guidelines from you would be helpful.
Or maybe what do you do normally.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I am not sure which message filters would truncate WPARAM to 16 bits. However, that is WHY it was originally called WPARAM - because it was limited to being a WORD (16-bits).
I limit WPARAM in my work to 16 bits. I use LPARAM full 32 bits.
Usually I do not try to pass pointers or much data through the messages. I pass messages as notifications only between 'subsystems' and rely upon data retrieval function calls to be made to collect the data itself. Some programmers rely upon SendMessage to pass pointers to data via the message queue between subsystems, but that ends up being more trouble to synchyronize with the sending and receiving windows' other activities and other events occuring in a multithreaded envionment. Sure I guess it works okay if the application has a signle thread, but that is not the type of code I am typically writing anyway.
|
|
|
|
|
Hello there,
I am relativly new to C++ and am currently programming for windows in Visual C++. What I want to know is this:
I created a program in which a user enters commands and these commands are compared to functions stored in a seperate .cpp file. This file is in the same folder as the executable but is not part of the solution. Is there a way for the user to enter a command such as 'update' and the program will seek an updated version of the command file and download it from a specified server? i can get everything to work, but I do not know even where to begin will this update feature.
ALL YOUR BASE ARE BELONG TO MICROSOFT!
Demonware Studios Leader
|
|
|
|
|
Do some form of HHTP reuest against your server to see if a 'newer' file exists. Then download the new file as 'text' so it can pass through HTTP and the firewall, then replace your old command file with the new one.
|
|
|
|
|
Thank you
ALL YOUR BASE ARE BELONG TO MICROSOFT!
Demonware Studios Leader
|
|
|
|
|
I'm working on a CEdit derived class that requires that I put a bit of text in the window on creation. I'm doing this in PreSubclassWindow, which may or not be the right place for it but it works. The problem I'm running into is the cursor positioning. If I use SetSel(0,0) in PreSubclassWindow the text ends up being completely highlighted. For the moment I've included a SetSel in the SetFocus handler. But this isn't practical long term. Without any attempt at setting the position selector I still get a completely highlighted edit space.
Where would be the best place to set the original position?
Thanks,
Lilith
|
|
|
|
|
|
Could you please give me some idea on the best C++ compiler available for an Windows XP Pro system? I'd like to do some simple tasks that might include graphics. Are there free compilers that I should try? Thank you.
|
|
|
|
|
Please post this in the Lounge[^] You will get more replies. This is the visual c++ forum.
Aljechin Alexander
|
|
|
|
|
|
I'm sorry to contradict you but I found that Dev-cpp is plain crap (to be polite ). It has too many bugs, it is slow, the debugger is totally unusable, the tabulations management (when you go to a new line) makes you loose more time than it makes you gain, the IntelliSense is slow and makes your program 'hang' during the time it searches for the class members, ...
Compared to Visual Studio, there is just simply no comparison possible. It is a completely different product.
-- modified at 3:45 Thursday 19th January, 2006
PS: this is not to take as an 'aggressive' post . I'm just describing my own experience with Dev-cpp
|
|
|
|
|
Yeah you are right. But he asked for free compilers to try out. There is no comparison with VS.
Cedric Moonen wrote: I'm sorry to contradict
Feel free. That's what we are here for. To kick and to get kicked.
Cedric Moonen wrote: PS: this is not to take as an 'aggressive' post . I'm just describing my own experience with Dev-cpp
My experience was much better.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
The best is undoubtedly VC++2005, it will let you do GDI, GDI+, DirectX, and WPF in the not too distant future.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
this is a Visual C++ forum buddy, which means that almost here is using VC6, VC2002/2003 and/or VC2005...
if you're looking for something free, then don't ask this here. may the lounge help you, otherwise search for another site which is not dedicated to Microsoft technology
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
VC2005 Express is actually free
|
|
|
|
|
I think VC IDE framework is pretty cool. I want to implement my project appearance like it. Dockable project window, debug output and so on... Is there anybody give me clue how to implement it?
Richard Luo
|
|
|
|
|
|
Try using the CSplitterWnd class
that will help u in developing such a project.
But u dont get anything readymade , u need to
put up ur own code for ur ideas.
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
I have an MDI application which works with a database. A new CDialog was added to the MDI, and now i want to make some calls to the database. There is a Callback mechanism already implemented in the app, which i will be using for recieving values back from database. I prefer to start a new thread, which will be independent of the main GUI thread to pass on values to the database. Can anyone tell me how can i create a new thread inside my CDialog to make calls to database?
Another thing i wanted to know is, how to use WaitForSingleObject, i would like to wait in the thread till i get the response back from database and then to update it in the CDialog. I would appreciate if you could tell me how to use WaitForSingleObject?
|
|
|
|