|
Hello,
I've created a simple doc/view application using a list view in report mode
with 2 columns with the extended styles LVS_EX_FULLROWSELECT and
LVS_EX_INFOTIP set via:
DWORD dwStyle = GetListCtrl().GetExtendedStyle();
GetListCtrl().SetExtendedStyle(dwStyle|LVS_EX_FULLROWSELECT|LVS_EX_INFOTIP);
in OnInitialUpdate().
The MSDN Documentation says:
"This notification is only sent by list-view controls that have the
LVS_EX_INFOTIP extended style. The LVN_GETINFOTIP notification is sent for
sub-items while in report mode only when the LVS_EX_FULLROWSELECT extended
style is in use."
I've added my message map:
ON_NOTIFY_REFLECT(LVN_GETINFOTIP, OnGetInfoTip)
and the function:
void CInfotipView::OnGetInfoTip(NMHDR* pnmhdr, LRESULT* pResult)
{
NMLVGETINFOTIP* pnmlvgit = (NMLVGETINFOTIP*) pnmhdr;
ASSERT(pnmlvgit);
}
When I run the application, I DO get an InfoTip notification when
positioning the mouse overtop of the 1st column in the list view BUT NOT
over the 2nd column. MY understanding (and correct me if I'm
misunderstanding the documentation) is that with LVS_EX_FULLROWSELECT set, I
should also receive a notification when positioning the mouse overtop of the
2nd column.
I have tried testing this both compiling with Visual Studio 6 & 7 and
running the test under both Windows 200 and Windows XP.
Any help is greatly appreciated.
Thanks,
Chris Holt
|
|
|
|
|
I'm following a sample project and they are creating a progressctrl in the staus bar: After defining a progressCtrl object in the mainframe, they have:
int CWzdStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatusBar::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rect(0,0,0,0);
m_WzdProgressCtrl.Create(WS_CHILD|WS_VISIBLE,rect,this,IDC_WZD_PROGRESS);
return 0;
}
What I'm puzzled by is where is IDC_WZD_PROGRESS generated. They didnt draw it on any dialog or anything. Yet there is an entry
C:\swanke\A31\RESOURCE.H(9):#define IDC_WZD_PROGRESS 104
The only ID_ s I have seen generated have been for a control drawn on some dialog form, and the resource.h gets the entry automatically.
I hope you can see my dilemma,
thanks,
ns
|
|
|
|
|
int CPaletteStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatusBar::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rect(0,0,0,0);
m_THBImageRainbow.Create("Rainbow", WS_CHILD, rect, this, IDC_THBIMAGERAINBOW);
return 0;
}
I havent drawn the image control anywhere, and the compiler says:
C:\PaletteStatusBar.cpp(43) : error C2065: 'IDC_THBIMAGERAINBOW' : undeclared identifier
So how do I generate this IDC ?
Very confused...
|
|
|
|
|
I'm not sure, but I think you can 'add Strings' in the String Table which is shown on the resources tab, and lists out IDs.
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
If you are using VS6:
- Go to resource tab
- Right click on the project name in the tree
- Select Resource symbols
- Press New button
Pavel
Sonork 100.15206
|
|
|
|
|
They just defined it themselves. They picked an arbitrary number that wasn't used is all.
Nothing special.
If using VC 6, and you view the 'Resources' tab, you can select 'View|Resource Symbols' from the main VC menu.
Just click on the 'New' button in the dialog and create a new ID and assign it an ID.
Remember, controls need identifiers. The resource editor assigns them automatically because it's our friend and tries to do things for us.
But when you're doing things manually, you'll have to use this process.
Chris
|
|
|
|
|
Ah! MAny thanks. That worked. Appreciate it!
ns
|
|
|
|
|
I am creating my own class derived from CStatusBar, and will embed an imagecontrol in it, called m_THBImageRainbow. Now in my view class, I need to populate this box with an image through a function defined in the view class. If m_THBImageRainbow had been a view class member I'd have done:
ShowTHBImage(m_rainbow.GetImageSize(), m_rainbow.GetImagePointer(), &m_THBImageRainbow)
but my m_THBImageRainbow is a member of my new statusbar class. How will I access this?
Instead of &m_THBImageRainbow , what will it be?
I'll have MyStatusBar m_wndStatusBar; in the mainframe.
So to get at it in view :
((CMainFrame*)AfxGetMainWnd())->m_wndStatusBar.m_THBImageRainbow) , but where will the & go?
<code>&</code>((CMainFrame*)AfxGetMainWnd())->m_wndStatusBar.m_THBImageRainbow)
or somewhere else in there?
Thanks,
ns
|
|
|
|
|
Hi !
I need some grid control to display data in a table format with the avalability of recognizing clicks no cells and so on.
I rememeber seeing an article here that was perfet for me but I cant find it.
Any help is welcome, just dont recommand the MS FlexGrid, I hate it
Thanks,
Shay Harel
|
|
|
|
|
Best grid control here you can find on the CP homepage - first item in Most Popular section - Chris Maunder's MFC Grid control 2.24;).
Pavel
Sonork 100.15206
|
|
|
|
|
Great, exactly the one I was looking for
|
|
|
|
|
I am trying to come up to a crawl using VC6. I have been using Optima++. Under Optima I could save the current project and create a new one by using the Save Project As button under the file menu and providing a new name Ie.. test1, test2, test3 and so on. I have been unable to figure out how to do the same thing with VC6. What I want to do is save a current project, but create a new one based on the original for modification, so that I don't screw up the original. Is there a way to do this?
Steve Daly
|
|
|
|
|
No .
You can of course copy the project directory. If you want to rename it also, you need to edit dsp and dsw files in text editor.
Pavel
Sonork 100.15206
|
|
|
|
|
ever thought of using sourcesafe? or another CVS? I like the idea of revisioning code. I use it in JBuilder all the time, kinda the same way Word handles revisions.
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
Has anyone come across resources on how to architect FDI models as opposed to MDI. I am starting out a new project and I would like to use an architecture similar to VS.NET. Workspaces in my application will be able to contain any number of document modules (dynamically load a new document type). Just wondering if anyone has found any tutorials or discussions on such a model?
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
Hi.
I would like to know the best way to initialize a constructor in a virtual base base. For example,
[code]
// Base class
class Base()
{
public:
A(int i = 0);
virtual void printA() const = 0;
};
// Derived classes
class X() : public virtual Base
{
public:
X(char a, int j);
virtual void printA();
};
X::X(char a, int j)
{
char temp = a;
A::A(j);
}
class Y() : public virtual Base
{
public:
Y(long x, int k);
virtual void printA();
};
Y::Y(long x, int k)
{
long temp = x;
A::A(k);
}
// Next level down in hierarchy
class Z(); public X, public Y
{
public:
Z(...?...); // What data do I need here to construct X, Y, and Base?
...
};
Z::Z(...?...)
{
// Do you contruct class X, Y, or Base first?
}
// Implementation
Z example(...?...); // You need to construct Base first.
[/code]
I know the question is very basic to polymorphic C++ programming. Nonetheless, it is something that want really want to understand.
Thanks,
Kuphryn
|
|
|
|
|
When deriving from a Base through a virtual intermediate, it is your responsibiliy to construct the object base --none of the constructors supplied by the derived virtual classes is applied. If you don't specify a constructor, default is used.
Apart from this, the syntax you using is incorrect. It should be like:
X::X(char a, int j): A(j)
{
char temp = a;
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Okay. Thanks.
Please give an example of how to construct the base from that example.
Kuphryn
|
|
|
|
|
When inheriting from a virtual baseclass, it's always the responsibility of the "most derived" class to invoke the constructor of the virtual baseclass. The way you invoke initialization from a constructor is well documented.
I suggest, and I do this to be nice, you don't try to use virtual baseclasses until you learn and understand at least the syntax and semantics for initialization. To give you a starting point; you initialize anything from a C++ constructor like:
class A
{
A() : v(0) {}
int v;
};
|
|
|
|
|
Okay. I admit the sample had code errors. You could look up syntax in a reference book. I wanted to understand the concept.
Kuphryn
|
|
|
|
|
I have a CStringArray with filenames, and I want to run through these and open a new MDI child for each file.
I can open a file through 'File->Open', but don't get how to achieve this without bringing up the SelectFile Dialog.
Is there a just message I need to send?
TIA,
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
Use CWinApp::OpenDocumentFile method.
Pavel
Sonork 100.15206
|
|
|
|
|
Thanks, still not quite there, though.
I've implemented this:
CDocument* pDoc = AfxGetApp()->OpenDocumentFile(Filename);<br />
if(pDoc != NULL)<br />
pDoc->UpdateAllViews(NULL);
and get an exception error assigning pDoc.
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
Your code worked for me OK using Copy&Paste.
In CMainFrame menu command handler.
Where are you using it in your app hierarchy?
Are the document templates initialized (in InitInstance)?
Pavel
Sonork 100.15206
|
|
|
|
|
Pavel Klocek wrote:
Your code worked for me OK using Copy&Paste
So I'm not completely lost, then.
Pavel Klocek wrote:
Where are you using it in your app hierarchy?
void CMainFrame::PVCSGet(CString Filename)<br />
{<br />
...<br />
CDocument* pDoc = AfxGetApp()->OpenDocumentFile(Filename);<br />
...<br />
}
documents are getting initialized, I can open documents from File->Open.
BW
{insert witty/thought-provoking saying here}
|
|
|
|