|
Doesn't come back even if you move the mouse?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
No it's most strange - I can select text (and it gets higlighted) but there is no way of knowing where the cursor is (and the edit box is enabled, typing works!) . The only thing that works is to give the focus to another control (with mouse or tab) and then come back to it... strangest thing I have seen in a while!
|
|
|
|
|
3 questions:
1. Is the edit box customized in any way or is it just the default edit box? So did you overwrite any message handlers like WM_SETCURSOR or maybe WM_CHAR?
2. Does the cursor disappear when you start typing only or when you move the mouse cursor over your edit or maybe TAB to it?
3. Does this happen if you don't use your own cursor?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Thanks for taking the time to answer by the way!
1) No it's a simple CEdit... I did override WM_KEYDOWN (with PreTranslateMessage in the parent window)... I am doing a custom control where you can view some html and view the source code... and switch with a custom tab control from one to the other. Hoping I make sense...
2) The cursor disappears when the user clicks on the tab control... it hides the other window, displays the edit, gives it focus and voila - you can type but you have no idea where you are
3) Not sure I understand... do you want me to change the cursor? I certainly have not changed it manually so far
|
|
|
|
|
Ah, i think i see the confusement here, when i hear cursor i think of the mouse cursor, while you are talking about the caret, right? The little blinking line that shows where you type...Are you sure the control receives the WM_SETFOCUS message when it gets the focus?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
of course you're right - it's called the caret and not the cursor... my mistake. Yes the control does get the focus: when I type, it gets updated...
The temporary fix I have done is to give the focus to the tab control and then with a timer give it back to the edit... madness but at least it works... most bizarre
|
|
|
|
|
I have seen this happening too but i can't remember anymore what the problem actually was... If you hit the ALT key, do you maybe see the focus rect appearing on the tab control? I have seen strange behaviour appearing when setting the focus in an unapropriate time. I think you could simply use PostMessage to overcome this, so no need for a timer. Try posting (not sending) WM_SETFOCUS to the edit when it has been shown, or maybe post a custom message (like WM_USER) to the tab control which will set the focus on the shown page when it receives it. (I'd try the later aproach)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Are you using CreateSolidCaret. Does your custom edit control use an offscreen memory buffer for drawing?
|
|
|
|
|
No (CreateSolidCaret) and no (memory buffer)... it's is a simple MFC CEdit with no customisation whatsoever... it's simply a child window of a CWnd derived control!
|
|
|
|
|
In your initial comment you stated, "I am trying to build this custom cursor" and later you clarified that you meant "caret" so I naturally assumed you were creating a custom "caret" but apparently not so just ignore my question.
I apologize for misunderstanding.
|
|
|
|
|
oh thanks for pointing this out - I meant custom control - gee not my day!
|
|
|
|
|
I am new to WinCE environment.I need to connect to MS Excel database on windows XP from winCE device... Please give me some idea on how to do it...
|
|
|
|
|
My following code is unable to upload/write file on the server.
Please tell me whats wrong or how can i upload it in a different way on an HTTP Server.
I am using MFC.
INTERNET_BUFFERS BufferIn = {0};
DWORD dwBytesRead;
DWORD dwBytesWritten;
BYTE pBuffer[1024];
BOOL bRead, bRet;
HANDLE hFile;
HINTERNET hSession = InternetOpen(NULL,
INTERNET_OPEN_TYPE_PRECONFIG,
NULL,
NULL,
0);
HINTERNET hConnection = InternetConnect(hSession,
_T("www.crmpanel.com"),
INTERNET_DEFAULT_HTTP_PORT,
NULL,
NULL,
INTERNET_SERVICE_HTTP,
0,
NULL);
BufferIn.dwStructSize = sizeof( INTERNET_BUFFERS );
HINTERNET hRequest = HttpOpenRequest(hConnection,
_T("PUT"),
_T("cp3/wn_fupload-oo.php"),
NULL,
NULL,
NULL,
0,
0);
if (!hRequest)
{
MessageBox(_T("Failed to open request handle:"),NULL,MB_OK);
return ;
}
hFile = CreateFile (_T("c:\\Image1.gif"),
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
MessageBox(_T("Failed to open local file"),NULL,MB_OK);
return ;
}
BufferIn.dwBufferTotal = GetFileSize(hFile, NULL);
MessageBox(_T("File size is"),NULL,MB_OK);
if(!HttpSendRequestEx(hRequest, &BufferIn, NULL, HSR_INITIATE, 0))
{
MessageBox(_T("Error on HttpSendRequestEx"),NULL,MB_OK);
DWORD err = GetLastError();
return ;
}
DWORD sum = 0;
do
{
if (!(bRead = ReadFile (hFile, pBuffer, sizeof(pBuffer),
&dwBytesRead, NULL)))
{
MessageBox(_T("ReadFile failed on buffer"),NULL,MB_OK);
break;
}
if (!(bRet=InternetWriteFile( hRequest, pBuffer, dwBytesRead,
&dwBytesWritten)))
{
MessageBox(_T("InternetWriteFile failed"),NULL,MB_OK);
break;
}
sum += dwBytesWritten;
}
while (dwBytesRead == sizeof(pBuffer)) ;
CloseHandle (hFile);
MessageBox(_T("Actual written bytes:"),NULL,MB_OK);
if(!HttpEndRequest(hRequest, NULL, 0, 0))
{
MessageBox(_T("Error on HttpEndRequest"),NULL,MB_OK);
return ;
}
Thanks in Advance
Dhiraj
|
|
|
|
|
Dhiraj kumar Saini wrote: My following code is unable to upload/write file on the server.
And? How are we supposed to offer any suggestions if you don't tell us what is wrong, what you've tried, etc?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hai
I have an MFC application in which i download a binary file into a device.
I have a status bar, which tells the progress of download, during this time i want to change the appearence of the mouse pointer to a sand time
which is being done in almost all applications , how to do it ?
Thanks!
|
|
|
|
|
|
If you are using MFC then try,
BeginWaitCursor();
...
EndWaitCursor();
or
CCmdTarget::BeginWaitCursor();
...
CCmdTarget::EndWaitCursor();
Thanks.
|
|
|
|
|
<a href="http://msdn.microsoft.com/en-us/library/wc7bzytb%28VS.80%29.aspx" rel="nofollow">CWaitCursor</a>[<a href="http://msdn.microsoft.com/en-us/library/wc7bzytb%28VS.80%29.aspx" rel="nofollow" target="_blank">^</a>]
|
|
|
|
|
u can use SetCursor function
SetCursor(LoadCursor(NULL, IDC_WAIT));
IDC_WAIT is HourGlass
|
|
|
|
|
In addition to your other replies, you might be up/downloading the file using some sort of background thread. If the upload takes any length of time, I *hope* you're using a thread to keep your UI responsive.
In which case, you will also have to handle WM_SETCURSOR, other wise as soon as the mouse moves, your cursor will go back to normal.
Yours-been-bitten-by-this-in-the-past,
Iain.
|
|
|
|
|
kapardhi wrote: ...how to do it ?
Simply respond to the WM_SETCURSOR message.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
monsieur_jj wrote: Is it possible that http://www.codeproject.com/KB/web-security/Cryptography_MD5_TriDES.aspx?display=Print[^] may have a different output from a c++ version of the code?
any implementation of 3DES must give the same results as any other implementation, given the same inputs.
|
|
|
|
|
Hi,
I have one Edit box in dialog application(VC++ 6.0).Just i added spin control to the edit box, i have set the arnge for the spin control in the Init dialog function of my class. now am not able to see the value , when i use up/down in the spin control. it is updating in somewhere.
pls give any solution
Thanks in adavnce.
Thanks,
Balaji
|
|
|
|
|
See here.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|