|
Can you please be a bit more specific? What are the incorrect values you are getting, and what do you expect there? What is the code you are using to draw the item?
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
The CompareItem Function seems to work fine. I can't get the DrawItem to display the sorted data.
void CCBX::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
// TODO: Add your code to draw the specified item
ASSERT(lpDrawItemStruct->CtlType == ODT_COMBOBOX);
LPSTR lpszText = (LPSTR)lpDrawItemStruct->itemData;
CDC dc;
dc.Attach(lpDrawItemStruct->hDC);
dc.DrawText(lpszText, strlen(lpszText),
&lpDrawItemStruct->rcItem,DT_SINGLELINE);
dc.Detach();
}
Thanks
|
|
|
|
|
I want to set focus in the edit part of the combobox after I select an item from a listCtrl. SO I have in:
OnItemChanged()
{
GoToDlgCtrl(GetDlgItem(IDC_COMBO1)->GetDlgItem(1001));
When I have the mouse button clicked down (and not yet released back up) while I am in the listCtrl making my selection, the focus does go to the combo editpart. I see the cursor blinking there. The moment I release the mouse the focus vanishes, and the item I selected looks highlighted in blue. How do I make my focus stay in the combo? I even tried postMessaging from within the ItemChanged to setFocus but that didnt do it either....
Appreciate your help,
ns
Of course I had tried the m_combo1.SetFocus() too but no go..
|
|
|
|
|
I need a dialog to lock my app, at the same time I locked desktop, so no one can run another app, but F1 key can not disable successfully, when I press F1, it pass through my dialog and to CxxApp, which generate WM_HELP by default, I want to avoid it in this situation, How can I do it?
BOOL CLockDlg::PreTranslateMessage(MSG* pMsg)<br />
{<br />
if(pMsg->message==WM_KEYDOWN)<br />
{<br />
switch(pMsg->wParam)<br />
{<br />
case VK_ESCAPE: return TRUE;<br />
<br />
}<br />
} <br />
<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}<br />
Thank you in advance.;)
Best Regards
|
|
|
|
|
I have a collection of independant UI components, that I can place in dialogs to build more complex dialogs.
When the data from one of the component is modified, I may need to update another component.
I don't want the components to know about other component; and each component has a pointer to its parent dialog.
so, I'm doing something like this :
...
void SomeDerivedComponent::SomeMethodThatChangedTheComponent()
{
m_pParentDialog->ComponentChanged(this);
}
...
void ParentDialogClass::ComponentChanged( ComponentBaseClass* pComponent)
{
if ( dynamic_cast<SomeDerivedComponent>(pComponent) != NULL )
{
}
}
When I update the components in the parent dialog , I only pull info from the components, I don't want to have the components send/push back info to the parent either.
Does it sound ok ?
Thanks.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
It sounds okay.
As a reference, Windows controls tend to use a mixture of the approaches. When they change, or an event occurs, they send a message to their parent (meaning that the parent does not have to implement a certain interface, but may optionally handle the notification messages, normally sent as WM_COMMAND or WM_NOTIFY). Some controls just send a message saying that something changed, like a combo box sends a message saying the selection changed, without providing any information about what the selection has changed to - you need to query it. Other controls, such as a tree control, send much more information in their notify messages, often providing all the information required (such as the previously selected item, the new item, the item state etc.).
The only change i would suggest is to change the controls from using a pointer to the parent and calling a function, to sending a custom message to the parent. This will make the controls easier to reuse in another situation, because they won't be hardcoded to use a specific parent dialog.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Dave Bryant wrote:
The only change i would suggest is to change the controls from using a pointer to the parent and calling a function, to sending a custom message to the parent.
I wanted to do this, but I kinda' don't like Windows that much; and the derived components, are only used in those instances.
But I will try it, since it's not a big change to what I've already done, only replace the pointer by a SendMessage(...);
I also thought of using a observer pattern but that meant too much work ...
Thanks
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Hi,
In adialog based application, i have a listbox for showing some
info data. Now i want to know how to add "PageUp" and "PageDown"
functions in the listbox? How to do this? Is there any reference about this?
Thanks in advance!
chen
|
|
|
|
|
Try sending a WM_VSCROLL message to the list box (see MSDN for details on what WPARAM and LPARAM are - i can't remember off the top of my head).
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Hi,
I am trying to prevent IE6 from caching files.
I tried all the MSDN tips , but it's of no use.
Can someone tell me how can I prevent IE from caching files
Thanks,
Sansky
John 3:16
For God so loved the world,
that he gave his only begotten Son ( Jesus Christ ) ,
that whosoever believeth in him should not perish, but have everlasting life.
|
|
|
|
|
I have a bit of a problem. We have a lot of legacy apps that ares spread across three different platforms - desktop Windows, CE 2.12 devices WITHOUT MFC/user interface stuff, and now, PocketPC 2002 with MFC and user interface stuff. They all use STL for strings and collection stuff.
What I want is a set of collection classes that does NOT use MFC or STL, but that provide the same functionality. The optimum solution would be the MFC collection classes extracted from and with no reliance on the rest of the MFC library.
Barring that, I need an STL library which supports Windows, CE 2.12, CE 3.0, and PocketPC 2002.
I already have a replacement for the MFC CString class that doesn't use STL, but I still need a set of collection classes.
Any info, help, scolding, insulting?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
John Simmons / outlaw programmer wrote:
I need an STL library which supports Windows, CE 2.12, CE 3.0, and PocketPC 2002
Does STLPort[^] work with these platforms?
It compiles almost everywhere you can start a c++ compiler.
John Simmons / outlaw programmer wrote:
..scolding, insulting..
If you really insist...;P
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I downloaded STLPort (I hate STL).
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I hate STL even more now.
STLPort is NOTHING like the SGI implementation...
So much for portability, eh?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
|
All of the filenames are different, a lot of types are renamed - it's quite impossible for me to use it.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
ATL has CSimpleArray and CSimpleMap which can substitute for std::vector and std::map . They might not be good substitutes depending on your needs, but at least all the code is templates so you can just copy & paste it in to try them out.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Can anyone tell me how to make a fullscreen window in SDI and Dialog based application.
Omar Alvi
|
|
|
|
|
If you want to occupy the area used by the taskbar you should do this:
CRect rectWorkArea;
rectWorkArea.left = 0;
rectWorkArea.top = 0;
rectWorkArea.right = ::GetSystemMetrics(SM_CXSCREEN);
rectWorkArea.bottom = ::GetSystemMetrics(SM_CYSCREEN);
SystemParametersInfo(SPI_SETWORKAREA,0,&rectWorkArea,SPIF_SENDCHANGE);
and at OnInitDialog's end this->ShowWindow(SW_SHOWMAXIMIZED);
if you don't want to ocuppy the area used by the taskbar... then only this->ShowWindow(SW_SHOWMAXIMIZED); will do the work...
Hope this helps...
|
|
|
|
|
Hi,
In my app the user can compose and e-mail with some data from the App, and then click "Send E-Mail", ... it send the e-mail to outlook...
I would like to test before the user spend his time writing the e-mail... if Outlook is installed on the computer or not, but it seems that creating an instance of Outlook automated would take a long time...
Is there any way to check it in a faster way ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
Try to create an IPOutlookApp COM interface!
This code is just from a Pocket PC 2002 application, but I think you can also
use it on another system!
BOOL IsOutlookAppInstalled()
{
HRESULT hr;
IPOutlookApp* polApp;
CoInitializeEx(NULL, 0);
hr = CoCreateInstance(CLSID_Application, NULL, CLSCTX_INPROC_SERVER, IID_IPOutlookApp, (LPVOID*)&polApp);
if (SUCCEEDED(hr))
{
polApp->Release();
}
CoUninitialize();
return (SUCCEEDED(hr) ? TRUE : FALSE);
}
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
|
|
Thomas George wrote:
I see FindWindow and FindWindowEx in the list. Were they undocumented?
No, I actually recognise a lot of them...
Ryan
He who laughs last thinks too slowly.
|
|
|
|
|
I need to do the same with Byte (VT_UI1), Short(VT_I2), float(VT_R4), and other VARIANT that what I have made with long (VT_I4).
How I can do it?
Thanks.
A part of the code:
for (long k=0;k<TOTALNUMPARAM;k++)<br />
{<br />
SafeArrayGetElement (PVAVLISTAVALORESPARAMETROS.parray,&k,&item);<br />
switch (item.vt)<br />
{<br />
case VT_UI1:<br />
break;<br />
case VT_I2:<br />
break;<br />
case VT_I4:
item.lVal = 0;<br />
if (input[parameter_start] == 0)<br />
{<br />
for (int l=parameter_start+1;l<(parameter_start+32);l++)<br />
item.lVal += input[l]*(int)pow(2,(parameter_start+32)-l-1);<br />
}<br />
else<br />
{<br />
for (int l=parameter_start+1;l<(parameter_start+32);l++)<br />
item.lVal += ((input[l]+1)%2)*(int)pow(2,(parameter_start+32)-l-1);<br />
item.lVal++;<br />
item.lVal *= (-1);<br />
}<br />
parameter_start += 32;<br />
SafeArrayPutElement (PVAVLISTAVALORESPARAMETROS.parray,&k,&item);<br />
VariantInit(&item);<br />
break;<br />
case VT_R4:<br />
break;<br />
|
|
|
|