|
tmcart wrote: #define LB_SETCOUNT 0x1A7
Why are you redefining this?
tmcart wrote: result = m_listbox.SendMessage(LB_SETCOUNT, (WPARAM)(int)5000, (LPARAM)0);
The LB_SETCOUNT message sets the number of items that the control will ultimately contain.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
DavidCrow wrote: tmcart wrote:
#define LB_SETCOUNT 0x1A7
Why are you redefining this?
I am needing to define the LB_SETCOUNT as it isn't defined in 'windows mobile 6 sdk\pocketpc\include\armv4i\winuser.h' so I found the correct hex message code via google.
DavidCrow wrote:
tmcart wrote:
result = m_listbox.SendMessage(LB_SETCOUNT, (WPARAM)(int)5000, (LPARAM)0);
The LB_SETCOUNT message sets the number of items that the control will ultimately contain.
I'm not sure what you are getting at with your emphasis here?
What I was hoping from the LB_SETCOUNT is that would tell the CListBox it has 5000 virtual items. Thus when the CListBox 's DrawItem() gets called the scroll bars and itemID range is based around having 5000 items.
CString CTestDialog::GetDataAt(size_t index)
{
return m_data[index];
}
void CVListBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
RECT r(lpDrawItemStruct->rcItem);
CTestDialog *pDlg = (CTestDialog *)GetParent();
CString text = L"<Default>";
RECT focus(r);
ASSERT(pDC);
if (!pDC) return;
if ((int)lpDrawItemStruct->itemID < 0)
{
if (lpDrawItemStruct->itemAction & ODA_FOCUS)
{
pDC->DrawFocusRect(&focus);
pDC->Detach();
}
return;
}
text = pDlg->GetDataAt(lpDrawItemStruct->itemID);
pDC->DrawText(text,
text.GetLength(),
&r,
DT_LEFT | DT_SINGLELINE | DT_VCENTER);
pDC->Detach();
}
modified on Thursday, August 27, 2009 5:42 AM
|
|
|
|
|
Got a response back from Microsoft on this.
Owner data CListBox isn't supported on CE, their advice was to use CListView.
|
|
|
|
|
Hi All,
I am developing a chat server.
I need to limit the number of connections from a client.
Is there any API / Sample code available?
Thanks,
Veandhan
modified on Wednesday, August 26, 2009 12:08 PM
|
|
|
|
|
Are you joking?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It looks like he's modified the query. What was it initially?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Basically the same, except it was in the context of MFC.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Oh, MFC limiting the inbound connections?! At times, these forums are a fun thing.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
It was something like: "I need to know if the Higgs' particle really exists. Does MFC provide an API for ?"
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
In Mumbai, we use the CHiggsParticlesEx * class for that purpose.
*MFC 18.3 and a time-travel machine in good working condition may be required.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: In Mumbai, we use the CHiggsParticlesEx* class for that purpose.
You're lucky. The Cern Library 2008 we've (a beta release), is broken here and there, the namespaces being soooo polluted: FindTheDamnedHiggs function, for instance, had collision troubles.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Do you know what MFC is? Why would it care about such a specific thing?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Veandhan wrote: I am developing a chat server.
I need to limit the number of connections from a client.
Immediately after you accept a connection, find out the IP address of the other machine and disconnect it if it is already connected.
Veandhan wrote: Is there any API / Sample code available?
Chat Server sample from MSDN[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks Rajesh....
I have seen that link......
Basically i need a program which is independent one (not belongs to my server application) that should drop the incoming messages before it reaches my server application.
Is it possible?
Thanks,
Veandhan
modified on Wednesday, August 26, 2009 10:31 PM
|
|
|
|
|
I do not understand the need for such a thing. Ideally, the server itself must be doing this.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
The thing is i just want to restrict the number of connections from a IP without server's help. My application should sit between the port and the server application. As for as i know, there is some windows driver level functions are there to do this. But i am not able to find out.
|
|
|
|
|
Veandhan wrote: The thing is i just want to restrict the number of connections from a IP without server's help. My application should sit between the port and the server application.
That's even more confusing. Do you need to write a firewall?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
yes. Kind of firewall only i need. But it should allow only 5 connections from a client and deny the connection request if it exceeds 5 connections.
|
|
|
|
|
Veandhan wrote: yes. Kind of firewall only i need. But it should allow only 5 connections from a client and deny the connection request if it exceeds 5 connections.
Limiting connections and building up rules are not going to be difficult for you. Writing the firewall is what is more difficult and I do not think that this is a question that can be answered in forum posts such as this.
Take a look at the following open source firewall projects, which might be of help to you:
http://sourceforge.net/projects/firewallpapi/[^]
http://sourceforge.net/projects/tdifw/[^]
http://wipfw.sourceforge.net/index.html[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
ya... you are correct. Writing firewall is difficult and building up rules are not difficult.
Those open source firewalls drops entire packet from a given ip but what i need is to allow 5 sessions from a IP and deny after that.
|
|
|
|
|
Veandhan wrote: but what i need is to allow 5 sessions from a IP and deny after that.
Well you need it, so you build it. I've given you links to open source projects, so go ahead and modify any of those to suit your requirements. Where is the problem?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
The problem is that they are blocking the given IP using a "RULE". But no rule is available to allow upto given number of connections and block afterwards.
It seems IpFltDrv.sys file is accessed to block/unblock ip using some IOCTL codes. But codes are there for full blocking.
Is there any IOCTL code available to block partial blocking?
|
|
|
|
|
Veandhan wrote: The thing is i just want to restrict the number of connections from a IP without server's help.
Not possible since the server is the only thing that disparate connections have in common. For example, if you were limiting the connections to just one and you connected from where you are, how would my computer know to deny my connection to the server?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hello everyone!
When i'm typing in a richedit 1/2 and than space i want to get the horizontal fraction . is it possible ?
Thank you.
Doina.
|
|
|
|