|
Hi
I am trying to display tool tip text on icons placed on CFormView. I am using these functions:
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipText)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipText)
BOOL CDashboardView :: OnToolTipText (UINT id,
NMHDR *pNMHDR,
LRESULT *pResult)
{
BOOL result = TRUE; /* Operation result */
CString strTipText; /* tool tip text */
UINT nID = -1; /* Identifier */
TOOLTIPTEXTA* pTTTA = NULL;
TOOLTIPTEXTW* pTTTW = NULL;
CPoint point; /* current cursor point */
pTTTA = (TOOLTIPTEXTA*)pNMHDR;
pTTTW = (TOOLTIPTEXTW*)pNMHDR;
nID = pNMHDR->idFrom;
if (nID != 0 )
{
// Identify button rect, copy text
for (long ii = 0; ii < m_arrLineupBtnRect.GetSize(); ii++)
{
GetCursorPos (&point);
ScreenToClient (&point);
if (m_arrLineupBtnRect[ii].PtInRect(point))
{
strTipText = m_sButtLineups[ii].m_strToolTip;
}
}
// Copy tool tip text
if (pNMHDR->code == TTN_NEEDTEXTA)
{
lstrcpyn(pTTTA->szText, strTipText, strTipText.GetLength());
}
else
{
_mbstowcsz(pTTTW->szText, strTipText,strTipText.GetLength());
}
*pResult = 0;
}
return result;
}
My problem is that the tool tip text has about 280characters. The program crashes at the line lstrcpyn(pTTTA->szText, strTipText, strTipText.GetLength()); It works fine for about 80 characters in tool tip text.
Is there any limit for the tool tip text.
Thanks
Madhavi
|
|
|
|
|
|
Dear All
I should write one program which uses parallel port of computer in ECP mode.
I should use CreateFile and DeviceIOControl routines for this purpose.
Is there any resource that help me about this project.
another problem :
When I include both stdafx.h and ntddk.h in my project, I find that some redefinition errors and warnings occured.
some variables and structures are defined in both ntddk and some header file which is defined in some other header files.
Does anyone have any idea to remove this problem.
REgards
Mahdi
|
|
|
|
|
ntddk.h is a file used in driver development - it should not be included in user-mode programs. Use CreateFile to open a handle to the parallele port, then control it via commands you issue with the DeviceIOControl. You need to be looking for a document that describes the available IOCTL commands that can be issued via DeviceIOControl. And, no, I don't know where one is.
Judy
|
|
|
|
|
Hello everyone!
I'm sure this is just me missing something really stupid but I can't see what it is. I'm trying to play around with non-client drawing on top level windows, so I found the MSDN page for WM_NCPAINT and it said the following snippet will retrieve the window DC and set the clipping region:
case WM_NCPAINT:
{
HDC hdc;
hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN);
ReleaseDC(hwnd, hdc);
} However, I've entered this into my program and GetDCEx always returns NULL and what's stranger still is that GetLastError always returns ERROR_SUCCESS!
I'm running Windows Vista with the DWM enabled so I checked MSDN for anything DWM related that may be stopping me and found you need to set the DWMWA_ALLOW_NCPAINT to TRUE. So I did that and still GetDCEx and GetLastError return NULL and ERROR_SUCCESS respectively. I tried calling without the DCX_INTERSECTRGN flag or the clipping region and still it returns NULL.
Eventually I became lazy and used GetWindowDC as a hack which did actually return a device context that allowed me to paint on the frame. I was under the impression that GetWindowDC(hWnd) is just a wrapper for GetDCEx (hWnd, NULL, DCX_WINDOW) but obviously this isn't the case.
Has anyone else experienced anything like this before? Or does anyone have any idea what may be happening?
I'm using MFC7 with VC7 and latest version of the Windows SDK.
Many thanks,
Kier.
|
|
|
|
|
According to MSDN, If DCX_CACHE is not specified and the window is neither CS_OWNDC nor CS_CLASSDC, this function returns NULL.. Have you use Spy++ to look at the window properties?
BTW, thanks for formatting your code with PRE - makes it a lot easier to read.
Best wishes,
Hans
|
|
|
|
|
Hi,
Is there any API/MFC to remove temporary internet files.
Warm Regards,
Mushq
|
|
|
|
|
You can use GetSpecialFolder(/*parameter*/) and then delete all the files in the temp folder using DeleteFile(/*parameter*/).
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hello
I well understand the mechanism of Double Buffering and find a lot of samples, where text or lines were
drawn over the CDC *pDC, which i also understand.
But is it possible to draw textboxes over a CDC *pDC?
Because in my OnSize function i resize the groupboxes and slide all textboxes via MoveWindow.
I could use a MoveWindow without redrawing an set an Invalidate or Redraw if the view to redraw the entire view with the changings.
But i also need to redraw the groupboxes, so they begin to flicker during moving.
Is it possible to redraw a textbox into a OnDraw(CDC *pDC) Handler?
Thanks for answers
|
|
|
|
|
Do you want to customize EditBox?
|
|
|
|
|
No, i like to draw all components to a ScreenBuffer (textboxes,groupboxes,CStatics,...) then, after
redrawing all controls, the screen should draw one time the ScreenBuffer.
The ScreenBuffer is a copy of the CDC *pDC and lines,texts are drawn into the buffer.
But how to draw a textbox into the buffer
Thanks for your answer
|
|
|
|
|
Hi,
While debugging in VC++, I wish to goto the previous statement? Is it possible ? if so can you please explain. For example if my cursor is at statement 10 and i want to move to statement 9.
Thanks in advance.
|
|
|
|
|
Just click on the cursor at the current position and drag it to the statement from which you want to continue.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi _AnShUmAn_
I tried to click the arrow but even I can not place the cursor on top of the arrow.
Am using VC++ 6.0 editor.
|
|
|
|
|
HI All,
I have to download a file(in binary format) from a remote server.
The problem: The problem is that the firewall will see an HTTP connection and in that stream it will look at the headers and find that it is binary (Content-type: application/octet-stream). This will cause it to assemble the stream on the firewall and inspect it thus stripping the attachments that are in binary form.
Any ideas on how can this be achieved?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I want to check in my VC++ code if a file is blocked. Normally when exe files are transferred over email, they will be blocked.If you go to the property of the file, you will see "Security: This file came from another computer and might be blocked to help protect this computer" and there will be a button to unblock it. I have to programmatically check this case. Is there any API or function that could help me get this information.
Thanks in advance.
Ranjan
|
|
|
|
|
hello everybody sorry to disturb u again
i connect vc++ with mysql
but it gives the error that
Cannot open include file: 'mysql.h': No such file or directory
on compile time
thanks
hi
|
|
|
|
|
I saw your problem morning and searched for it but it seems you didnt get my reply but I think you need to install mysql anyway see www.mysql.com and download section maybe it will be helpful for you.
|
|
|
|
|
how to focus the label box when tab key is moved around it.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Hi,
does the TabStop property to TRUE resolves your problem.
Or, without the Ressouce-Manager via ModifyStyle(0,WS_TABSTOP);
Good luck
|
|
|
|
|
And in the continues with baerten use of Ctrl+D for sort number for control when use of Tab Ctrl.
|
|
|
|
|
Hi all,
I have developed an application as an installation in VC++. I am using Visual Studio 2005. I have used Launch Condition Editor for checking whether .NetFramework has been installed or not. If it is installed only, the installation should take place. But, when I am trying to install in a system having .NetFramework also, the installation doesn't work. It returns that the .NetFramework is not installed.
I have referred this link for implementing the check : Support From Microsoft[^]
Can anybody please help me....
Thanks in Advance...
-- modified at 23:28 Monday 7th May, 2007
|
|
|
|
|
If you can't get it to work that way, you could always use this technique.
BTW, your link doesn't work.
Best wishes,
Hans
|
|
|
|
|
how to load bitmap to radio button ,checkbox
|
|
|
|
|
This class shows how to use bitmap.
Best wishes,
Hans
|
|
|
|