|
When you have a UGCT_NORMALMULTILINE cell the text is always drawn top centre.
Change:
void CUGCellType::DrawText(CDC *dc,RECT *rect,int offset,int col,long row,CUGCell *cell,int selected,int current)
{
if(cellTypeEx&UGCT_NORMALMULTILINE)
{
CRect tempRect(rect);
UINT format = DT_WORDBREAK | DT_NOPREFIX;
if(alignment) {
if(alignment & UG_ALIGNCENTER) {
format |= DT_CENTER;
}
else if(alignment & UG_ALIGNRIGHT) {
format |= DT_RIGHT;
tempRect.right -= m_ctrl->m_GI->m_margin + offset;
offsetRect.right -= m_ctrl->m_GI->m_margin + offset;
}
else if(alignment & UG_ALIGNLEFT) {
format |= DT_LEFT;
tempRect.left += m_ctrl->m_GI->m_margin + offset;
offsetRect.left += m_ctrl->m_GI->m_margin + offset;
}
}
else
{
format |= DT_LEFT;
tempRect.left += m_ctrl->m_GI->m_margin + offset;
offsetRect.left += m_ctrl->m_GI->m_margin + offset;
}
if (!m_useThemes || !DrawThemedText(*dc, tempRect.left, tempRect.top, &tempRect, string, stringLen, format, cell->GetXPStyle(), state))
{
dc->DrawText(string,-1,tempRect,format );
}
}
To:
if(cellTypeEx&UGCT_NORMALMULTILINE)
{
CRect tempRect(rect);
UINT format = DT_WORDBREAK | DT_NOPREFIX;
<code>
if (alignment & UG_ALIGNCENTER) {
format |= DT_CENTER;
}
else if (alignment & UG_ALIGNRIGHT) {
format |= DT_RIGHT;
}
else {
format |= DT_LEFT;
}
if (format & (DT_CENTER|DT_RIGHT)) {
tempRect.right -= m_ctrl->m_GI->m_margin + offset;
offsetRect.right -= m_ctrl->m_GI->m_margin + offset;
}
if (format & (DT_CENTER|DT_LEFT)) {
tempRect.left += m_ctrl->m_GI->m_margin + offset;
offsetRect.left += m_ctrl->m_GI->m_margin + offset;
}
if (alignment & (UG_ALIGNBOTTOM|UG_ALIGNVCENTER)) {
CRect calcRect(tempRect);
int textHeight = dc->DrawText(string, -1, calcRect, format|DT_CALCRECT);
if (alignment & UG_ALIGNVCENTER) {
tempRect.top += (tempRect.bottom - tempRect.top - textHeight) / 2;
}
else {
tempRect.top = (tempRect.bottom - textHeight);
}
}
</code>
if (!m_useThemes || !DrawThemedText(*dc, tempRect.left, tempRect.top, &tempRect, string, stringLen, format, cell->GetXPStyle(), state))
{
dc->DrawText(string,-1,tempRect,format );
}
}
}
The main functional change is the adjustment to tempRect.top using the results from a DrawText with DT_CALCRECT .
In addition I made UG_ALIGNCENTER use the margins. I think this is better because a DrawText with DT_WORDBREAK can cause the text to be drawn right out to the edges which doesn't look very good.
Another minor note - the calls to GetTextExtentPoint in CUGCellType::DrawText should probably be GetTextExtentPoint32 (see MSDN documentation for more details). Also the second occurrence of GetTextExtentPoint is surplus to requirements.
Regards
Allen
|
|
|
|
|
Thanks again - will have a look at this for the next udpate.
Tim
|
|
|
|
|
I have edited the code I supplied above:
if (alignment & UG_ALIGNVCENTER) {
tempRect.top = (tempRect.bottom - tempRect.top - textHeight) / 2;
has changed to:
if (alignment & UG_ALIGNVCENTER) {
tempRect.top += (tempRect.bottom - tempRect.top - textHeight) / 2;
The previous code was moving the tempRect down relative to the grid drawing area rather than the cell drawing area (which looked OK when you are using ALIGNVCENTER only in the top heading!)
|
|
|
|
|
IMPORTANT CAUTION
Grid implementations developed before this change may not appear as expected or desired!
Users should be aware that the change to apply the left and right margins to multiline cells with UG_ALIGNCENTER may cause DrawText to draw the text using more lines than the previous versions. This is because the drawing width is decreased by m_ctrl->m_GI->m_margin pixels on both the left and right.
|
|
|
|
|
We have been using Ultimate Grid in our application for a long time. I have only taken over responsibilty for it in the last few months. I have implemented the latest Ultimate Grid into our code a few months ago but have only just come across a problem I have been unable to solve.
In our spreadsheet, certain columns can be toggled on and off via a menu. When the menu item is selected the column is resized to 0 so that it does not show and then back again to the original size. This all works fine.
The problem is when a column is 'hidden' and resized to 0, the column to the left of it can not be resized manually by dragging with the mouse. You first have to drag out the 'hidden' column first before you can resize the column to the left of it.
In the old Ultimate Grid the cursor used to change as you ran the mouse over the column edges, if you wanted to resize the 'hidden' column it was a double arrow "<-||->" and when you wanted to resize the column to the left of it it was the standard "<-->".
In the new Ultimate Grid this no longer appears to work?
I have tried using OnCanSizeCol() to not allow the 'hidden' column to be resized, however this then has the affect of not allowing the column to the left to be resized either.
I understand that I could remove and insert the column however then I would lose the data and I am reluctant to make such a change to the code as we are very late into our development cycle.
Am I missing something? Is there another way to 'hide' columns? I have read through the forums and help and can not find an answer. Any help would be greatly appreciated.
|
|
|
|
|
Interesting - I don't think I have the code that behaves this way, but yes I can see your point.
Looking at MS Excel, I can see something like what you're describing - hide two columns and the different cursors appear depending on the left proximity to the separation - doesn't seem to work for the right side, though.
There is a function used by the top heading that looks like it might be modified to accomplish something like:
If the cursor is within 1 pixel either side of the separation, we're sizing the shown column. If the cursor is within 2 - 4 pixels of the right side, we're sizing the column immediately to the right of the visible column. If 2-4 on left, we're sizing the last of the hidden columns to the right of the separation.
Don't know what you would do with the center of three hidden cols.
This code in CUGTopHdg::CheckForUserResize modifies member vars that tell the topheading which column is being sized, and incorporates a proximity check (this is called from OnMouseMove - but also comes into play for OnLButtonDBLClk , which might require some thought) - I think something might be done here, with the addition of another cursor in CUGGridInfo .
if(point->x < width+3 && point->x > width-3)
{
if(m_ctrl->GetColWidth(col+1) == 0 && (col+1) < m_GI->m_numberCols)
col++;
if(m_ctrl->OnCanSizeCol(col) == FALSE)
return;
m_canSize = TRUE;
m_colOrRowSizing = 0;
m_sizingColRow = col;
m_sizingStartSize = m_ctrl->GetColWidth(col);
m_sizingStartPos = point->x;
SetCursor(m_GI->m_WEResizseCursor);
return;
}
}
Maybe a derived CUGTopHdg class could be used to play with this, keeping the new cursor in the derived class for now. Would be a nice feature - might get a little complicated in the details.
Tim
|
|
|
|
|
Hi Tim
Thanks very much for getting back to me, this is exactly the information I was needing.
Also sorry for the confusion, I believed that our product had been using UG for longer than it had been, and the example spreadsheet I was comparing with that had the double arrow for resizing 'hidden' columns was derived from a totally different spreadsheet control, not an earlier UG!
Cheers and many thanks
Kerrie
|
|
|
|
|
Hello Kerrie;
did you succeed in sizing hidden columns?
Would you share your code?
Martin
|
|
|
|
|
Hello Tim;
Do you have plans to implement the complete solution for sizing with hidden columns?
Martin
|
|
|
|
|
No, not on my immediate stack - in the 'to consider' folder.
Maybe Kerrie will share a mod here - would be nice, but might have some detail bits that will need to be tailored to different users.
Feel free.
Tim
|
|
|
|
|
 Hi Tim and Matin
Unfortunately due to time constraints I was unable to implement the full solution I would have liked here. (We have just gone beta now so time is still an issue)
I did however use Tim's suggestion to derive my own CUGTopHdg class, and over-ride the CUGTopHdg::CheckForUserResize function and 'fixed' my problem of not allowing the 'hidden' 0 sized columns to be resized at all.
I simply removed the code as shown below in this code snippet. I don't believe this has had any effect to our spreadsheet in terms of the mouse move or double click because of how it has been set up. I have done quite a bit of testing on this too...(but you never know!)
Sorry I can't be of any more help. I do have plans to get back to this at a later date...
void CLGTopHdg::CheckForUserResize(CPoint *point)
{
if(m_GI->m_userSizingMode == FALSE)
return;
int width = 0;
for(int col = 0;col < m_GI->m_numberCols;col++)
{
if(col == m_GI->m_numLockCols && col < m_GI->m_leftCol)
col = m_GI->m_leftCol;
width += m_ctrl->GetColWidth(col);
if(width > m_GI->m_gridWidth)
break;
if(point->x < width+3 && point->x > width-3)
{
<big>
if(m_ctrl->OnCanSizeCol(col) == FALSE)
return;
m_canSize = TRUE;
m_colOrRowSizing = 0;
m_sizingColRow = col;
m_sizingStartSize = m_ctrl->GetColWidth(col);
m_sizingStartPos = point->x;
SetCursor(m_GI->m_WEResizseCursor);
return;
}
}
int height = m_GI->m_topHdgHeight;
for(int row = 0; row < m_GI->m_numberTopHdgRows; row++)
{
if(point->y < height+3 && point->y > height-3)
{
if(m_ctrl->OnCanSizeTopHdg() == FALSE)
return;
m_canSize = TRUE;
m_colOrRowSizing = 1;
m_sizingColRow = row;
m_sizingStartSize = m_GI->m_topHdgHeights[row];
m_sizingStartPos = point->y;
m_sizingStartHeight = m_GI->m_topHdgHeight;
SetCursor(m_GI->m_NSResizseCursor);
return;
}
height -= m_GI->m_topHdgHeights[row];
}
if(m_canSize)
{
m_canSize = FALSE;
SetCursor(m_GI->m_arrowCursor);
}
}
|
|
|
|
|
I Built Dlls using VC2005 and tried to use it.
m_grid1.AttachGrid(this, IDC_GRID);
The above line gives the following error:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. Thisi s usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
I tried __cdecl, __stdcall, __fascall. All gives the same error.
How can I fix this problem?
HR
|
|
|
|
|
This has come up before, without resolution - see this thread[^].
I've tried reproducing it with no luck.
Does the Use UG DLL sample show the same problem?
Tim
|
|
|
|
|
 Use UG DLL works but it is a bit different in the source:
m_grid.CreateGrid( WS_CHILD|WS_VISIBLE, CRect(0,0,0,0), this, 234222 ); // Use UG DLL
But mine is :
m_grid.AttachGrid( this, IDC_GRID ); // Run time Check error
Call Stack is shown below:
UGMFCDU.dll!1006b8b2()
[Frames below may be incorrect and/or missing, no symbols loaded for UGMFCDU.dll]
UGMFCDU.dll!1006c7ad()
> AutoTraderEventReceiver_DYF.exe!CAutoTraderEventReceiverDlg::OnInitDialog() Line 159 C++
mfc80ud.dll!AfxDlgProc(HWND__ * hWnd=0x000319a0, unsigned int message=0x00000110, unsigned int __formal=0x00021958, unsigned int __formal=0x00021958) Line 28 + 0x10 bytes C++
user32.dll!77cf8734()
user32.dll!77d0413c()
user32.dll!77d03b30()
user32.dll!77d03d5c()
user32.dll!77cf8734()
user32.dll!77cf8816()
ntdll.dll!7c94277f()
user32.dll!77d0a013()
user32.dll!77d0a039()
mfc80ud.dll!CWnd::DefWindowProcW(unsigned int nMsg=0x00000110, unsigned int wParam=0x00021958, long lParam=0x00000000) Line 1029 + 0x20 bytes C++
mfc80ud.dll!CWnd::Default() Line 274 C++
mfc80ud.dll!CDialog::HandleInitDialog(unsigned int __formal=0x00021958, unsigned int __formal=0x00021958) Line 676 + 0x8 bytes C++
mfc80ud.dll!CWnd::OnWndMsg(unsigned int message=0x00000110, unsigned int wParam=0x00021958, long lParam=0x00000000, long * pResult=0x0012f4f4) Line 2004 + 0x11 bytes C++
mfc80ud.dll!CWnd::WindowProc(unsigned int message=0x00000110, unsigned int wParam=0x00021958, long lParam=0x00000000) Line 1741 + 0x20 bytes C++
mfc80ud.dll!AfxCallWndProc(CWnd * pWnd=0x0012f8f8, HWND__ * hWnd=0x000319a0, unsigned int nMsg=0x00000110, unsigned int wParam=0x00021958, long lParam=0x00000000) Line 240 + 0x1c bytes C++
mfc80ud.dll!AfxWndProc(HWND__ * hWnd=0x000319a0, unsigned int nMsg=0x00000110, unsigned int wParam=0x00021958, long lParam=0x00000000) Line 389 C++
mfc80ud.dll!AfxWndProcBase(HWND__ * hWnd=0x000319a0, unsigned int nMsg=0x00000110, unsigned int wParam=0x00021958, long lParam=0x00000000) Line 411 + 0x15 bytes C++
user32.dll!77cf8734()
user32.dll!77cf8816()
user32.dll!77d0927b()
user32.dll!77d0651a()
user32.dll!77d0683e()
user32.dll!77d1f03a()
mfc80ud.dll!CWnd::CreateDlgIndirect(const DLGTEMPLATE * lpDialogTemplate=0x00431950, CWnd * pParentWnd=0x00000000, HINSTANCE__ * hInst=0x00400000) Line 315 + 0x2a bytes C++
mfc80ud.dll!CDialog::DoModal() Line 579 + 0x20 bytes C++
AutoTraderEventReceiver_DYF.exe!CAutoTraderEventReceiverApp::InitInstance() Line 71 + 0xb bytes C++
mfc80ud.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020c68, int nCmdShow=0x00000001) Line 37 + 0xd bytes C++
AutoTraderEventReceiver_DYF.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020c68, int nCmdShow=0x00000001) Line 33 C++
AutoTraderEventReceiver_DYF.exe!__tmainCRTStartup() Line 589 + 0x35 bytes C
AutoTraderEventReceiver_DYF.exe!wWinMainCRTStartup() Line 414 C
kernel32.dll!7c817067()
Would this be a hint?
modified on Tuesday, January 6, 2009 6:50 PM
|
|
|
|
|
I can run the BasicDlg sample (Ex3 - in Examples\BasicDlg) linking to the DLL in VS2005.
Can you load the 'Build DLL VC2005' sln and debug? When prompted browse for your apps debug build.
This should weed out any errant DLL being picked up, and might give a better call stack re the UG code.
If you can send me a simple project that demos the problem I'm happy to have a look. (tim@codeproject.com).
Baffled.
Tim
|
|
|
|
|
Running the BasicDlg Sample (Ex3) using the full UG source code works fine, but after removing the UG sources and using UG DLL raises another Access Violation error.
As you said, I debugged the Build DLL solution and got the Access Violation error. Actually, I didn't even get to the m_grid.AttachGrid statement at all yet.
The call stack is as follows:
> 00000001()
ntdll.dll!7c9332a8()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!7c93327a()
ntdll.dll!7c95a9ef()
ntdll.dll!7c93e46a()
kernel32.dll!7c80e534()
ntdll.dll!7c93fc97()
ntdll.dll!7c93fda2()
ntdll.dll!7c93fdbd()
ntdll.dll!7c93dacc()
ntdll.dll!7c942dc8()
kernel32.dll!7c810634()
...
...
ntdll.dll!7c93db2c()
kernel32.dll!7c810677()
kernel32.dll!7c810693()
kernel32.dll!7c80e534()
kernel32.dll!7c80e63b()
ntdll.dll!7c9332a8()
ntdll.dll!7c93327a()
ntdll.dll!7c95a9ef()
ntdll.dll!7c93e46a()
kernel32.dll!7c80e534()
ntdll.dll!7c93fc97()
ntdll.dll!7c93fda2()
ntdll.dll!7c93fdbd()
ntdll.dll!7c93dacc()
ntdll.dll!7c942dc8()
You should be able to reproduce it easily if you use DLL built by VC2005 SP1.
If not, why don't you remotely connect my PC and debug it yourself?
If you add my MSN id (haerim@investware.net), I can tell you how you can connect me.
Sample project was sent to your codeproject email.
HR
|
|
|
|
|
Ok thanks - yes, I think release builds will assert when this problem shows up.
But, now that I think of it you may need to bring in the Ole stuff for that sample - so this should probably be added to the stdafx.h of Ex3:
...
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxole.h>
#include <afxdisp.h>
#ifdef _DEBUG
#ifdef _UNICODE
#pragma message("Automatically linking with UGMFCDU.lib - please make sure this file is built.")
#pragma comment(lib, "..\\..\\DLLs\\UGMFCDU.lib")
#else // not unicode
#pragma message("Automatically linking with UGMFCD.lib - please make sure this file is built.")
#pragma comment(lib, "..\\..\\DLLs\\UGMFCD.lib")
#endif // _UNICODE
#else // RELEASE
#ifdef _UNICODE
#pragma message("Automatically linking with UGMFCU.lib - please make sure this file is built.")
#pragma comment(lib, "..\\..\\DLLs\\UGMFCU.lib")
#else // not unicode
#pragma message("Automatically linking with UGMFC.lib - please make sure this file is built.")
#pragma comment(lib, "..\\..\\DLLs\\UGMFC.lib")
#endif // _UNICODE
#endif // _DEBUG
You'll get all manner of assertions linking with the wrong lib, so just want to be sure.
Tim
|
|
|
|
|
Adding those headers solved the Access Violation Error, and Ex3 now works for AttachGrid function call.
However, my project still gives the same error even after I add afxole.h and afxdisp.h.
HR
|
|
|
|
|
It works now!!!
#include <afxole.h>
The above line seems to be answer for the Run-time Check error or Access Violation Error.
Can you explain why we need it even though we don't need to successfully compile the project?
HR
|
|
|
|
|
The grid code needs the OLE stuff for the drag/drop operations, which is why it's enabled in the DLL build. The MFC code changes are significant in certain areas wrt whether OLE is enabled, which is where things foul up in an non-OLE app.
If you're not using OLE in your app, and don't need drag/drop in the grid, you could probably recompile the DLL with those headers removed, and things should work.
I think I had tried testing this earlier, but didn't see the Run-Time check. Maybe the grid is not on the main app dialog, which probably would have caused an ASSERT or access violation earlier.
Glad you solved it - there have been other people bitten by this in different ways, and it has been suggested that there should be a better approach to compiling/selecting OLE enabled DLLs - or at least warninging the user somehow that OLE is or is not enabled in the lib.
Tim
|
|
|
|
|
The views in the cox#DTabView demo are having initInstance called twice. This caused the demo to crash (after I added a COXBackgroundPainter Object to the client views.
I patch the init instance to return at the start if it was being called again for the same object and the code runs.
1st call
CdentrxView::OnInitialUpdate() Line 118 C++
CWnd::OnWndMsg(unsigned int message=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000, long * pResult=0x0012e418) Line 2028 C++
CWnd::WindowProc(unsigned int message=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000) Line 1741 + 0x20 bytes C++
AfxCallWndProc(CWnd * pWnd=0x02b5ba68, HWND__ * hWnd=0x000f0c1e, unsigned int nMsg=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000) Line 240 + 0x1c bytes C++
AfxWndProc(HWND__ * hWnd=0x000f0c1e, unsigned int nMsg=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000) Line 389 C++
COX3DTabViewContainer::AddPage(CRuntimeClass * pClass=0x0093ff48, CCreateContext * pContext=0x0012fae0, const char * lpszTitle=0x0093ec68, int nImage=0x00000001, unsigned long dwExStyle=0x00000200, int bActivate=0x00000001) Line 410 + 0x33 bytes C++
.
.
.
CWnd::SendMessageA(unsigned int message=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000) Line 42 + 0x42 bytes C++
COX3DTabViewContainer::InsertPage(int nIndex=0x00000001, CRuntimeClass * pClass=0x0093ff48, CCreateContext * pContext=0x0012fae0, const char * lpszTitle=0x0093ec68, int nImage=0x00000001, unsigned long dwExStyle=0x00000200, int bActivate=0x00000001) Line 421 C++
COX3DTabViewContainer::AddPage(CRuntimeClass * pClass=0x0093ff48, CCreateContext * pContext=0x0012fae0, const char * lpszTitle=0x0093ec68, int nImage=0x00000001, unsigned long dwExStyle=0x00000200, int bActivate=0x00000001) Line 410 + 0x33 bytes C++
CChildFrame::OnCreateClient(tagCREATESTRUCTA * lpcs=0x0012ec34, CCreateContext * pContext=0x0012fae0) Line 120 + 0x25 bytes C++
CFrameWnd::OnCreateHelper(tagCREATESTRUCTA * lpcs=0x0012ec34, CCreateContext * pContext=0x0012fae0) Line 634 + 0x18 bytes C++
CMDIChildWnd::OnCreate(tagCREATESTRUCTA * lpCreateStruct=0x0012ec34) Line 1044 C++
2nd call
DOnInitialUpdate() Line 118 C++
CWnd::OnWndMsg(unsigned int message=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000, long * pResult=0x0012f9c0) Line 2028 C++
CWnd::WindowProc(unsigned int message=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000) Line 1741 + 0x20 bytes C++
AfxCallWndProc(CWnd * pWnd=0x02b5ba68, HWND__ * hWnd=0x000c0d1a, unsigned int nMsg=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000) Line 240 + 0x1c bytes C++
CWnd::SendMessageToDescendants(HWND__ * hWnd=0x000e0d32, unsigned int message=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000, int bDeep=0x00000001, int bOnlyPerm=0x00000001) Line 2524 C++
CWnd::SendMessageToDescendants(HWND__ * hWnd=0x00120c0e, unsigned int message=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000, int bDeep=0x00000001, int bOnlyPerm=0x00000001) Line 2534 C++
CWnd::SendMessageToDescendants(unsigned int message=0x00000364, unsigned int wParam=0x00000000, long lParam=0x00000000, int bDeep=0x00000001, int bOnlyPerm=0x00000001) Line 170 + 0x20 bytes C++
CFrameWnd::InitialUpdateFrame(CDocument * pDoc=0x02b57b80, int bMakeVisible=0x00000001) Line 750 C++
CDocTemplate::InitialUpdateFrame(CFrameWnd * pFrame=0x02b5b5b8, CDocument * pDoc=0x02b57b80, int bMakeVisible=0x00000001) Line 330 C++
> CMultiDocTemplate::OpenDocumentFile(const char * lpszPathName=0x00000000, int bMakeVisible=0x00000001) Line 166 C++
CDocument* CMultiDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName,
BOOL bMakeVisible)
BOOL CWinApp::ProcessShellCommand(CCommandLineInfo& rCmdInfo)
|
|
|
|
|
hi,
i put my UGrid in a caption-less dialog as fully docked (grid covers all client area). i want to move that dialog when i left click and move my mouse on UG Top Heading. i tried to handle MyCug::OnLClicked of UGrid and post
((CUGridDlg*)GetParent())->PostMessage(WM_LBUTTONDOWN, HTCAPTION, MAKELPARAM(point->x, point->y));
inside to notify parent dialog but it seems it doesn't work.
But when i post the same message on parent dialog LButtonClicked event and move my dialog when i drag a client region dialog moves.
what should i do to move my dialog by dragging my mouse on one of my THeading rows?
thx.
|
|
|
|
|
hi,
i solved my problem. take a look at;
void MyCug::OnTH_LClicked(int col,long row,int updn,RECT *rect,POINT *point,BOOL processed)
{
((CGridDlg*)GetParent())->SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, NULL);
}
PostMessage does not work here.
atilla.
|
|
|
|
|
When I tried to compile the "Use UG Dll" project, I got the following link error:
Linking...
MyCUG.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: static struct AFX_MSGMAP const CUGCtrl::messageMap" (__imp_?messageMap@CUGCtrl@@1UAFX_MSGMAP@@B)
..\..\DLLs\Use UG DLL.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
How to fix this?
HR
|
|
|
|
|
Hi
I can reproduce this if I try building the Use UG DLL project in VS2005 against a DLL that was built with VC6 - I'd suggest rebuilding the DLLs (BuildDLL project) for the VC version you want to use - remember to do a batch build to build all the configs.
Tim
|
|
|
|
|