|
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
|
|
|
|
|
Trz calling SetBuddy of the spin control specifying yout edit. Something like:
my_spin.SetBuddy(&my_edit);
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Hi ,
am not able to useSet Buddy MFC beacuse i have declared my edit box variable as double. if i pass the address of my edit box variable. it says cannot convert from double to CWnd*
thanks,
balaji
|
|
|
|
|
You have at least 3 possibilities:
1. as someone already mentioned, use the auto-buddy feature (set that to true in the dialog editor for your spin button and make sure the spin comes right after the edit in tab order)
2. specify a control variable too for your edit button (CEdit) and pass that to SetBuddy
3. use GetDlgItem() to get a pointer for your edit control and feed that to the SetBuddy call (presuming you already have a CSPinButtonCtrl type member assigned to your spin control.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
modified on Monday, December 8, 2008 5:37 AM
|
|
|
|
|
i have used GetDlgItem(ID name) and then what i have to pass in the SetBuddy function.
|
|
|
|
|
Sorry, i got mixed up there, i thought you had the double for your spin button, not your edit, i will edit my previous post and then check it again.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Ok No problem,
i have created control variable for spin control already.
m_voltspin.SetRange(0,50);
i have memeber variable for edit box in that i have declared as double.
i have set true in the spin control properties
(Auto Buddy), problem is am not able to see the values in the dit box when i press up / down the spin control, it is updating somewhre.
|
|
|
|
|
There's a spin button style called "Set buddy int" (UDS_SETBUDDYINT), make sure that is set for your spin button.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|