|
for(long nfram = 0; nfram < pColFrames->length ; nfram ++)
{
_variant_t vIdx(i, VT_I4);
_variant_t vDisp;
vDisp = pColFrames->item(&vIdx);
if(vDisp.vt == VT_DISPATCH)
{
vDisp.pdispVal->QueryInterface(IID_IHTMLElement,(void**)&pElem);
...................//rest of operation
}
}
but always if(vDisp.vt == VT_DISPATCH) will fail...means vDisp.vt become empty.
|
|
|
|
|
Hi,
How can I load image from resource using gdi Image class?
|
|
|
|
|
Yes, this is possible.
I believe it can be done like this:
Image myImage = global::MyNamespace.Properties.Resources.MyResource;
|
|
|
|
|
Can you suggest me expample or link to do so...
|
|
|
|
|
Did you read the forum title, didn't you?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
is the code too advanced for you? do you really want 20th century code, you should move on, we're in 2011 already.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc Pattyn wrote: is the code too advanced for you?
Do you mean 'verbose'? Yes it is verbose.
Teacher: "Luc, please tell us about the steam engine details."
Luc: "You know, nuclear power plants..."
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
See Loading and Displaying Bitmaps[^], the 'load icon' example looks promising.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You mean the GDI+ Image class?
If so, you could use the Bitmap::Bitmap(HINSTANCE,WCHAR*) constructor or the static Bitmap::FromResource() method.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Have created a custom control from ListView ctrl for displaying images in grid manner.
Images are displayed in grid manner.
1 2 3 4 5
6 7 8 9 a
b c d e f
g h i j k
now when i press SHIFT key and click item 1 and continue to press SHIFT key and then click item d
then the items are selected in following columnwise manner
1 2 3 4 5
6 7 8 9 a
b c d e f
g h i j k
this is not as per standard windows explorer behavior which selects items row wise
1 2 3 4 5
6 7 8 9 a
b c d e f
g h i j k
please suggest how selection can be made rowwise by SHIFT + click
Any thing which i should specify in style of the ctrl?
thanks.
|
|
|
|
|
What you are observing is the default behaviour of windows explorer when it is in Tiles view mode. The behaviour you are expecting is the behaviour of windows explorer in Thumbnails, Icons, or List view modes. So I suggest you take your ListView out of Tile view mode and use Icon or List view mode.
|
|
|
|
|
even in tiles view the selection happens row wise.
am trying for rowwise selection but getting column wise selection
what style i should specify in ListView_SetExtendedListViewStyle()?
or use any other function..
|
|
|
|
|
My apologies, my initial observations were incorrect. All I can suggest is to try using other views to the one you are using at the moment, use LVM_SETVIEW to change the view.
|
|
|
|
|
Hello everybody !
this is a SDI Project,in the toolbar,there are two button,it used to show different dialog.
class CTestView;
void CTestView::OnShowDlgA()
{
CPropertySheet sheet(_T("TestDlgA"));
CTestDlgA dlg;
sheet.AddPage(&dlg);
if(IDOK == sheet.DoModal())
{
}
}
void CTestView::OnShowDlgB()
{
CPropertySheet sheet(_T("TestDlgB"));
CTestDlgB dlg;
sheet.AddPage(&dlg);
if(IDOK == sheet.DoModal())
{
}
}
class CTestDlgA : public CPropertyPage
{
}
void CTestDlgA ::OnOK()
{
if( !SaveParams() )
return;
EndDialog(IDOK);
}
class CTestDlgB : public CPropertyPage
{
}
void CTestDlgB ::OnOK()
{
if( !SaveParams() )
return;
EndDialog(IDOK);
}
Why will appear this kind of circumstance?
Thanks for your reply !
Best Regards !
modified on Wednesday, May 11, 2011 3:34 AM
|
|
|
|
|
Please edit your message and add <pre></pre> tags around your code so it is readable.
The best things in life are not things.
|
|
|
|
|
|
What is the question?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Koma Wang wrote: Why will appear this kind of circumstance?
This makes no sense. Please explain.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
1. i have a SDI window application which open images
2. i have created a search dialog which reads excel as database and loads the datas into the listbox(listview) which resides on the same window.
3. upon user click over the list view content, the image get opened in the SDI window and i need to preserve the search results.
now i able to retrieve the item in the list box (list view) and send it to the Filebrowser() procedure....and opened the file using a global variable..
<br />
<br />
void SearchDlg::OnItemChanged(NMHDR* pNMHDR, LRESULT* pResult)<br />
{<br />
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; <br />
CString Coll = "";<br />
LV_ITEM itemSelected;<br />
int nSelected = lstCtrl.GetNextItem(-1,LVNI_SELECTED);<br />
<br />
if(nSelected == -1) <br />
{<br />
AfxMessageBox("No more item selected");<br />
}<br />
TCHAR szTeamName[80];<br />
itemSelected.iItem = nSelected;<br />
itemSelected.iSubItem = 9;<br />
itemSelected.mask = LVIF_PARAM | LVIF_TEXT;<br />
itemSelected.pszText = szTeamName;<br />
itemSelected.cchTextMax = 50;<br />
lstCtrl.GetItem(&itemSelected);<br />
<br />
CString* pMessage = (CString*) itemSelected.lParam;<br />
Coll+=szTeamName; <br />
Coll+="\\";<br />
TCHAR temp[2] = "\\";<br />
Coll.TrimRight(temp);<br />
GetsubItems(Coll);<br />
*pResult = 0;<br />
}<br />
<br />
<br />
void SearchDlg::GetsubItems(CString csItem)<br />
{<br />
CString tem_drive = GetDriveName();<br />
CString csFormAbsolutePath = ""; <br />
csFormAbsolutePath = "Files\\" + csItem; <br />
ReturnPathToFileOpen(csFormAbsolutePath);<br />
}<br />
Here i enabled search dialog, according to the search criteria, it lists the results in the listview upon user clicks i need to open the image. here subitem name(usually file name)gives the filename. i want to open the file in the client area.
<br />
CSearchDlg ObjSearch;<br />
ObjSearch.DoModal();<br />
Here the Fileopen was implemented in CImageView.cpp
inside i get the filename with path using global variable, here i couldn't preserve the search results.
i want to know what wrong i did here and how to implement the same.
|
|
|
|
|
lamrinraj wrote: here i couldn't preserve the search results. I'm not sure what you mean by that, but it sounds like you're not saving the search results somewhere that's accessible by the search dialog. Is that what you mean?
|
|
|
|
|
Intially, the search dialog box contains the empty list view. Once click the fetch button it will fetch all the records from the excel file and loads into that list.
Once i close the search dialog manually or by accident,, the next opening time of the dialog the results will not be there. Again i have press the fetch button to get the list. This is because am recreating the search dialog window at each opening.
This is the situation where i have to preserve the previous fetching results on that listview.
I have also tried one method to preserve by calling the API ShowWindow(SW_HIDE) method. But it hides the entire (main) application.
|
|
|
|
|
Do not use DoModal. Hiding modal dialog is not going to help, since main app window is disabled.
Use modeless dialog and toggle visibility as you need.
JohnCz
MS C++ MVP
|
|
|
|
|
Hello,
Which design pattern would you recommend to use, if i want to separeate data from the Business logic in c++ ?
Thanks,
Berlus
|
|
|
|
|
Have a look into MVC architecture[^] to check if this fits your needs.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
If you are interested in design pattern than go through this link
->[^]
Sometimes I create a COM component for Business logic in C++.
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
|
|
|
|