|
Yes it can be refreshed correctly.
Probably you mean redraw, not refresh. Anyway, it's the programmer's job to handle WM_ACTIVATE, WM_SETFOCUS etc.
Could be a SetRedraw with FALSE without a SetRedraw with TRUE?
|
|
|
|
|
yes, i mean that the List Control disappeared.
when the main dialog being restored, i add some code:
<br />
CDialog::OnSysCommand(nID, lParam);<br />
if (SC_RESTORE == (nID & 0xFFF0) && hRefresh)
::RedrawWindow(hRefresh, 0, 0, RDW_FRAME | RDW_INVALIDATE);<br />
now, program is solved, but i want to know why.
|
|
|
|
|
Check with spy++ the list size and visibility while the main dialog is minimized.
|
|
|
|
|
If you use of RedrawWindow what happens
|
|
|
|
|
It's a MFC bug, I think.
first, I should say "List Control remains not refreshing" means "List Control disappeared".
I'm sorry to my poor english!
In order to produce the problem, the main dialog must has a tab control(Last time, I forgot to explain), and the modelless dialog must covers total or part of the tab control.
I can solve the problem(use RedrawWindow to force the List Control Repaint when main dialog be restored),but I want to know why.
will you please have a try, and I'm sure you'll get the problem.
|
|
|
|
|
This is not an MFC bug. Listbox controls have nothing to do with MFC.
|
|
|
|
|
hello all:
i want to use the 'avi/wav file source filter' in my filtergraph,but the method AddSourceFilter(...) by graphbuilder add the filter 'file source filter' in the filterchain,how can i change that,and to configure the filepath for my 'avi/wav file source filter'.
sorry for my poor english
thanks in advance
henry
|
|
|
|
|
What part is giving you trouble?
File Source (Async) Filter
CLSID = CLSID_AsyncReader
Category = CLSID_LegacyAmFilterCategory
File Source (URL) Filter
CLSID = CLSID_URLReader
Category = CLSID_LegacyAmFilterCategory
If you've added the file source filter then use its IFileSourceFilter interface's Load() method
to get the filter to load the file.
|
|
|
|
|
hi this is ramesh .
i am writing a small win32 appl..i am using hierarchical stucture of check boxes in it(Tree view)
the functionality i badly needed is if i select a root item the child checkboxes should also get selected. could u help me to solve this problem??
if u have any example applications could u send me??
my mail id is sramesh21@gmail.com .
thanks in advance.
regards,
ramesh s
ramesh s
|
|
|
|
|
ramesh_s21 wrote: how to select the all the child checkboxes when a root is selected/clicked
You would be getting an event on the click of the root item.
Then get the children of the root and set them as checked using SetCheck...
I do think that you would be able to iterate through the child check boxes when the user clicks on the root.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
1. Implement notifications (NM_CLICK, TVN_KEYDOWN) to be notified when the user changes a root node checkbox state.
2. Implement and manage the LPARAM of inserted TVITEMs in tree to can retrieve HTREEITEM from LPARAM.
3. Use TreeView_SortChildrenCB macro, called when you need to also check all child items; the compare function will return 0 and will just modify the item state. Callback sort function will receive the lParam1 and lParam2 and will locate the HTREEITEMs from these (see 2). Finally, you set the nodes' checked state for both.
|
|
|
|
|
thanks cristian amarie.
could u plz get me sample code for tree view control with check boxes,if u have any?
thanks in advance.
regards,
ramesh s
ramesh s
|
|
|
|
|
I don't have one now, but for sure there are a number in MSDN samples and Platform SDK (try the older ones if you can spot some copies - the newer MSDN/PSDK seems to be more .NET oriented than API oriented).
CP also may have tree view samples as well.
I remember a sample containing almost all common controls, showing messages, notifications etc. - I don't remember the name now, was something with the solar system's planets in a listview. Check in MSDN, it won't be too hard to locate it and contains almost all you need to know. And more.
|
|
|
|
|
Hi all,
I am trying to make a chat server and client, for which I am inheriting the MFC CAsyncSocket. But the class member called Connect() is not properly responding. It shuld return nonzero value when connection succeeds and 0 if fails.But, it always returns zero,even when the connection succeeds.If the server is not listening, then also connection succeeds, but GetSockName() gives IpAddress=0.0.0.0, not the one which we specify for connecting. If server is listening, then the Ip Address which GetSockName() gives is correct.
I even tried with GetLastError() but it always returns a value 10035 even if the server is listening or not.
Please help me by providing a way to identify whether connection is success or failure..
thanks in advance...
SYAMLAL
|
|
|
|
|
SyamlalS wrote: it always returns zero,even when the connection succeeds
It returns 0 means , connection is not succesful. How you know that it is succesful ?
SyamlalS wrote: If the server is not listening, then also connection succeeds,
How you are deciding it, as 0 return value is for failure.
SyamlalS wrote: but it always returns a value 10035 even if the server is listening or not.
error code 10035 can be read as "A non-blocking socket operation could not be completed immediately."
|
|
|
|
|
hi prasad,
sorry for the delay in sending this reply
It returns 0 means , connection is not succesful. How you know that it is succesful ?
the connection becomes successful when the server is listening( return value is 0 ), I can identify this, since the data send from server side(after connecting) reaches at client and vice versa.
How you are deciding it, as 0 return value is for failure.
Even if the server is not listening, it connects, I identified this since the OnConnect() which I have overrided gets invoked.
error code 10035 can be read as "A non-blocking socket operation could not be completed immediately."
That means the non blocking connection is possible, but it will take time
Am I right??
SYAMLAL
|
|
|
|
|
SyamlalS wrote: the connection becomes successful when the server is listening( return value is 0 ),
But as connect is returning 0, its failing.
SyamlalS wrote: Even if the server is not listening, it connects, I identified this since the OnConnect() which I have overrided gets invoked.
It will get called, for every connect called, but important thing is it should succeed. Which is not, in you case, I guess.
SyamlalS wrote: That means the non blocking connection is possible, but it will take time
No.
|
|
|
|
|
status= connect(this->m_Socket,(sockaddr *)m_TargetSystem,sizeof m_TargetSystem));
if(status==SOCKET_ERROR)
{
int Error= this->GetPrevError();
}
else
{
// Your socket got connected...
}
haribabu
(impossible to understand)
|
|
|
|
|
if (!MyAsyncSocket.Connect(...))
{
int SockError = GetLastError();
if (SockError == WSAEWOULDBLOCK)
{
}
else
{
}
}
Call GetSockName() in OnConnect() if successful. Since you are getting WSAEWOULDBLOCK error
then the socket is not yet connected right after the call to Connect().
|
|
|
|
|
Hi All,
OpenFileMapping Fails with GetLastError() error code 2, i.e. ERROR_FILE_NOT_FOUND .
The problem is not frequent. It only occurs after few days of product being in production...Any help on this will be highly appreciated.
Thanks
Suraj Gupta
|
|
|
|
|
Gupta Suraj wrote: Fails with GetLastError() error code 2, i.e. ERROR_FILE_NOT_FOUND.
Problem may not be with this function. As error suggests , its not getting mapping object. Which may not be created in first place.
Like , CreateFileMapping may have failed already.
|
|
|
|
|
Thanks for reply!
Yes, this could be one of the possibilities. I m working in that direction. Their is another direction to this, i.e. Can the error returned by OpenFileMapping can be misleading?
Suraj Gupta
|
|
|
|
|
Gupta Suraj wrote: .e. Can the error returned by OpenFileMapping can be misleading?
Very unlikely. This API is there for such a long period. Could have caught any such failure already(and fixed).
In short, very unlikely.
|
|
|
|
|
Hi,
I hv made an application using win32, heavy graphics r involved in my project...im facing difficulty displaying the dialog box n msg box..since it is not getin displayed on the leftmouse event at the first time..i-e i want that when i click the leftmouse button at some specific event a dialogbox shud appear...but when i click the mouse button dialogbox aint getin appeared as it goes at the back of my application..may b coz os aint givin it the control, n i hv to go to taskmanager n enable the dialogbox....so if some1 can find a cure for for this ill b extremely thankful....or tel me an alterante to get the user input..
Thnx
|
|
|
|
|
Can you show code ?
ooolz wrote: ...but when i click the mouse button dialogbox aint getin appeared as it goes at the back of my application
Does SetWindowPos help ?
|
|
|
|