|
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.
|
|
|
|
|
If the characters in the file are Hindi then they're probably already wide characters so you don't want to be converting them. Read wide characters from the file in the first place and just display them. (I'm guessing you're already using a Hindi capable Font like Arial UNICODE)
If they're not wide characters but from a Hindi Code Page then things are more complex and you need to make sure your program is set to use that code page before doing the mbstowcs conversion. This will also depend on whether you're using Hindi Windows or US/English Windows with the input language set to Hindi. Welcome to the frustrating world of internationalisation (i18n for short)
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
yaa, I am using US/English Windows with Input language set to Hindi
How can I make my program to use the Hindi Code page.
and I am struck at reading them from file, why is it showing those characters
|
|
|
|
|
If you're using US/English Windows then you'll want to use UNICODE for your program rather than setting up for a specific code page. Have a look at MultiByteToWideChar[^] you'll need to find out which code page was used to create the text file and put that actual value into the first parameter instead of one the standard ones. I gather Hindi is normally 1137. Make sure your code is fully UNICODE compliant ( _T("") macros for the text and TCHAR or WCHAR or wchar_t everywhere and wcslen or tcslen type CLibrary calls instead of strlen , UNICODE and _UNICODE predefined as symbols for the project. )
Remember that whenever you see the characters, even in the debugger, you're seeing them translated in one way or another so don't worry if the Hindi doesn't show properly everywhere as long as it works when your code puts it on the screen.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thanx for such quick replies.
If that is the case then I fear , I have 2 make lot of changes.. sine I have used _MBCS during compilation
and using strcpy and strlen everywhere....
Can you tell me instead of strcpy what function can i use..
same way as strlen is for _tcslen
|
|
|
|
|
Programming for UNICODE is a big topic and you may want to do some research before embarking on a rewrite if your project. However here's a starter
strcpy only handles 8 bit char(s) as you know
wcscpy only handles 16 bit WCHAR(s)
_mbscpy handles multibyte characters (unsigned long apparently)
see here[^]
_tcscpy is really a macro which turns into wcscpy if your build your project for UNICODE, _mbscpy if you build with _MBCS defined and strcpy if you build your project without UNICODE or _MBCS defined.
Similarly TCHAR becomes WCHAR or char or presumably unsigned long.
Personally I would stay clear of all the _MBCS stuff and stick with 2 builds, One with UNICODE defined and one without for the same source. Try to use the _t functions, like _tcslen, everywhere and remember to wrap your string constants with the _T macro e.g. _T("Some Text"). Most if not all your code should work in both builds. Any features that only work in UNICODE, like dealing with Hindi, might get excluded from the non UNICODE build with #ifdef UNICODE.
Unfortunately things are not quite that simple. Microsoft now recommend we all use Safe String functions, see here[^] and all the various _s extended variants of the normal C Library functions with extra parameters to enable buffer overrun protection.
I hope this is enough to give you a start. If it looks like a mess I'm afraid it is and the only way through is really to pick a standard way of doing things and stick to it rigerously. Of course it helps if you pick the right way for your application and that can be hard.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|