|
Yes. its good sample.
Meanwhile i am getting the following error.
error C2664: 'void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)' : cannot convert parameter 1 from 'const char [10]' to 'const wchar_t *'
How to resove this.
|
|
|
|
|
It is because UNICODE is defined for your project. I suggest this excellent article[^] if you want to understand what is happening. If you don't care, just disable UNICODE in your project settings (but you'll miss a chance to learn something usefull).
|
|
|
|
|
Thanks.i gone thru the article.
Look below decl. of unicode.
wchar_t wch = L'1'; // 2 bytes, 0x0031
wchar_t* wsz = L"Hello"; // 12 bytes, 6 wide characters
First stmt one char -> 2Byte.
Second stme five char -> 12 byte. How?
|
|
|
|
|
RSAK wrote: .i gone thru the article.
It seems that you didn't really understand the article . wchar is a wide character, which means each character is coded on two bytes. So, the string "Hello" (with the terminating character) is 6 wide characters so 12 bytes.
BTW, don't use wide characters directly but use TCHAR instead. In this way, your code will support both unicode and non-unicode builds.
|
|
|
|
|
i actually confused with the first stmt as it has one char and another(termin char). so total would come 4 bytes.
|
|
|
|
|
No: it is not a string. It is a single wchar, so its size is 2 bytes.
|
|
|
|
|
Again and again i am struck with unicode and multibyte char convesions.
int iValue = m_iValue1;
CString str;
str.Format("%d", m_iValue);
.....
.....
m_ListBox.AddString(str);
.....
How to do that using TCHAR? like format used in CString..
|
|
|
|
|
|
|
Did you get this resolved? (I just implemented it in about 5 minutes w/ that article)
|
|
|
|
|
|
Hi all,
From VC++ code i am calling a stored procedure that is updating some fields in the data base
the code is working fine for sql2k but throwing following exception for 2k5
Error Message: Multiple-step operation generated errors. Check each status value.
Failed to update column XYZ with value: 1
Column Attributes for Receive_Status: [Field accepts null values][Null values can be read from the field][Field contains fixed-length data]
Field Status for Receive_Status: [Value violated the data source schema constraint for the field]
Please help me here ...
am having a suspect on a variable of stored proc that is used as tinyint ...
please help me here ...
Thanks
vikas da
|
|
|
|
|
tasumisra wrote: Value violated the data source schema constraint for the field
What are the constraints for the column in qustion?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
the onstraints are value for the column xyz cant be null..
vikas da
|
|
|
|
|
Without the schema and the stored procedure it's harder to guess.
Can you post a small example that duplicates the problem?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am calling WM_PRINT to print the control. It is drawing the control but Client area of window is blank. This is my code
LRESULT lRes = InTouch.SendMessage(WM_PRINT,(LPARAM)hDC, PRF_CLIENT | PRF_CHILDREN | PRF_OWNED|PRF_NONCLIENT);
where InTouch is a CWnd parameter.
Any help is appreciated
Regards, Eswari
|
|
|
|
|
subramanyeswari wrote: It is drawing the control but Client area of window is blank
you mean black?How did you create the DC and bitmap?
also did you try PrintWindow() function?
|
|
|
|
|
I did not create dc and bitmap. Because that did not work. I wrote a function in which i am drawing the control and calling the sendmessage with WM_PRINT. it is drawing the control and scrool bars but the remaining portion is coming as blank.
I refer this link.
http://www.fengyuan.com/article/wmprint.html
in that article he clearly mentioned that If you send a WM_PRINT message to a window, normally all the non-client area, which includes border, title bar, menu bar, scroll bar, etc., and common controls are drawn properly. Client area of windows implemented by application programs are normally left blank.
and he gave the solution to implement WM_PRINTCLIENT. how to implement that in my control which is derived from CObject
Regards
modified on Monday, June 9, 2008 6:46 AM
|
|
|
|
|
Dear all,
how to switch off the "Show window content while dragging" to my window.?
is there any window style ?.
if there is no way how can i implement the style with coding. ?
thanks in advance
|
|
|
|
|
Try
::SystemParametersInfo with SPI_SETDRAGFULLWINDOWS parameter.
-@SuDhIrKuMaR@-
|
|
|
|
|
The SPI setting will turn it off for more than just your own window, and changing a user's setting on them is A Bad Thing , so Do Not Do That .
I have had to do this before and IIRC, I had to handle the WM_MOVING , WM_SIZING , WM_MOVE and WM_SIZE messages. You have to keep handling the WM_MOVE and WM_SIZE messages because (again, IIRC), the OS keeps sending those messages while the window is being moved/sized which is why that feature works without application support.
You may need to check to see if the user has the mouse button down or up to determine which set of messages is the "final" message.
If the user is moving/sizing by the keyboard... Well, I did not handle that...
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
this is based on Registry Setting ( Afect all windows). If the user has no right to change system settings then how it works.. ?
|
|
|
|
|
In my SDI application, I have two views, Treeview and FormView.
I placed Edit control on FormView. I have to change value of Edit control by clicking on Tree. Both are different classes.
But I am unable to access FormView Class members from Treeview. How can I do that?
void CLeftView::OnTvnSelchanged(NMHDR *pNMHDR, LRESULT *pResult)
{
CRightView *rView = new CRightView();
if(rView!=NULL)
{
rView->m_Edit1.SetWindowText(_T("ok"));
}
}
Code gives Debug Assertion Error.
|
|
|
|
|
|
You are creating new View object CRightView *rView = new CRightView();.Instead of this you should get the the attached View object.
-@SuDhIrKuMaR@-
|
|
|
|