|
Hi,
Iam using ToolBarControl & in my "ToolTipsHandler" which is an event declared in the message map as follows
BEGIN_MESSAGE_MAP(C_ListPageTemp, CDialog)
//{{AFX_MSG_MAP(C_ListPageTemp)
ON_NOTIFY_EX(TTN_NEEDTEXTA,0,ToolTipsHandler)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
Now my "ToolTipsHandler" function goes like this
*****************************************
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID =pNMHDR->idFrom;
pTTT->lpszText = MAKEINTRESOURCE(nID);
pTTT->hinst = AfxGetResourceHandle();
return TRUE;
*********************************************
Now instead of taking the tooltiptext from the ResourceStringtable,I want to provide my own strings(decided upon,on which language the tooltip text should appear.This language string, I will be getting from a part of my program which Iam not showing here.)
Will be getting this language dependent string in "T_String" type where "T_String" is of type
typedef std::wstring T_String;
I tried to provide my string as follows.
T_String test;//(string which I get from a part of my Program ,depending on language).
pTTT->lpszText =const_cast<lptstr>(test).
It compiled,but the tooltip displayed was a junk value.
Is this(pTTT->lpszText),the right place to give my string in the "TOOLTIPTEXT" structure or should I use the "szText" member.
If so,How would I make the necessary conversions.
Would be nice if someone could tell me with a code snippet..
Thanks..
|
|
|
|
|
FROM MSDN:
In writing your tool tip notification handler, you need to use the TOOLTIPTEXT structure. The members of the TOOLTIPTEXT structure are:
typedef struct {
NMHDR hdr; // required for all WM_NOTIFY messages
LPTSTR lpszText; // see below
WCHAR szText[80]; // buffer for tool tip text
HINSTANCE hinst; // see below
UINT uflags; // flag indicating how to interpret the
// idFrom member of the NMHDR structure
// that is included in the structure
} TOOLTIPTEXT, FAR *LPTOOLTIPTEXT;
hdr
Identifies the tool that needs text. The only member of this structure you might need is the control's command ID. The control's command ID will be in the idFrom member of the NMHDR structure, accessed with the syntax hdr.idFrom. See NMHDR for a discussion of members of the NMHDR structure.
lpszText
Address of a string to receive the text for a tool.
szText
Buffer that receives the tool tip text. An application can copy the text to this buffer as an alternative to specifying a string address.
hinst
Handle of the instance that contains a string resource to be used as the tool tip text. If lpszText is the address of the tool tip text, this member is NULL.
When you handle the TTN_NEEDTEXT notification message, specify the string to be displayed in one of the following ways:
Copy the text to the buffer specified by the szText member.
Copy the address of the buffer that contains the text to the lpszText member.
Copy the identifier of a string resource to the lpszText member, and copy the handle of the instance that contains the resource to the hinst member
I think you can try using szText. Remember it can only hold 80 characters, which is not much.
good luck.
(let me now if it worked? tnx)
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I'm trying to write a generic function that reads and writes a float to any Edit box when its spinner is activated. I can get the Edit box associated with the spinner by using GetBuddy() . Once I now which Editbox I'm dealing with, how can I get the float variable, the control variable or the identifier of that edit box?
Ideally I would really want to directly access the float variable associated to that Edit box so I can modify it without having to do string2float conversion.
I hope I make sense here...
Anyway, any help would be most appreciated.
Cheers!
Pat.
|
|
|
|
|
Zeroed In wrote:
Ideally I would really want to directly access the float variable associated to that Edit box so I can modify it without having to do string2float conversion
CEdits do not know anything about floats or doubles or integers . They only know about text.
Any variable that is 'associated' with a text box is only associated by the fact that both it and the CEdit are parameters in a DDX* function call - other than that, there is no association. The CEdit itself doesn't know anything about the float you've associated with it.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
You can get a control's ID value by calling GetDlgCtrlID()[^]
As mentioned by Chris Losinger, you can't tag a float along with the CEdit control unless you derive your own version, CFloatEdit for example. But you'll still have to do the text-to-string (and vice versa) conversions and validations on your own. Sorry
The bright side is that it's all eminently doable
Bob Ciora
|
|
|
|
|
please help me in understanding, how does a windowes taskmanager works? how does it comes to know of a currently running application? how can i make a running application hidden from it.
|
|
|
|
|
I've never had the desire to duplicate what TM does, but I would hazard a guess that it uses Process32First() and Process32Next() . If not, it does use NtQuerySystemInformation() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
If you parent your main window off another desktop created on another window station, most logged in users will never know your app is there. See CreateDesktop and CreateWindowStation.
|
|
|
|
|
I need to use the method Update() in order to modify fileds values.
In VB are not problem, but in VC++ how can I use it?
Can help me with any example?
Thanks a lot
Xavier
|
|
|
|
|
|
Yes, of course. I needed in Visual C++, no VB++
Thanks in advance
Xavier
|
|
|
|
|
Hi,
We are developing a PDF search customization tool (VC++). This
application generates the search results in an html page with
hyperlinks to the corresponding block in the pdf.
Is there any way we can scroll to the searched text in the pdf
document?
Also we need to highlight the needed text in a specified color.
Is there any API we can use to perform this function?
Any help would be greatly appreciated.
Thanks in advance,
Nidhish
|
|
|
|
|
I'm trying to understand templates and has therefor tried to make a linked list. The code is probably full of more errors but the one I can't seem to find now relates to an unresolved external. I don't have much experience with C++ in general so it could be something really basic. I use Visual Studio 2003 .NET and this is the code:
LList.h
<br />
#ifndef LIST_H_<br />
#define LIST_H_<br />
<br />
template< class T ><br />
class Element<br />
{<br />
public:<br />
Element *next;<br />
Element *previous;<br />
T data;<br />
void Remove();<br />
};<br />
<br />
template< class T ><br />
class LList<br />
{<br />
public:<br />
LList();<br />
T& operator []( int p_elem );<br />
void Add( T p_data );<br />
protected:<br />
int m_noElems;<br />
Element< T > m_elements;<br />
};<br />
<br />
#endif<br />
LList.cpp
<br />
#include "list.h"<br />
<br />
template< class T > void Element< T >::Remove()<br />
{<br />
if( this->previous != NULL )<br />
this->previous->next = this->next;<br />
if( this->next != NULL )<br />
this->next->previous = this->previous;<br />
delete this;<br />
}<br />
template< class T > LList< T >::List()<br />
{<br />
m_noElems = 0;<br />
}<br />
<br />
template< class T > T& LList< T >::operator []( int p_elem )<br />
{<br />
if( p_elem > m_noElems )<br />
return NULL;<br />
Element< T > *curEle;<br />
for( int i = 0; i < p_elem; i++ )<br />
curEle = m_elements.next;<br />
return curEle->data;<br />
}<br />
<br />
template< class T > void LList< T >::Add( T p_data )<br />
{<br />
Element< T > *curEle;<br />
for( int i = 0: i < m_noElems; i++ )<br />
curEle = m_elements.next;<br />
<br />
curEle->next = new Element;<br />
curEle->next->next = NULL;<br />
curEle->next->previous = curEle;<br />
curEle->next->data = p_data;<br />
m_noElems++;<br />
}<br />
main.cpp
<br />
#include "list.h"<br />
<br />
int main()<br />
{<br />
LList< int > test;<br />
}<br />
error:
list error LNK2019: unresolved external symbol "public: __thiscall LList<int>::LList<int>(void)" (??0?$LList@H@@QAE@XZ) referenced in function _main
Any help appriciated!
|
|
|
|
|
have you added List.cpp in your project
i.e. In FileView| right Click| add Item|add existing item | add list.h and list.cpp in yoour console project.
"I Think this Will Help"
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
With templates, all of the template methods have to be defined in the template's Header file. Alternately, if you want to put them into a different file, then you'll have to #include that file in your template's .h file.
The compiler treats templates like inlines , so it needs to understand how to expand your instantiations of the template. By putting the template's methods in another file that's not in the "include path" of your source, it doesn't know how to expand LList<T> for any particular <T>.
Try adding #include "LList.cpp" at the end of your header file (just before the #endif that closes out your #ifndef LIST_H__ ).
*EDIT* If you #include "LList.cpp" , do *not* add LList.cpp to your project.*EDIT*
Bob Ciora
|
|
|
|
|
Thanks!
|
|
|
|
|
Soitanly! Glad to help
Bob Ciora
|
|
|
|
|
To understand what is giong on, read this article[^].
Ylis wrote:
I don't have much experience with C++ in general so it could be something really basic.
I hope you don't mind a piece of advice Refrain from trying to learn how to make template libraries, at least at this stage of learning C++. This is the most complex area of a very complex programming language, and chances are you are never going to do it in practice anyway. Just learn how to use template libraries - start with STL and Boost; it is not hard, and it will improve your productivity significantly.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I had been working for several years with Visual C++, when one day a friend of mine introduced me Visual Assist. Since then, I became a fan of it. It helped me to type code in a time saving way.
A month ago, I started to work in a new job, where the official compiler is Borland C++ 6. As the computer that I have should be in the Museum of Natural History, Borland's code completion takes a looooong time to find what I want to type. I have tried visual assist with MSVC++6 on that computer and it's as helpful as always, but MSVC++ is not allowed as code editor in this company.
So, the million dollar question is:
Is there any plugin, addon or similar that can help with code completion in a slow machine?
Answers are welcomed.
|
|
|
|
|
Hi. I am so new in .NET project devolopment.My question is :
I want to devolop a Windows Form Application that will uses SNMP libraries. But I couldnt find where the SNMP headers and libraries are.
İs there any one help me?
|
|
|
|
|
You may want to look at WinSNMP. See MSDN[^] for help.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
thanx for your helps.
May I ask a new one?
it is OK. But in msdn ı coulndt find which .h .dll include to my project
Can u help
|
|
|
|
|
You may need to install the Platform SDK.
Inside the include directory
winsnmp.h
IIRC the lib file is called
WSnmp32.lib
and it is inside the lib directory.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
I found that I cannot use CTime::GetCurrentTime(), as it is accurate to seconds only.
Is there another function I can use?
For example, I want to calculate the time elapsed in an operation, accurate to millisecond.
Thanks
|
|
|
|
|
Look at GetTickCount() function
|
|
|
|