|
CPallini wrote: however you can set its width equal to zero,
Pressing 'Ctrl + +' redisplays it. It's the shortcut for auto resizing list control columns, based on it's contents, in windows.
|
|
|
|
|
I know.
If you need to handle this then a more elaborate approach involves overriding DrawItem .
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.
|
|
|
|
|
CPallini wrote: If you need to handle this then a more elaborate approach involves overriding DrawItem.
One way could be to create a virtual list control and just don't give any text to hidden columns(this includes the header for the column), this way windows won't show this column I guess, even when this shortcut is pressed.
|
|
|
|
|
This implies you have to copy data elsewhere. Once you copied data you may just delete the column.
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.
|
|
|
|
|
CPallini wrote: This implies you have to copy data elsewhere. Once you copied data you may just delete the column.
Yeah that is what I meant by virtual list.
|
|
|
|
|
sheshidar wrote: ...that perticular column should not visible to end user.
Then why bother having it?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have to keep the data in the column, but only thing is end user should not know that there is the column i list.
|
|
|
|
|
sheshidar wrote: I have to keep the data in the column,
But why? There may be another, more elegant, solution.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
hi
anybody tell me what does it mean by
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{D8E6DD29-A056-4FB4-92AE-E9920222E4E7}\Connection
MediaSubType = 1 or 2 or3..
Because As I know this shows that whether this
sonani prakash
|
|
|
|
|
i'm not sure but it may mean following:
1 = Ethernet (using Ethernet II or IEEE 802.3 Sub-Network Access Protocol [SNAP] encapsulation)
2 = Fiber Distributed Data Interchange (FDDI)
3 = Token Ring (IEEE 802.5)
4 = IEEE 802.11 Wireless LAN
5 = ATM (using LAN emulation [LANE] and Classical IP [CLIP] over ATM)
6 = Attached Resource Computing Network (ARCnet)
7 = Dedicated wide area network (WAN) links such as Dataphone Digital Service (DDS) and T-carrier (Fractional T1, T1, T3, E1, and
E3)
|
|
|
|
|
Hi
How can I close a messagebox without using the Mouse?For example I want that the messageBox will close by itself after 10 seconds.Can I do that?
Thanks
|
|
|
|
|
There is no timeout option for a MessageBox API.
I would suggest use a dialog box, make it generic enough to be used. Use timer inside the dialog box.
something like this:
Call SetTimer(1, 10000, NULL) in CMsgBoxDlg::OnInitDialog() method.
//10000 for 10 secs
In timer method:
void CMsgBoxDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CDialog::OnOK();
CDialog::OnTimer(nIDEvent);
}
Add a public member function to accept message box string and caption. Use static control to display the provided string on the dialog box with a 'Ok' button.
Hope this helps
Thammadi
|
|
|
|
|
iayd wrote: How can I close a messagebox without using the Mouse?
Spacebar, Alt+F4, Alt+Space then either X or C.
iayd wrote: For example I want that the messageBox will close by itself after 10 seconds.Can I do that?
Yes. See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
On the time you can send WM_CLOSE to it.
|
|
|
|
|
This is a code I use in my app:
<br />
IStream* data = NULL;<br />
HRESULT hr = S_OK;<br />
hr = SHCreateStreamOnFileW(name,STGM_READ | STGM_SHARE_DENY_WRITE,&data);<br />
When I compile i get error saying:
error LNK2001: unresolved external symbol __imp__SHCreateStreamOnFileW@12
fatal error LNK1120: 1 unresolved externals
What to do?! Thanks
|
|
|
|
|
|
I added:
#include shlwapi.h
in my code,also added:
ShLwApi.Lib
in project settings link input category and put lib path 'D:\VistaSDK\Lib' in additional library path (also in setings).
Now when build error:
uuid.lib(oaidl_i.obj) : fatal error LNK1103: debugging information corrupt; recompile module
???
THX
-- modified at 6:26 Friday 20th July, 2007
|
|
|
|
|
|
Hi, everyone!
I've a problem about UDP. I don't know whether this should be submitted here. If shouldn't, plz tell me the apporiate position.
I'm developing an application which can communicate with other machine through Network using UDP. I create a new thread to listen the income. This thread function is a member of the class manageing the socket. I find a strange phenomenon that I must destroy the thread and create a new one after I send message. Or I can't receive anything from the target I had just sent to. I think the actual fact shouldn't be as this. But I don't know the reason. So I hope someone can help me to resolve this problem. Thx!
The fraction of the thread function:
UINT CMySocket::ReceiveThread(LPVOID lpParam)
{
CMySocket *parent=reinterpret_cast(lpParam);
BYTE buf[1024];
DWORD dwLength;
int ret,addrlen,err;
CWinThread* AcptThread;
fd_set fdread;
SOCKET ListenSock,ClientSock;
ClientSock=parent->sClient;
struct timeval timeout;
dwLength=1024;
if(parent->m_ConWay==0)
listen(parent->s,SOMAXCONN);
addrlen=sizeof(parent->inaddr);
while(bRun)
{
ListenSock=parent->s;
FD_ZERO(&fdread);
FD_SET(ListenSock,&fdread);
timeout.tv_sec=0;
timeout.tv_usec=100;
if((ret=select(0,&fdread,NULL,NULL,&timeout))!=SOCKET_ERROR)
{
if(ret>0)
{
switch(parent->m_ConWay)
{
case 0:
ClientSock=accept(parent->s,(struct sockaddr*)&parent->inaddr,&addrlen);
if(ClientSock!=SOCKET_ERROR)
{
parent->sClient=ClientSock;
AcptThread=AfxBeginThread(AcceptThread,parent,THREAD_PRIORITY_NORMAL,0,
CREATE_SUSPENDED,NULL);
if(AcptThread==NULL)
{
return GetLastError();
}
else
{
bRun=TRUE;
AcptThread->ResumeThread();
return 0;
}
}
else
err=GetLastError();
break;
case 1:
ret=recv(ListenSock,(char*)buf,1024,0);
err=GetLastError();
if(ret>0)
parent->Recive((char*)buf,ret,err);
break;
case 2:
ret=recvfrom(ListenSock,(char*)buf,dwLength,0,
(struct sockaddr*)&(parent->inaddr),&addrlen);
err=GetLastError();
if(ret!=SOCKET_ERROR&&ret!=0)
{
char addr[17];
memset(addr,0,17);
memcpy(addr,parent->inaddr.sa_data,14);
//parent->Recive((char*)buf,ret,err);
parent->inform_recv(parent->m_pOwner,buf,ret,addr);
}
break;
}
}
}
}
return 1;
}
regard!
whiteclouds
|
|
|
|
|
I started reading your code and stopped when I saw the listen() call.
Why are you using listen() if you're trying to use UDP?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Remember the five Ds of dogeball: Dodge, Dip, Duck, Dive, and Dodge."
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
The code I paste upper is a general function which can also be used in TCP connection. The listen() can't be called in UDP. I used a varriable m_ConWay to distinguish them. As I use UDP, m_ConWay=2.
Someone tell me the reason of this problem may be the peer close the socket. But I couldn't find the socket be closed. So I wish you can help me to analyze it. Thx!
Regard!
whiteclouds.
|
|
|
|
|
whiteclouds wrote: The listen() can't be called in UDP. I used a varriable m_ConWay to distinguish them. As I use UDP, m_ConWay=2.
OK thanks
This is something you really need to debug. With UDP you have no way of knowing if the other
end receives what you send or if the other end's socket closed. There's also no guarantee a
datagram will even get to the other end.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have Hindi Text and want to display it on a Dialog Box, but the problem comes when i m reading it from a file.
It shows weird characters like "ऊ ठठठ分有点晕,"
I am using fread function to read these Hindi Text.
and converting it to wide characters using
mbstowcs(buf0,str0,l_Len0+1);
SetDlgItemTextW(m_hWnd,IDC_MY_TEXT,buf0);
where buf0 is wchar_t and str0 is the above weird characters.
Can anyone tell where I am going wrong ???
|
|
|
|
|
Suneet.03 wrote: SetDlgItemTextW
Why are you using the specialized version of the function ? You should use SetDlgItemText instead, this will 'link' to SetDlgItemTextW if UNICODE is defined. If you get a compilation error, it probably means that you didn't define UNICODE and I don't think you'll be able to display a unicode string in that case.
|
|
|
|