|
gcView.obj : error LNK2019: unresolved external symbol "public: int __thiscall CGridCtrl::SetColumnCount(int)" (?SetColumnCount@CGridCtrl@@QAEHH@Z) referenced in function "protected: virtual void __thiscall CgcView::OnInitialUpdate(void)" (?OnInitialUpdate@CgcView@@MAEXXZ)
I get this for any function I use from CGridCtrl. What am I doing wrong?
|
|
|
|
|
pleas modify the command "m_arColWidths.InsertAt(nColumn, (int)0);"
to m_arColWidths.InsertAt(nColumn,(UINT)0);
WILSON
A LIKE SOFTWARE AND QUALITY MAN
|
|
|
|
|
This happens when I build:
Compiling...
StdAfx.cpp
WINVER not defined. Defaulting to 0x0501 (Windows XP and Windows .NET Server)
Compiling...
GridCtrlDemoDlg.cpp
GridCtrlDemo.cpp
GridCtrlDemo.cpp(44) : warning C4996: 'CWinApp::Enable3dControls' was declared deprecated
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxwin.h(4369) : see declaration of 'CWinApp::Enable3dControls'
GridURLCell.cpp
GridCellCombo.cpp
TitleTip.cpp
GridCtrl_src\TitleTip.cpp(314) : error C2360: initialization of 'pts' is skipped by 'case' label
GridCtrl_src\TitleTip.cpp(275) : see declaration of 'pts'
GridCtrl_src\TitleTip.cpp(315) : error C2360: initialization of 'pts' is skipped by 'case' label
GridCtrl_src\TitleTip.cpp(275) : see declaration of 'pts'
InPlaceEdit.cpp
GridDropTarget.cpp
GridCtrl.cpp
GridCtrl_src\GridCtrl.cpp(2214) : warning C4244: 'initializing' : conversion from 'ULONGLONG' to 'DWORD', possible loss of data
GridCtrl_src\GridCtrl.cpp(3490) : error C2668: 'CUIntArray::InsertAt' : ambiguous call to overloaded function
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(341): could be 'void CUIntArray::InsertAt(INT_PTR,CUIntArray *)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(338): or 'void CUIntArray::InsertAt(INT_PTR,UINT,INT_PTR)'
while trying to match the argument list '(int, int)'
GridCtrl_src\GridCtrl.cpp(3565) : error C2668: 'CUIntArray::InsertAt' : ambiguous call to overloaded function
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(341): could be 'void CUIntArray::InsertAt(INT_PTR,CUIntArray *)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(338): or 'void CUIntArray::InsertAt(INT_PTR,UINT,INT_PTR)'
while trying to match the argument list '(int, int)'
GridCellBase.cpp
GridCell.cpp
Generating Code...
c:\documents and settings\richard\my documents\grid\gridctrl_demo221\gridctrl_demo221\newcelltypes\gridcellcombo.cpp(455) : warning C4702: unreachable code
c:\documents and settings\richard\my documents\grid\gridctrl_demo221\gridctrl_demo221\newcelltypes\gridcellcombo.cpp(456) : warning C4702: unreachable code
Build log was saved at "file://c:\Documents and Settings\Richard\My Documents\Grid\gridctrl_demo221\gridctrl_demo221\Debug\BuildLog.htm"
GridCtrlDemo - 4 error(s), 4 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
|
|
|
|
|
I have modified your code that if WS_TABSTOP is not on, then OnLButtonDown will not call SetFocus(). This is very important for our touch screen POS system.
and also can you add column default font? usually display text description on one column and dollar amount on other.
eric feng
www.infospec.com
|
|
|
|
|
Well I'm quite new to MFC programming, so this might be a more general question. How can I Capture one of the GridCtrl specific messages in my View? For example the begin editing Message?
Thnx for any answers..
Sebastian
|
|
|
|
|
Hi,
We have downloaded a Grid Control project from Code project named GridCtrlDemo.
While creating dynamically i need to add a vertical scroll bar to the control.
Can any one help me in this regard.
Nandini
|
|
|
|
|
I Can't Find "mfc42u.lib" File.
LINK : fatal error LNK1104: cannot open file "mfc42u.lib"
Error executing link.exe.
Creating browse info file...
|
|
|
|
|
Sounds like you need to have unicode support and you're probably not going to get it. (IE I don't think MS ever expects to release anything for 9X world) Search the project settings and header files for #define's. I havn't actually downloaded this code, but somewhere in it it's referencing the UNICODE version of MFC.
<<edit>>
I don't know if the code has been updated or not, as I probably should of downloaded it before I posted a solution. The current project settings have support for both UNICODE and ANSI modes (Look at the different project settings). If you're in the 9X world, just select "Win32 Release" or "Win32 Debug" from the all ready defined project settings.
|
|
|
|
|
I'm running on WINXP Pro. Tried compiling under both VC++.net and VC++6 same error in both.
Any ideas where to download the MFC unicode version?
[edit] i think ive found it in SP2 for VC++6
|
|
|
|
|
find mfc42u.lib file or
in your VC , Build -> Set Active Configuration ->
Select Win32 Debug or Win32 Release
Cheers!!
|
|
|
|
|
mfc42u.lib File not found
|
|
|
|
|
because
error LNK1104: cannot open file "mfc42u.lib"
...........
.........
...........
|
|
|
|
|
How can I use events like OnGridDblClick or OnGridClick when using it in a view ?
Thanks in advance for your help
|
|
|
|
|
In the resource editor, add a new Resource Symbol for the Grid, like IDC_GRID
After you create the grid control, use SetDlgCtrlID() to assign it the ID like the following:
<br />
m_pGridCtrl = new CGridCtrl;<br />
if (!m_pGridCtrl) return;<br />
<br />
CRect rect;<br />
GetClientRect(rect);<br />
m_pGridCtrl->Create(rect, this, 100);<br />
m_pGridCtrl->SetDlgCtrlID(IDC_GRID);
In your view class message map you can then add the notify commands and appropriate handlers just as in the Dialog based version, I.E.
<br />
ON_NOTIFY(NM_CLICK, IDC_GRID, OnGridClick)<br />
ON_NOTIFY(NM_DBLCLK, IDC_GRID, OnGridDblClick)<br />
-HTH
|
|
|
|
|
Thanks for posting this. After upgrading the project from VC6 to VS2010 I found all grid control messages for CView no longer received messages but dialogs were fine. Previously they were passed through using WS_CHILD
Previous usage of the following no longer works in later versions
m_ptblgrid->Create(gridrect,this,WS_CHILD);
ON_NOTIFY(NM_CLICK, WS_CHILD, OnGridClick)
modified 17-Aug-12 22:03pm.
|
|
|
|
|
First, Thank you for the excellent grid control. It is very useful to me.
Now, for the question:
What is the correct way to close out the editing operation on a cell that is active at the time that I wish to collect the data values and store them? In other words, if a user edits a cell and leaves the focus in the cell and then clicks my "Save Data" button (or exits the dialog), how do I tell the grid control that the editing on the current cell is finished?
It would seem that the right routine to call would be CGridCtrl::EndEditing(), but is a protected, virtual method.
On a related matter, I found that if I destroy the CGridCtrl object while a cell is open for editing, Windows triggers an exception when CInPlaceEdit::OnKillFocus is called after the call of CGridCtrl::DeleteAllItems() from the destructor.
|
|
|
|
|
I have to display 100000´s of datacells. the virtual mode is perfectly for this. But the editing of the cells is not working:
I´m using OnNotify & GVN_ENDLABELEDIT. The Problem is that everytime calling the GetText-function returns the old and not the new value of the cell.
Interestingly the value get lost by calling the OnNotify function, because in the CInEditPlace::EndEdit()-function the new value is used for calling
<br />
OnNotify(........)<br />
{<br />
......<br />
else if(GVN_ENDLABELEDIT==pDispInfo->hdr.code)<br />
{<br />
CString x;<br />
int y;<br />
TRACE("ENDLABELEDIT");<br />
NM_GRIDVIEW *pItem = (NM_GRIDVIEW *)pDispInfo;<br />
CGridCellBase *pCell =m_pGridCtrl->GetCell(pDispInfo->item.row,pDispInfo>item.col);<br />
y=m_pGridCtrl->IsCellEditable(pDispInfo->item.row,pDispInfo->item.col);<br />
x=pCell->GetText();<br />
}<br />
Thanks in advance for helping me with this Problem
dominik
|
|
|
|
|
Hi, Chris!
thanks for your grid control.
I have one question.
column header is ok, but..
I wanna hide row headers (column0) like listctrl.
Is it possible?
I'll be wating for your answer.
desafinado
|
|
|
|
|
I think this is a typo. It should have been m_pGrid instead, so the over all code becomes
<br />
if (m_pGrid == NULL)
{<br />
m_pGrid = new CGridCtrl;
if (!m_pGrid) return;<br />
<br />
CRect rect;
GetClientRect(rect);<br />
m_pGrid->Create(rect, this, 100);<br />
<br />
m_pGrid->SetRowCount(20);
m_pGrid->SetColumnCount(10);<br />
<br />
}<br />
<br />
<br />
I could not get it to compile, until I made the changes as shown above
|
|
|
|
|
It is (was) absolutely a type. All fixed.
cheers,
Chris Maunder
|
|
|
|
|
For some reason, every example of yours does not have and edge on the grid conrol. But when I use it I can't seem to get ride of the edge no matter what flags I use in the create call or the modifiyWindow call.
Any suggestions?
Regards,
Rick
|
|
|
|
|
The grid itself sets the window style to have a client edge. You'll have to manually change this in the gridctrl.cpp file.
cheers,
Chris Maunder
|
|
|
|
|
Try this in your CView::OnInitialUpdate()
if (m_pGrid == NULL)
{
m_pGrid = new CGridCtrl;
if (!m_pGrid ) return;
CRect rect;
GetClientRect(rect);
m_pGrid->Create(rect, this, 100,WS_CHILD | WS_VISIBLE);
m_pGrid->ModifyStyleEx(WS_EX_CLIENTEDGE, 0,0);
} John
|
|
|
|
|
The grid works perfectly.
I just don't know how to implement the dbl click event on a cell.
I'd like to know when the user dbl clicked on a cell and then I would handle this event as I want.
Life is short. Drink Faster
|
|
|
|
|
Hi
I am a beginner with grid control (and with MFC).
I add the files and some lines in my project to display a grid in the MainFrame. When I use ReDrawRow(x) it returns TRUE and I can see the Main Frame but the grid has been diplayed in the Main Frame.
Someone can help me?
thank you
Martin
|
|
|
|