|
i can use CListBox, from scratch is not required
thanx in advance
kumar_windows
|
|
|
|
|
kumar_windows wrote: i need to implement a list box which supports selection of multiple items in the list at a time, instead of a single item, also i should be able to select the items in the listbox by using ctrl+click or shift+click windows functionality. how can i do this??
This is the default behavior.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All,
I have a structure that contains a list of function delegates. Each of the delegates do something different. Depending on how the parent class is initialised, depends on which of delegates is populated.
Now the question is, can I overload the '->' operator, so that the calling code can call one of the delegates in the structure by calling the same name.
e.g.
class X { struct y { fastdelegate someMemberDelegateOfY; ... } ... }
{
X myX;
myX->someMemberDelegateOfY (parameters,for,delegate,in,struct,y);
}
Then when the code executes, it will call the delegate in the structure.
Is this possible, and if so how?
thanks,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
function pointer correct as is
X x
(x.*p)()
Kuphryn
|
|
|
|
|
RichardS wrote: Is this possible, and if so how?
Yes.
class X
{
public:
int getInt() { return 0; }
};
class Y
{
public:
X* operator->() { return &_x; }
private:
X _x;
};
int main()
{
Y y;
return y->getInt();
}
The restriction on overloading -> is that it must return a pointer of some kind.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Thanks, works great
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
( on vs.net 2003 )
I have a window hierarchy that eventually contains an html browser ( IWebBrowser2 ) in a controlbar ( a COXSizeControlBar from Dundas ).
COXSizeControlBar
- a child dialog
- 2 buttons
- Browser window ( Gary R. Wheeler's SimpleBrowser, from CP )
When I show the COXSizeControlBar ( with ShowControlBar ), the Browser window is not redrawn ( but the other controls are drawn properly ), but there's a flicker where I can see the HTML, but it's immediatly erase.
On MSDN ( I can find it on my local copy, but not on the msdn site ), there is an article regarding painting problems when using the CHTMLView, the solution is to add WS_CLIPCHILDREN to the derived CView. They write that this should be fixed in vs.net.
I'm not certain how and/or to fix this.
I think it's related to the WS_CLIPCHILDREN flag, but, I admit it, I never really understood how that flag ( and the WS_CLIPSIBLING ) works.
Is there a tutorial somewhere that really explain what those 2 flags do ( other then re-phrasing what MSDN write ) ?
Any ideas ?
Thanks.
|
|
|
|
|
Hi there,
Can anyone tell me what is the time out for a TCP socket connection if there is no activity? I have a socket connection to a server that for no reason we loose the connection and I sometimes we reconnect automaticaly and sometimes it does not reconnect for a long period of time (10 minutes or so). I appreciate any suggestions.
Nahitan
|
|
|
|
|
nahitan wrote: Can anyone tell me what is the time out for a TCP socket connection if there is no activity? I have a socket connection to a server that for no reason we loose the connection and I sometimes we reconnect automaticaly and sometimes it does not reconnect for a long period of time (10 minutes or so). I appreciate any suggestions.
Have you run a network sniffer on the line to trace whats happening on the network? I would suspect a switch or router is dropping the connection (if everything runs just fine while under load). WinPcap works well and there are a number of UI interfaces for it.
Or add a simple I'm alive broadcast everyonce and a while, doent need to be a big message just something to keep the pipe open.
-- modified at 3:12 Wednesday 23rd August, 2006
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
void ObjectRoot::runUpdateHandlers(
ObjectRootPtr obj,
const RTI::AttributeHandleValuePairSet& theAttributes )
{
if (obj)
{
for (unsigned int i=0; i < ObjectRoot::ms_numUpdateHandlers; i++)
{
if (ObjectRoot::ms_updateHandlers[i])
{
(*ms_updateHandlers[i])(obj, theAttributes); }
}
}
}
I don't understand what the code highlighted in brown does.......
I am a beginner... please help me out
Thanks
|
|
|
|
|
ms_updateHandlers is a function pointer array, e.g. an array of pointers that point on functions.
(*ms_updateHandlers[i]) points on function number i in the array.
(obj, theAttributes) are the parameters of the function.
So (*ms_updateHandlers[i])(obj, theAttributes); is a function call of function number i in the ms_updateHandlers array, with parameters obj and the Attributes.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Hey Rage,
thanks for the reply
What if you had a situation where you had two functions of the same parameters
(obj, theAttributes). How does the pointer know which function to point to?
Rage wrote: (*ms_updateHandlers[i]) points on function number i in the array.
I thought ms_updateHandlers is an array of pointers therefore i is a pointer number
Thanks
|
|
|
|
|
|
|
We want to display help files(.chm format) using HTMLHelp API in a particular format.
HH_KEYWORD_LOOKUP command is used with HtmlHelp API to search for one or more Keywords
in a compiled HTML Help (.chm) File and display it in a "Topics Found" window.
We have some issues with using the HH_KEYWORD_LOOKUP command.
1)When we invoke "Topics Found" window using HH_KEYWORD_LOOKUP command, the parent window from which the "Topics Found" window was invoked doesn't get re-drawn. When you drag the "Topics Found" Window over Parent Window, all the display of the parent window gets erased and is not redrawn. But when we invoke "Topics Found" window from HTMLHelp(chm) Window , the parent window gets re-drawn.
2)When we invoke "Topics Found" window, and move the cursor out-side of the "Topics Found" window ,we get a wait cursor.
We tried with all options in HWND hwndCaller by passing Parent Window Handle,Desktop and NULL.- all with similar results ( as mentioned above)
NB: We need to display HTMLHelp Window only after selecting from "Topics Found" Window.
Otherwise please provide us any alternative solution.
Thanks In Regards
shaffiq Ahamed
|
|
|
|
|
It sounds like your app's message queue is not getting pumped. Before calling the HTMLHelp API, start a timer with something like SetTimer(1, 100, NULL); . Or an alternative would be to call the HTMLHelp API from a non-GUI thread.
It's strange that it behaves this way. I suggest you try to reproduce this in a small app before you go to a lot of trouble. Your help file might be trashed.
|
|
|
|
|
I tried in small application.Behaviour is same.This does not happens when you use Winhelp API with command HELP_KEY for hlp files.It behaves strange for
HTMLHELP.
|
|
|
|
|
Hi everybody,
I have a list control in my dialog, in which I display a numbr of items. The program can toggle between two states: one where only recent items are shown and one where also history is shown. In the latter case, I want to show icons in front of each row, indicating whether an item is recent or not. In itself, this all works: I add a CImageCtrl to the listbox, with the relevant icons. When the program switches back to only recent items, I do not want to show the icons anymore, so I remove the CImageList using CListCtrl::SetImageList (NULL, 0); In itself this works: no icons are shown anymore. However, the item in the first column is now still moved to the right to make room for a possible icon. How do I tell the CListCtrl that also the text in the first column must be displayed at the most left-hand side, rather than moving the items to the right?
Please help!!
Thanks in advance,
William
|
|
|
|
|
Engberts wrote: When the program switches back to only recent items...
How are you adding items at this point?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I Clear all the items (using DeleteAllItems), delete all the columns (using
n = GetHeaderCtrl()->GetItemCount();
while (n-- > 0)
DeleteColumn (0)
Then I clear the image list (using SetImageList (NULL, 0). Then I re-create all the columns (I do this, because I use a separate empty column for the icon, which is either or not included when re-creating the columns depending on whether or not I want to show icons) and then I add the new set of items (using InsertItem for the first columns and SetItem for subsequent columns of the same row)
William
|
|
|
|
|
But what code do you have in place for adding items to the control? Is it in any way referencing an image (or image list)?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am using a derived class "CListCtrlEx", which has the following code for adding a row:
BOOL CListCtrlEx::AddLine(char *Elements, UINT Id, int iImage)
{
LVITEM Item;
register int i = 0;
register int j = 0;
int subItem = 0;
int r = 1;
int k = 0;
char szItem[256];
memset (&Item, '\0', sizeof (LVITEM));
Item.mask = LVIF_TEXT|LVIF_PARAM;
Item.iItem = m_ItemId++;
Item.lParam = Id;
while (r && Elements[k] != '\0')
{
j = k;
i = 0;
while (Elements[j] != '\0'&&
Elements[j] != '\t')
{
if (i < 250)
szItem[i++] = Elements[j];
j++;
}
szItem[i] = '\0';
Item.iSubItem = subItem++;
Item.pszText = &szItem[0];
if (k == 0)
{
if (iImage != -1)
{
Item.iImage = iImage;
Item.mask |= LVIF_IMAGE;
}
if (InsertItem (&Item) == -1)
r = 0;
else
r = 1;
}
else if ((r = SetItem (&Item)) != 0)
r = 1;
if (Elements[k=j] == '\t')
k++;
Item.mask = LVIF_TEXT;
}
return r;
}
I present this routinew with a character array in which the elements (columns) are separated by tabs. As you can see, the routine only adds an image when the parameter "iImage" does not equal -1, which it does when I populate the contgrol with only recent items where I do not want to see icons. Again: The icons do not show, but the space for the icons remains reserved, which leads to the situation that, on first appearance, the left elements are completely left aligned, but after showing the history items, they always show shifted to the right.
William
|
|
|
|
|
Normaly in our programme ,we always call the system "MessageBox",and it is very easy ,but now in my programme ,i want to make one MessageBox by myself to replace system MessageBox ,and if my programme is running ,if other application call the system "MessageBox" ,i want other application also use my "MessageBox",i hope someone help me ,here thanks first!!1
I am an automation enginer ,and i like vc++ ,becaus she help too much
|
|
|
|
|
I doubt this is possible. Maybe with a global hook, you could intercept the message to fire up your message box, but I doubt you can dismiss the Messagebox called by another applicaton. Why would you like to do this ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Glad to see you replay,i am an automation engineer ,in my work,i use siemens software "wincc",in the software ,i call system "MessageBox",only because it can return "IDYES","IDNO" ...Value,but i don't like it stytle,so i want to make another "MessageBox" to replace but he must can return some value
|
|
|
|
|