|
Are you sure it's not:
DRIVE NAME:\Program Files\Microsoft Visual Studio\VC98\ATL\Include
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am having problems with a combobox that has a datasource. I am trying to set the selected item after the comobobox has been created
an example of my code is
DataRow* row;
row = playerDataSet1->Player->get_Rows()->get_Item(index);
myComboBox->set_SelectedValue(row->get_Item(:PlayerID));
this works perfectly when I run with the debugger, but as soon as I run without the debugger it doesnt seem to work
Any ideas of how to fix this would be appreciated
Thanks
Randy
|
|
|
|
|
Can anyone give me help in installing the boost libraries in VS.NET 2005 beta?
|
|
|
|
|
Does anyone happen to have a complete buildable project using ClistBox::CompareItem()?
If I set the list box to "has strings", CompareItem() is never called. If I uncheck "has strings", then CompareItem() is called, but all the information in the COMPAREITEMSTRUCT regarding item 2 appears to be garbage.
Thanks
|
|
|
|
|
It's been a while since I used that, but I found some code for an owner-drawn CClassListBox (derived from CListBox) without "has strings", in which:
I added items to the listbox using something like
int CClassListBox::AddItem(CFormClass* pClass)
{
ASSERT_VALID(pClass);
return AddString((char*) pClass);
}
int CClassListBox::InsertItem(UINT nIndex, CFormClass* pClass)
{
ASSERT_VALID(pClass);
return InsertString(nIndex, (char*) pClass);
}
then DrawItem, MeasureItem, CompareItem, etc., received these CFormClass pointers as the itemData fields. The CompareItem() implementation was:
int CClassListBox::CompareItem(LPCOMPAREITEMSTRUCT lpCIS)
{
CFormClass* pI1 = (CFormClass*) lpCIS->itemData1;
CFormClass* pI2 = (CFormClass*) lpCIS->itemData2;
ASSERT_VALID(pI1);
ASSERT_VALID(pI2);
ASSERT(pI1->IsKindOf(RUNTIME_CLASS(CFormClass)));
ASSERT(pI2->IsKindOf(RUNTIME_CLASS(CFormClass)));
if (pI1->IsGraphic() && !pI2->IsGraphic())
return -1;
if (!pI1->IsGraphic() && pI2->IsGraphic())
return 1;
int i = stricmp(pI1->GetName(),pI2->GetName());
if (i < 0)
i = -1;
else if (i > 0)
i = 1;
return i;
}
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi,
I am doing a project in win32.I have a multiline edit control.I want to set the text of the edit control with a string. My string has many lines seperated by LF. When I set the text to edit using WM_SETTEXT or setwindowtext(), I see a small square character in the places of LF and all the lines are printed as single line seperated with square box. My edit control is not accepting the LF. How do I do it..If I print the same srting in static control then it is printing correctly. It happens only with edit.
Thanks a lot.
|
|
|
|
|
Try \r\n instead of \n
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
I have a CList variable. I need to modify the contents of the objects within the CList. I iterate through it as follows:
CList <cpumpinfo, cpumpinfo&=""> mPumpList;
CPumpInfo currPump;
POSITION pos = mPumpList.GetHeadPosition();
for (int index=0; index < mPumpList.GetCount(); index++)
{
currPump = mPumpList.GetNext(pos);
currPump.SetState(PUMP_STOP_STATE);
}
For some reason, when I call SetState on the object in the list, the value isnt saved.
I want to know why any changes to the object within the list arent saved? Any ideas? Thanks.
|
|
|
|
|
That's because you are storing CPumpInfo objects not CPumpInfo* objects. Store pointers instead and it'll work.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Geeez... thanks. Why didnt I think of that! It works now.
-C
|
|
|
|
|
CList is a template class and we can't see what parameters you are using when you instantiate it. Please repost the code making sure you check "Do not treat <'s as HTML tags" option.
You are most likely storing/retrieving copies of the elements (by value) instead of pointers or references. If that is the case, GetNext() is giving you a copy of what it's in the list, so any change you do on it has no effect on what it's in the list.
--
jlr
<a href = "http://jlamas.blogspot.com/" rel="nofollow">http://jlamas.blogspot.com/</a>[<a href = "http://jlamas.blogspot.com/" target = "_blank" rel="nofollow">^</a>]
|
|
|
|
|
I'm not sure if std::string supports the [] operator, but if it does:
if (savedpass[0] == x && savedpass[1] == y && savedpass[2] == z)
... What about:
char enteredpass[4] = {0};
enteredpass[0] = getch();
enteredpass[1] = getch();
enteredpass[2] = getch();
if (savedpass == enteredpass)
...
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Is this possible?
I want to create a separate "Find Text" program that will access, read, and control a Rich Edit Control in another application.
Basically what i've figured out so far is that if i somehow get the handle to the control in another application (MS Enterprise Manager), I can send messages such as EM_FINDTEXT, EM_GETSELTEXT, and EM_SETTEXTEX to it. And then i'm assuming that it will react to these messages.
I do know that I can get the handle to the window application, but can i get the handle to the controls within it?
|
|
|
|
|
c121hains wrote:
I do know that I can get the handle to the window application, but can i get the handle to the controls within it?
Sure. See FindWindowEx() for this.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
"The FindWindowEx function retrieves a handle to a window whose class name and window name match the specified strings. The function searches child windows, beginning with the one following the specified child window."
..it searches child windows. But i'm looking for controls within a child window. Is it possible to access the controls within a child window of another application?
If so, how?
|
|
|
|
|
|
With the exception of the desktop, all windows are a child window. So if you already have a handle to the window of interest, you can use FindWindowEx() like:
FindWindowEx(hWnd, NULL, class_name, NULL); You can find out what goes in place of class_name by using Spy++. Just open up the window having the control you want to meddle with and use Spy++ to get the control's class name.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
c121hains wrote:
But i'm looking for controls within a child window
those controls are child windows (of the child window). I haven't used it for a while, but IIRC, you use FindWindowEx(), sending in a null as it's parent window. Find the child this time using it's parent window as one of the arguments, then find a child of that window (the controls you're talking about) by sending in it's parent as one of the arguments. get it?
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
ahh i see! ok Thanks.
I used a program called WinDowse and when i place the cursor over the (what looks like a Rich Edit box) turns out to have the class name "DimensionEdit"!
Another control used in MS Enterprise Manager is "DimensionDataCtrl".
If i want to send any messages to these controls (child windows), I have to know what messages they are listening to. So far i can't find any information on DimensionEdit class. Could they have created their own class by inheriting a rich edit box?
|
|
|
|
|
The class that i want (DimensionEdit) is within a class called "#32770" and that itself is within a "#32770" which lies within the base "MMCMainFrame" window.
Everytime I run
HWND hWnd = FindWindowEx(enterprise->m_hWnd, NULL, "#32770", NULL);
It fails to bring up the correct handle! Entering in the description of the window doesn't work either.
Please help!
|
|
|
|
|
c121hains wrote:
The class that i want (DimensionEdit) is within a class called "#32770"...
This is the standard dialog box class.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
So.. are you saying that this would work:
HWND hWnd = FindWindowEx(enterprise->m_hWnd, NULL, "CDialog", NULL);
..but in Spy++, the name of the class is #32770. If it's a dialog class, how come the order of window controls is:
- DimensionEdit
- #32770
- #32770
- MMCEnterprise Manager Main Window
When i'm looking at it, it is
- Some edit box within a tab order control within a dialog box window all within the main Enterprise Manager window. (
|
|
|
|
|
c121hains wrote:
HWND hWnd = FindWindowEx(enterprise->m_hWnd, NULL, "CDialog", NULL);
Don't confuse C++ classes with window classes (those registered with RegisterClass() ).
See here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I managed to finally get it working. I had to first grab the handle to the desktop and use GetNextWindow through about 200+ handles to get the one matching the partial window text that i was looking for. The dialog's window text that i wanted contained static and dynamic text. That was why i couldn't just find the window with just he window's text.
Thanks for the help!
|
|
|
|
|
Once you had the handle to the dialog itself, couldn't you then have used GetDlgItem() to get the handle to the control without having to enumerate through each control on the dialog?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|