|
|
|
Someone gave me this COM DLL to use in my project (co-worker).
The DLL is written in VB.
After doing the #import, I cannot compile. There are references to a "_ErrObjecPtr" (ErrObject smart ptr).
But the ErrObject doesn't resolve in C++...
Any clues out there?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
I have set the item in a ListCtrl via the statement:-
m_cListCtrl.SetItemState(m_nSelectItem, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
But how do you arrange for the item to be shown as selected as if it was selected by a mouse click?
grahamfff
|
|
|
|
|
m_cListCtrl.SetItemState
(m_nSelectItem,
LVIS_SELECTED | LVIS_FOCUSED,
LVIS_SELECTED | LVIS_FOCUSED); /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Did try your suggestion but nothing highlighted.
Are they any additional properties I need to set?
grahamfff
|
|
|
|
|
I did also try and modify the CodeProject sample ListCtrlDemo as floows but no luck:-
void CListCtrlDemoDlg::OnItemSelect() <br />
{<br />
UpdateData(TRUE);<br />
<br />
int nCount = m_cListCtrl.GetItemCount();<br />
if (m_nSelectItem >= nCount)<br />
{<br />
AfxMessageBox(_T("You entered an out of range index."));<br />
m_nSelectItem = 0;<br />
}<br />
else<br />
{<br />
m_cListCtrl.EnsureVisible(m_nSelectItem, FALSE);<br />
m_cListCtrl.SetItemState(m_nSelectItem, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);<br />
}<br />
UpdateData(FALSE);<br />
<br />
}
grahamfff
|
|
|
|
|
i am also having the same problem as this guy :P
thanks
Tyrus
|
|
|
|
|
Just got it working:-
m_cDisplayList.SetItemState(m_nSelectedList, LVIS_DROPHILITED | LVIS_SELECTED, LVIS_DROPHILITED | LVIS_SELECTED);
grahamfff
|
|
|
|
|
how do you make it multi select like a list box? instead of needing to hold ctrl
|
|
|
|
|
Try
<br />
DWORD dwStyle = m_cListCtrl.GetExtendedStyle();<br />
dwStyle |= LVS_EX_FULLROWSELECT;m_cListCtrl.SetExtendedStyle(dwStyle);
grahamfff
|
|
|
|
|
I have set the item in a ListCtrl via the statement:-
m_cListCtrl.SetItemState(m_nSelectItem, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
But how do you arrange for the item to be shown as selected as if it was selected by a mouse click?
grahamfff
|
|
|
|
|
|
Sorry for this post, but I cannot find anything about this in WWW.
I am adding a function with struct variable (using wizard function add) typing
Function(struct*) and I am getting this:
Function ($S1) in cpp and Function(struct *) in the h file.
Of course, the compiler complains about missing definition.
Is this a known bug?
Thanks Vaclav
|
|
|
|
|
Odd. What steps do I need to do in order to reproduce it?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hi, is there a programmatic way to override the setting you see in Date/Time Properties (Time Zone) for "Automatically adjust clock for daylight saving changes"?
What i notice, even with using GMT+0 Universal Coordinate Time time-zone, is that this setting still effects the representation of local time.
I am familiar with the TZ environment variable and also using this with the _tzset() function. Here is a summary of my findings:
TZ = GMT+0GMT<br />
Time Zone set to (GMT) Greenwich Mean Time: Dublin, Edinburgh, London<br />
CHECKED - Automatically adjust clock for daylight saving change<br />
calling _tzset() then calling the fns (yielded)
GetTimeZoneInformation(&tzInfo) ==> TIME_ZONE_STANDARD and<br />
GetTimeZoneInformation(&tzInfo) ==> TIME_ZONE_DAYLIGHT<br />
for local date/times in respective daylight saving range. WHY????
johnny
|
|
|
|
|
I'm not following the problem here. What is happening versus what you think should happen?
john john mackey wrote:
calling _tzset() then calling the fns (yielded)
GetTimeZoneInformation(&tzInfo) ==> TIME_ZONE_STANDARD and
GetTimeZoneInformation(&tzInfo) ==> TIME_ZONE_DAYLIGHT
How does calling GetTimeZoneInformation(&tzInfo) yield TIME_ZONE_STANDARD and TIME_ZONE_DAYLIGHT ? Did tzInfo change in between calls?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
With the "Automatically adjust for daylight saving changes" set (checked), even if I select Greenwich Mean Time (UTC, Zulu, etc...) the GetTimeZoneInformation(&tzInfo) still returns either TIME_ZONE_STANDARD or TIME_ZONE_DAYLIGHT (depending on the time setting).
It is my assumption that Greenwich Time does NOT observe daylight saving (do the Brits in Greenwich observe Daylight Saving). I thought that Greenwich or UTC is the reference point for time in the world, and thus the time zones. I thought UTC should not itself distinguish its time between TIME_ZONE_STANDARD or TIME_ZONE_DAYLIGHT.
The test i tried were with times on 09 Sep 2004 (or a "daylight time") and 09 November 2004 (a "standard time"). I expected to see only one result from GetTimeZoneInformation(&tzInfo).
Johnny, (still )
|
|
|
|
|
The confusion is the double use of GMT to define 'time' and 'time zones'.
I am in London - UK (10 miles from Greenwich). My Windows time zone is set to (GTM). Local time here is 18:15:31. But GMT is 17:15:31, an hour behind. This is because in the UK (like the US) we observe 'day light saving', so in the 'summer half' of the year we are one hour ahead of GMT. But this does not change our time zone which is still (GMT)
General rule is that your local time only corresponds to your selected Windows GMT timezone during the winter months. For the summer months it is your GMT zone + 1.
|
|
|
|
|
Thanks for the clarification. I had thought that Microsoft had a time zone for "GMT" or UTC, aka, "Zulu" time - the one that does not switch due to Daylight Saving.
Anyways, still looking for a programmatic way to set the "Automatically adjust clock for daylight saving changes" check-box in Date/Time, Time Zone properties.
Regards,
Johnny
USA
|
|
|
|
|
Thanks for the clarification. I had thought that Microsoft had a time zone for "GMT" or UTC, aka, "Zulu" time - the one that does not switch due to Daylight Saving.
Anyways, still looking for a programmatic way to set the "Automatically adjust clock for daylight saving changes" check-box in Date/Time, Time Zone properties.
Regards,
Johnny
USA
|
|
|
|
|
I have the following code to set one of the menu items as a default one (it should go bold), however the menu item is not displayed bold for some reason:
MENUITEMINFO menuItemInfo;<br />
menuItemInfo.cbSize = sizeof(MENUITEMINFO);<br />
menuItemInfo.fMask = MIIM_STATE;<br />
VERIFY(pSubMenu->GetMenuItemInfo(IDC_SHOWWINDOW,&menuItemInfo));<br />
menuItemInfo.fMask = MIIM_STATE;<br />
menuItemInfo.fType = MFS_ENABLED|MFS_DEFAULT;<br />
VERIFY(pSubMenu->SetMenuItemInfo(IDC_SHOWWINDOW,&menuItemInfo));
Both GetMenuItemInfo() and SetMenuItemInfo() are successful as they return 1, but I cannot figure out why it doesn't display the menu item as bold.
Any help would be greatly appreciated
Thanks
|
|
|
|
|
Try to change menuItemInfo.fType = MFS_ENABLED|MFS_DEFAULT; // Type has MFT_
with fState = MFS_ENABLED|MFS_DEFAULT;
|
|
|
|
|
I have tried that but for some reason it does not seem to work, that is why I asked the question in the 1st place.
Thanks
|
|
|
|
|
I suggest you that you can use another function like this in API: SetMenuDefaultItem(hMenu,IDM_,FALSE);
|
|
|
|