|
Hi,
I have some problem with the tooltip control. I have enabled the tooltip control for my DialogBOx. I have drawn little boxes on to my Dialog Box. On each Box I have given different Tooltip Text in WM_MOUSEMOVE. Every thing is working fine but in some places Tooltip is blinking. I mean text is appearing and disappearing very fastly. But in other places on Dialog Box tool tip is stable. Can any one tell me What is happening ?
Thanks & Regards,
Deliver
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
Hi,
R u using the RelayEvent(pMsg) in the dialog's PreTranslateMessage, if so then check the rect size for that particular control which is blinking with the one which you would have used while creating the tooltip using the AddTool function. Have a look @ CPropertySheet::GetTabControl @ msdn, it does have an example on using the tooltip control
Sujan
|
|
|
|
|
Hi,
Here i am providing the steps
In Dialog's header add
CToolTipCtrl tooltip;
in Dialog's on initdialog add
tooltip.Create(this,TTS_ALWAYSTIP);
CWnd *pWnd = GetDlgItem(IDC_BUTTON_BC1);
tooltip.AddTool(pWnd,"Hello Testing ",NULL,NULL);
Add the PreTranslateMessage for the dialog and add the following code
tooltip.RelayEvent(pMsg);
This will work. I think you shouldn't you on mouse move
Sujan
|
|
|
|
|
Hai frens. . .
I am facing a prblm in SDI.
My SDI will be in maximized state initially. . .
So, i do like this. . ShowWindow(SW_MAXIMIZE).
After that i want that maximize button disabled so i remove the style WS_MAXIMIZEBOX. IF i do so the SDI will be maximized initially but it becomes MOVABLE. How to handle this. . .I need it to be immovable.
Plz help me with this prblm
Tanx
|
|
|
|
|
Hello,
You can simply take the handle of the SystemMenu using GetSystemMenu and remove the Move menu. The code goes like this...
void CMainFrame::DisableMoveWindow()
{
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
pSysMenu->RemoveMenu(1, MF_BYPOSITION);
}
}
Call this function in the OnCreate of CMainFrame()
Vikram Kashyap
"You will never fail until you stop trying"
|
|
|
|
|
Thanx Vikram prblm solved. .
|
|
|
|
|
Thanx Vikram prblm solved. . .
|
|
|
|
|
I'm have a program with muti-threads,it's handles is increasing continually,how to find handles belong to thread or process?Do you have a tool?Thanks a lot!
|
|
|
|
|
|
Read a string from a file and wirte to a oracle's database,but display a incorrect string,help me !!Thanks
|
|
|
|
|
If you want to stick to APIs, you call MultiByteToWideChar() to go from ANSI to UTF-16, then WideCharToMultiByte() to go back to UTF-8.
--
I'm Michael Dunn and I approve this post.
Vote Trogdor in oh-four!
|
|
|
|
|
Hi,
I am developing a dll in C and I have one problem that I don't know how to solve...
An external application invokes my dll by calling the function:
int calculateParameters(int, int)
I need to return to the application the value "OK" indicating that the passed parameters are correct as soon as possible, and then do the needed calculations and pass the result of the calculations to the external application using a callback function.
How can I do so that after the function returns "OK", the previously created thread could continue alive and do the appropiate calculations and invoke the callback funtion?
Here is the simplified code of this dll:
// Function invoked from the external application
int calculateParameters(int a, int b)
{
_beginthread(sumParameters, 0, valorTmp); //Create a thread to calculate
if (a > b) return OK; //As soon as this function returns, the thread previously created is stopped and no calculation is done
}
//Function needed to perform the internal calculations
void sumParameters(void *valorTmp)
{
z = a + b; //Example of calculations
Callback(y); //Pass the result of the calculations to the external application
}
Thank you very much for your help
|
|
|
|
|
Hi All,
I am working with a CDialog object that opens three other dialogs using a tab control. I seem to be getting stuck trying to pass commands back to the main dialog so they can be sent to the comm port all together.
How can i either trigger an event handler from the tabbed dialog into my main dialog or change variables and call functions in my main dialog from the three dialogs that are created by the first.
I have tried right clicking on buttons and controls on my tabbed dialogs and adding event handlers to the main dialog but they do not seem to give a responce. Is there any code that i should add to get the main dialog to recognise an event that is not triggered by the dialog that it directly creates?
Any help would be great.
Geoffreyhunter
|
|
|
|
|
|
I want an Edit Control in my application (which compiles in MBCS, I can not easily change that) to accept Unicode.
So far, I have been successful in the sense that my control takes Chinese, Japanese, Greek etc., but it still does not take Indic languages (e.g. Hindi).
I created the control via CreateWindowExW():
<br />
RECT r;<br />
r.top = 90;<br />
r.left = 40;<br />
r.bottom = 150;<br />
r.right = 170;<br />
<br />
HWND edithwnd;<br />
edithwnd = CreateWindowExW(<br />
WS_EX_NOPARENTNOTIFY,<br />
(WCHAR*)L"Edit",
NULL,
WS_VISIBLE | WS_CHILD,
r.left,
r.top,<br />
r.right - r.left,<br />
r.bottom - r.top,<br />
this->m_hWnd,
(HMENU) MAKEINTRESOURCEW(988),
AfxGetInstanceHandle(),
NULL<br />
);<br />
I created the control inside a dialog which was derived from the MFC class CDialog. I create the control in the OnInitDialog() function of the dialog.
Well, this edit control does apparently support Unicode, but not to the full extend, since it does not accept the aforementioned Indic languages. I have already tried the various subclassing / superclassing approaches which are described on MSDN, but with the same result.
I found an example from Microsoft:
http://www.microsoft.com/msj/0499/multilangunicode/multilangunicode.aspx[^]
Here, F.A. Bishop uses the DialogBoxParam() function to create a dialog box from a resource. This dialog DOES support Hindi! I tried it in my test program and it worked. According to the MSDN documentation, DialogBoxParam() basically uses a createwindowex to create the dialog and the edit control.
Therefore I assume that my problem is connected to the dialog I create it in... but how....? Do I also have to create the containing dialog with CreateWindowExW() ? And if yes, how can I "adjust" my MFC-dialog in that way ?
Thanks for your help!
|
|
|
|
|
I have a MFC dialog application with many modeless dialogs. Now I wish to have one of these dialogs use the Most Recently Used files option.
The Main dialog uses the MRU option OK. But nothing works for this sub-window. Both are using the same ID_RECENT_FILES resource.
Is it possible to use MRU in two places?
Graham.
grahamfff
|
|
|
|
|
Hi Friends,
I am struck up with catching verticall scrollbar on ClistControl.
I have dialog box. which contains Listcontrol. but i am trying to catch wm_vscroll event on scrolling vertically. since this message belongs to window. event is not triggedred.
I am new to vc++6.0. Please reply to this post.
I am stuggling on his.
Please send me the reply to purushothambc@orange.co.uk or bcpurshi@rediffmail.com
Your help is appreciated.
Thank in advance
Purushotham
|
|
|
|
|
Hi, gurus:
Does anyone know how to change the screen size layout programmatically?
This is the case:
I am changing the screen resolution programmatically for specific action from 800x600 to 1280x1024. Because the ratios are different for these resolutions the screen layouts are different. In the second case the screen layout compressed from the sides. I need to expand the layout from the sides for the size of monitor.
Any suggestions?
Thanks in advance
|
|
|
|
|
I'm currently writing some basic MFC Apps to make sure I really "know what I'm doing", but I'm having a hard time understanding how to use the debugger for event driven programs.
Could someone suggest a solid tutorial or article that would be helpful?
- Thanks a lot.
|
|
|
|
|
Well.... that's a pretty big subject. I do not know of any tutorials or articles dealing with that.
Any specific information that you need?
Artificial intelligence is no match for natural
stupidity.
|
|
|
|
|
Does any one know of a good starting point for learning more about WMI (Windows Management Instrumentation) ?
Specifically, I have found that this seems to be the perferred way of monitoring signal strength of wireless adapaters on winXP... and I would like to find an introduction WMI. I have found .net examples but I don't like .net .
thanks Tom.
ps.. it all started with this question:
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=951615&df=100&tid=951615#xx951615xx
|
|
|
|
|
Check the following link -
WMI[^]
Also I found some good stuff about WMI in "Programming the Microsoft Windows Driver Model" book by Walter Oney few months back.
Hope this helps
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I was using the picture box control and i loaded a bitmap to it from the resource using the properties dialog box, i wanted to manipulate the image from the code and i wanted to create a member variable so i changed the ID from IDC_STATIC to another and the only member variable for control and value is CString nothing as i Assumed of CBitmap or another.
Well my ? is can i use this control to modify the contents of the bitmap at run time if so how do i do it?
isn't there any class in which my picture box can map in to like HBITMAP,CBitmap or another ?
Thanks
|
|
|
|
|
Hi,;)
Yes, Certainly you can change the bitmap at run time during the MOUSEMOVE or on LBUTTONDOWN. Let's take the example of MOUSEMOVE
void CMouseDlg::OnMouseMove(UINT nFlags, CPoint point)
{
m_Image.GetWindowRect(&rect);
ClientToScreen(&point);
if(rect.PtInRect(point))
{
m_Image.SetBitmap(m_Bitmap1);
}
else
{
m_Image.SetBitmap(m_Bitmap2);
}
CDialog::OnMouseMove(nFlags, point);
}
Here m_Image is the control type variable of Image control created using Class Wizard and rect is CRect object.
// m_Image.GetWindowRect(&rect);
Extract the image control co-ordinates in a rect object.
// ClientToScreen(&point);
ClientToScreen is used to convert the client coordinates of a given point or rectangle on the display to screen coordinates.
Next step is to check whether these points fall under the area where our image is place on the screen using PtInRect. If yes, then change the bitmap to whatever.
m_Bitmap1 and m_Bitmap2 are twom CBitmap type objects defined in the header file.
That's it...you r on ur way to change the bitmaps at runtime
Vikram Kashyap
"You will never fail until you stop trying"
|
|
|
|
|
I have a function which returns a char* and I am trying to avoid a memory leak.
So far it is in this format:
char* MyFunction(char *szBuffer)
{
char *szTmpBuffer = new char[strlen(szBuffer) + 1];
...function body...
return szTmpBuffer;
}
And it is called somewhat like this:
char *szBuffer = MyFunction(szString);
but if after I use szBuffer I try to delete it:
delete [] szBuffer;
I get a Debug Assertion failed...so the question is, what is the proper way to call new within a function then delete the pointer outside of the function w/o causing errors and avoiding memory leaks?
|
|
|
|