|
In [Control Panel / Regional Settings / Advanced] there's an option named "Language for non-Unicode programs". Have you changed that to Chinese? DevStudio is most likely an ANSI application, so changing that option would be needed.
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
This has definitely made a difference. Maybe now I am going in the right direction.
Thank you so much
|
|
|
|
|
Running the application where we feed the data from one window and display in another window having list view control - I notice that data is correctly passed on for display in view class. However, I tried to create a list view control pointer like this:
CListCTRL* pList = (CListCTRL *) GetDlgItem (IDC_List1);
which in turn gives me runtime error in winocc.cpp that debug assertion failed at line 94:
Line 94 in winocc.cpp is
ASSERT(::IsWindow(m_hWnd));
If anyone knows how to fix this problem or have any tips, I would surely appreciate.
Bruce
|
|
|
|
|
At the point in which you are calling GetDlgItem() , no such control having an id of IDC_List1 exists (yet).
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
David,
Thank for replying. Let me share some details...
i have created the listview control. I tried to create the listview in the function OnInitialUpdate and it worked successfully.
My need is to keep both windows open like receiver and sender mechanism i.e. Data is passed from one form having edit control and after sending data, display them in listview in separate form. But when i tried to do the same in my defined function (in addition to OnInitialUpdate) i.e. AddData(), I face this problem.
The sequence of code follows. Both Functions exist in the same cpp file.
void CTestView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
ResizeParentToFit();
m_pSelection = NULL; // initialize selection
CListCtrl* pList = (CListCtrl*) GetDlgItem(IDC_LIST1); // THIS ONE WORKS
pList->InsertColumn(0,"ym",LVCFMT_CENTER,140);
pList->InsertColumn(1,"Ws",LVCFMT_CENTER,70);
pList->InsertColumn(2,"State",LVCFMT_CENTER,50);
}
void CTestView::AddData(LPCTSTR tn,LPCTSTR cn,LPCTSTR ts,LPCTSTR cv)
{
int i=0,j=0;
int flag = 0;
j=rowcount-1;
//pointer to the listview control
CListCtrl* pList = (CListCtrl*) GetDlgItem(IDC_LIST1); // THIS ONE DOES NOT WORK
pList->InsertItem(0,ts);
}
Bruce
|
|
|
|
|
Bruce Pataki wrote:
I tried to create the listview in the function OnInitialUpdate...
Why are you creating a list view at runtime rather than deriving the view from CListView ? This would allow you access to the underlying list control using GetListCtrl() .
If, however, you are using a CFormView with a list control instead, create a CListCtrl member variable instead of using GetDlgItem() .
When does AddData() get called?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
I am using a CProgressCtrl m_PPROG in my main dialog class;
how can i call m_PPROG.SetPos(value) from another function in another class without creating another object of the main class?
/\|-||\/|/\|)
|
|
|
|
|
Since the progress control is owned by your "main dialog class," good design dictates that only that dialog should interact with the progress control. If some other class needs to interact with the control, it should send/post a message to the owning dialog class, or the owning dialog class should have a public method, that others can call, for setting the control's position.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
I am trying to figure out if the current desktop is the desktop that my interactive service is running on, and I came across the GetInputDesktop function exported by user32.dll. It appears to always return 0 if either the login screen or screen saver or a fast user switching terminal services desktop is active. So, I simply compare the returned HDESK value of that to the value returned by GetThreadDesktop and I have my answer. But since GetInputDesktop is undocumented, I'm wondering if there is another way to get at this information, or if anyone knows anything more specific about the GetInputDesktop function.
Thanks much.
sarah
|
|
|
|
|
|
Yes, GetThreadDesktop is documented. However, GetInputDesktop is not. That is the function I'm curious about.
|
|
|
|
|
My bad. Thread and Input just look so much alike!
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Never worked with this, but there's a documented OpenInputDesktop(), which (quote) "retrieves a handle to the desktop that receives user input. The input desktop is a desktop on the window station associated with the logged-on user."
Would that be of help?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Wat function do i call to get a bool parameter indicating that my window has the focus or not?
/\|-||\/|/\|)
|
|
|
|
|
Use GetFocus() for this.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
GetFocus returns a handle of the window but how can i know that this is the window i want or not?
/\|-||\/|/\|)
|
|
|
|
|
if (GetFocus() == GetDlgItem(IDC_MY_WINDOW)) {
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
it didnt work
/\|-||\/|/\|)
|
|
|
|
|
because you don't use it properly...
post your code
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
if (Lp.checkcon2() && (GetFocus() == GetDlgItem(IDD_AUTOMATIC)))
forget about Lp.checkcon2() it is always true
/\|-||\/|/\|)
|
|
|
|
|
hum, what about GetFocus() == m_hWnd ??
moreover, are you sure that GetDlgItem() doesn't return NULL ?!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
i received this error message
error C2446: '==' : no conversion from 'struct HWND__ *' to 'class CWnd *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
error C2230: '==' : indirection to different types
Error executing cl.exe.
maybe it doesnt work when this is not the main dialog?
/\|-||\/|/\|)
|
|
|
|
|
GetDlgItem() is returning NULL
WHY?
/\|-||\/|/\|)
|
|
|
|