|
I have used that one but how can i notify my buttons run time from my list. that the list view is
now empty.
|
|
|
|
|
Do you want if list is empty then buttons diable
|
|
|
|
|
|
You can calculate count of items on the list and if result is 0 then disable buttons
|
|
|
|
|
that's ok but which window and which message i have to use to disable the window.
on listview's containg window.(listview notify message )
or the other window which contain three buttons.(or in WM_COMMAND) where ????
guide me where should i put my code for disable the buttons?
|
|
|
|
|
You can use of WM_ENABLE or EnableWindow for enable or disbale
ListView_GetItemCount or LVM_GETITEMCOUNT for get number of items on a list view And I think when you start your program buttons must disable because listview doesnt have any items and when you insert a item you can enable buttons and when you use of LVM_DELETEITEM or ListView_DeleteItem you can check if count is 0 disable buttons.
|
|
|
|
|
You don't notify the buttons of anything, you just enable/disable them as you deem necessary.
|
|
|
|
|
I'm a newbi. And I'm learnning Visual C++. I have a problem about my Application, I want to use a API function "PostMessage" to send a message window to an Online Game such as "Hero Online".
I write a DLL, and use funtion API "PostMessage" to control text is succesful, but I'm do on Game progamer not to do.
Please! help me
wqweq
|
|
|
|
|
‘PostMessage’ is one of the means by which you send messages (instructions) to different windows in the Windows OS and is not a means to send messages over the internet.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
|
|
|
Thanks!
I'm write a DLL hook and send a message to a application Game a message keyboard. I want application Game to action.
wqweq
|
|
|
|
|
hi is there any funcion to create radio button from program (like (CLabel*)Label->create())
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: hi is there any funcion to create radio button from program
Use style BS_RADIOBUTTON while creating button.
CButton button;
button.Create(_T("Radio button"), WS_CHILD|WS_VISIBLE|BS_RADIOBUTTON,
CRect(10,40,100,70), pParentWnd, 1);
|
|
|
|
|
how to specify the loactaion of radio button. i have to create it in my own locaiton
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Use of MoveWindow or SetWindowPos
|
|
|
|
|
deeps_cute wrote: how to specify the loactaion of radio button.
Have you seen Create API? RECT parameter is for that purpose only.
|
|
|
|
|
I read this article about calling conventions:
http://www.codeproject.com/cpp/calling_conventios_demystified.asp
Something is not clear for me:
1-) I see that function overloading is only possible with thiscall. Right? Is this true?
"Thiscall is the default calling convention for calling member functions of C++ classes"
I can set Visual C++ Compiler Options with /Gd, /Gr, /Gz (Calling Convention) . __cdecl, __fastcall, or __stdcall .
2-) But this doesnt affect C++ member class functions calling convention type, i mean thiscall. They are always thiscall. Right?
3-) In win32 programming i see all of functions declare with stdcall. So beacuse of that win32api is not object oriented. I mean can not use function overloading. But why didnt they design win32api with thiscall?
Can you please verify my conclusions. Am i wrong or right?
Thank you.
|
|
|
|
|
sawerr wrote: Am i wrong or right?
Yes. C (stdcall) versus C++ (thiscall), they are not the same.
led mike
|
|
|
|
|
sawerr wrote: But why didnt they design win32api with thiscall?
That would have been sweet for us C++ programmers, and .NET is a BIG step that direction, but I
imagine since the OS APIs need to be callable from any language (including non-OOP ones) they had
to use a common calling convention.
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
"thiscall" is not a keyword, it means "the function has this as its first parameter even though it's not written that way". A member function can be __stdcall - when you write an implementation of a COM interface in C++, the methods are __stdcall (it's hidden in the STDMETHODIMP macro).
Function overloading is done by the compiler giving each overload different internal names. This is unrelated to calling conventions.
Most Win32 APIs use __stdcall (or as it was originally called, PASCAL ). Only a few like wsprintf() use __cdecl . APIs can't be overloaded because that would break compat with Pascal and C and other languages that don't know about overloading or mangled names.
|
|
|
|
|
Thanks for all answers.
Micheal Dunn you told me:
"Function overloading is done by the compiler giving each overload different internal names. This is unrelated to calling conventions."
Yes i tried a piece of code
#include <iostream><br />
using namespace std;<br />
<br />
class CRectangle {<br />
int x, y;<br />
public:<br />
void set_values (int,int);<br />
int _stdcall area () {return (x*y);}<br />
int _stdcall area (int x ) {cout << x; return 0;}<br />
};<br />
<br />
void CRectangle::set_values (int a, int b) {<br />
x = a;<br />
y = b;<br />
}<br />
<br />
int main () {<br />
CRectangle rect;<br />
rect.set_values (3,4);<br />
cout << "area: " << rect.area();<br />
rect.area(8);<br />
return 0;<br />
}
It works. I tried both _stdcall and _cdecl there is no problem.
But i dont understand here. Why do they write:
"For C calling convention (__cdecl): Function name is decorated by prefixing it with an underscore character '_' .
For Standard calling convention (__stdcall): Function name is decorated by prepending an underscore character and appending a '@' character and the number of bytes of stack space required."
For cdecl Compiler generate function name for area():
?area@CRectangle@@QAAHXZ
?area@CRectangle@@QAAHH@Z
So function name decoration information is not true for member functions. Because function names both 2 area func must be "_area". Right?
If function overloading is done by compiler why is there a specification for calling conventions? Why is there an information about function name decoration? VC++ doesnt obey this rule.
Can you please explain here please.
Thanks for answers
|
|
|
|
|
The calling convention determines how the parameters are put on and cleaned off the stack. Overloading is done strictly by generating unique mangled names (that's what the funky-looking ?area@CRectangle... names are). The name decorating rules you quoted hold true for exported and non-overloaded functions. As soon as you introduce overloading, you get the long mangled names.
|
|
|
|
|
I need to implement a window that is suitable for things like a combo box's dropdown window, or a menu.
- I want it to popup (be top most) with out recv'ing focus.
- I want it to ignore mouse activates
- I want it to be closed when a WM_LBUTTONUP is recv'd by the window, OR a WM_LBUTTONDOWN happens on ANY other window.
I have items 1 and 2 working fine. However I'm not sure of the best way to implement the third one. Is installing a windows hook the best way? If so, which hook type do I want? There is a specific mouse hook type, but it doesn't look your call back gets enough info - i.e. you can't tell if it's a mouse down, etc.
|
|
|
|