|
Try this:
POSITION Pos = GetFirstViewPosition();
ASSERT( Pos ); // Check to see if it returns a valid value.
CGeneratorView* pView = (CGeneratorView*)GetNextView( Pos );
pVeiw->OnPopupRemove();
or:
POSITION Pos = GetFirstViewPosition();
ASSERT( Pos );
CGeneratorView* pView = reinterpret_cast< CGeneratorView* >( GetNextView( Pos ));
pView->OnPopupRemove();
The dynamic_cast is best, you need to enable the RTTI in you build options to use this. It is better checking than the reinterpret_cast which does nothing.
Now, This is assuming that OnPopupRemove is a public method.
Larry
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
cool..that worked.
Thanks a LOT Larry!!
|
|
|
|
|
No Problimo! Glad I could help.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
CGeneratorView *pFirstView = (CGeneratorView *) GetNextView(pos);<br />
pFirstView->OnPopupRemove();
|
|
|
|
|
Your casting was wrong
You should have done it this way...
/********Your Code *****************/
(CGeneratorView *)pFirstView-> OnPopupRemove();
/************************************/
/********Suggestion*****************/
((CGeneratorView *)pFirstView)-> OnPopupRemove();
/************************************/
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
I want to display files in listview using icons associated with file ext.
but I can't find where does window store info about files to extract icons from. Can somebody tell me how to do that ?.
Thanks in advance.
|
|
|
|
|
One solution is SHGetFileInfo().
Kuphryn
|
|
|
|
|
probably i lost my eyes looking 2 hours in msdn for this function.
Thanks for your help.
|
|
|
|
|
Hi,
I have a virtual (LVS_OWNERDATA) list control working just fine. Only problems is I can't programatically change an item's state. Docs say that the virtual list view does manage selection+focus state, and, when I click around, it surely does. But SETITEM, modifying the state, returns false, and does nothing.
Any ideas?
[edit] found it - LVM_SETITEM doesn't work, but LVM_SETITEMSTATE does. (yes, I was filling the LVITEM correctly)[/edit]
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Post the code that sets the item state.
Kuphryn
|
|
|
|
|
thx - found it (LVM_SETITEM doesn't work for the virtual ctrl, but LVM_SETITEMSTATE does)
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Hi!
How to extand and access the internat Office object structure.
Is there any Dev Kit for Microsoft Partners that in not available to "normal" users?
Something like NOKIA back entrence!?
gicio
|
|
|
|
|
ifstream fs("demo.txt" );
'fs' uses undefined class 'basic_ifstream<char,struct std::char_traits<char=""> >'
C:\IniFile.cpp(59) : error C2440: 'initializing' : cannot convert from 'char [9]' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.
This is the constructor
ifstream( const char* szName, int nMode = ios::in, int nProt = filebuf::openprot );
what am i missing ?
|
|
|
|
|
Do you have the right #include files in place? Is the UNICODE directive defined?
|
|
|
|
|
no it hasnt been defined . so what are the includes that I need ?
|
|
|
|
|
This worked for me:
#include < fstream.h >
void main( void )
{
ifstream fs("demo.txt");
}
|
|
|
|
|
Hello all,
Is there a C++ regex library in MFC I can easily use? What about without MFC (ie. command line app)?
I've been reaquainting myself with C++ and have been using Borland's Bcc32 compiler but I do have VS.NET and can do MFC.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
MFC does not provide such a class. You might want to search CodeProject, or use Google to do a broader search.
|
|
|
|
|
Check out the Boost[^] library. They have a regular expression parser.
Brad
|
|
|
|
|
A mighty fine package too!
--
Frivolous Theorem of Arithmetic: Almost all natural numbers are very, very, very large.
|
|
|
|
|
Yeah, if you can compile it all right...
I was succesful in compiling bjam (their 'make' like tool) and then compiled the regex libraries (ironically, using 'make'). Now when I import it (#include <boost regex.hpp="">), however, one of the *.LIB files cannot be located (BOOST_REGEX_BCB5_SSS.LIB).
C++ newbie time: how does one resolve this easily?
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
|
In atlrx.h file you can find regular expression classes that ship with VC.NET.
|
|
|
|
|
Hi!
I tried to use http://www.codeproject.org/miscctrl/colour_picker.asp in my project. In my dialog it works well!!!
But if i use in in a ttolbar (without using the ColourPick class) the popup is displayed for about 1sec and then it dissapears.
<br />
void CWordChildFrame::OnToolbarDropDown(NMTOOLBAR *pnmtb, LRESULT *)<br />
{ <br />
CRect rc;<br />
m_wndStyleBar.SendMessage(TB_GETRECT, pnmtb->iItem, (LPARAM)&rc);<br />
m_wndStyleBar.ClientToScreen(&rc);<br />
<br />
new CColourPopup(CPoint(rc.left,rc.bottom), <br />
COLORREF(RGB(255,255,255)), &m_wndStyleBar, "Auto","More"); <br />
}<br />
The strange is, that if i remove the "//", the message box is displayed and then the colorpicker works well. It is shown until i click on a color.
What have a done wrong?
Thanks mike
|
|
|
|
|
It's hard to say without knowing how the CColourPopup class works. Have you tried contacting the developer of the class?
As a side note, I want to point out that creating the CColourPopup object like you're doing (with new) is bad practice since the memory does not appear to be released. If each CColourPopup object does not somehow delete itself, it will remain in memory forever and more will come as the user keeps popping it on the toolbar.
Regards,
Alvaro
Hey! It compiles! Ship it.
|
|
|
|