|
sorry for the long post.
The references are to visuals that would help explain my situation - CColorDialog_.gif (or CColorDialog.gif same thing) is an animated gif
that shows effects of the Toggle Problem i'm experiencing.)
Thanks again for any help.
Johnny
|
|
|
|
|
Hello everbody:
I was wondering if it is possible to have more than one line in the string that is going to be displayed in a tool tip? I gave it a try with the following code, but is displayed all in one line and there is a small square in between the two strings that I want to display:
<br />
CString displayLine;<br />
CString idString;<br />
idString.LoadString(IDS_TT_DCSRAW);<br />
displayLine.Format("%s\nHi Res", idString);<br />
.<br />
.<br />
.<br />
m_ToolTip->AddTool(this, (LPCTSTR)displayLine,rFileTypeCoord, 1);
Is this a Tool Tip attribute that I have to set? Is there another way to put the new line character? Any answer is more than welcome.
Best regards,
Luis E. Cuadrado
)
|
|
|
|
|
No it is not possible that I can see. I've only seen 1 line, albeit some long ones, but when ever I've added the "\n" I only get the text that comes after the "\n". for example:
if the tooltip is "I am having\nsome difficulties"
what you see on the screen is "some difficulties"
There may be some funky trick to do it, but I haven't yet found one.
Hope this helps!
Dan Willis
|
|
|
|
|
|
I found a way! Where you create the CToolTipCtrl and and you call the Create() method, you had the following line:
m_ToolTip->SendMessage( TTM_SETMAXTIPWIDTH, 0, 300);
Then in the AddTool() method, you can put \n's and it will add a new line to the tool tip. The code looks pretty much like this:
if ( m_ToolTip == NULL ) <br />
{ <br />
m_ToolTip = new CToolTipCtrl; <br />
m_ToolTip->Create(this); <br />
m_ToolTip->SendMessage( TTM_SETMAXTIPWIDTH, 0, 300); <br />
}<br />
m_ToolTip->AddTool(this, "One line\nSecond Line\nThird line"); <br />
m_ToolTip->Activate(TRUE);
I did this and it worked.
Best regards,
Luis E. Cuadrado
)
|
|
|
|
|
Hi All,
I'm confused with this. I'm using VS C++ 6.0 w/MFC in an MDI app. I've created a new class called CCustomToolBar that is inherited from CToolBar.
Problem is this:
When I add the ON_COMMAND_UI message handler to the CCustomToolBar, the Onupdatebutton gets called a bunch of times (I still don't know why, any answers?). But the ON_COMMAND message NEVER gets sent to the CCustomToolBar's message handler.
The funny thing is, if I add the message handlers to the MainFrame class, the messages are received just fine. I have no idea why and since I'm going to be dealing with 10-14 toolbars, I really need to ensure that the messages goto the right places.
My questions are:
1) What am I doing wrong?
2) What am I missing?
3) Why does the ON_COMMAND_UI message handler get called so often?
Any insight on the matter is GREATLY apreciated
Dan Willis
|
|
|
|
|
I wanted to create an application in VC++ (which ia dialog based). This application should display a dialog in which the user is supposed to enter his login and Password..which is not provided does not allow him to work on a windows PC at all....It blocks the start button ...And also he is not allowed to use (ALT + TAB) ..I wnated to know how to go about this?
Clemence D
|
|
|
|
|
I need to write a program that will remove one global security group and will replace it with another security group. This program will be ran on each machine locally Please help
|
|
|
|
|
Did you try Network Management Functions?
try:
NetGroupAdd
NetGroupAddUser
NetGroupDel
NetGroupDelUser
NetGroupEnum
NetGroupGetInfo
NetGroupGetUsers
NetGroupSetInfo
NetGroupSetUsers
A. Riazi
|
|
|
|
|
Yes but every time I try to complie the project I get the following linking errors
Linking...
nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in libcp.lib(delop.obj)
groupremoval.obj : error LNK2001: unresolved external symbol _NetApiBufferFree@4
groupremoval.obj : error LNK2001: unresolved external symbol _NetGetDCName@12
groupremoval.obj : error LNK2001: unresolved external symbol _NetUserAdd@16
groupremoval.obj : error LNK2001: unresolved external symbol _NetUserDel@8
groupremoval.obj : error LNK2001: unresolved external symbol _NetUserSetInfo@20
groupremoval.obj : error LNK2001: unresolved external symbol _NetUserChangePassword@16
groupremoval.obj : error LNK2001: unresolved external symbol _NetUserGetInfo@16
groupremoval.obj : error LNK2001: unresolved external symbol _NetQueryDisplayInformation@28
groupremoval.obj : error LNK2001: unresolved external symbol _NetUserEnum@32
groupremoval.obj : error LNK2001: unresolved external symbol _NetGroupAdd@16
groupremoval.obj : error LNK2001: unresolved external symbol _NetGroupAddUser@12
groupremoval.obj : error LNK2001: unresolved external symbol _NetGroupDelUser@12
groupremoval.obj : error LNK2001: unresolved external symbol _NetGroupDel@8
groupremoval.obj : error LNK2001: unresolved external symbol _NetGroupEnum@28
groupremoval.obj : error LNK2001: unresolved external symbol _NetGroupGetUsers@32
groupremoval.obj : error LNK2001: unresolved external symbol _NetLocalGroupAdd@16
groupremoval.obj : error LNK2001: unresolved external symbol _NetLocalGroupAddMembers@20
groupremoval.obj : error LNK2001: unresolved external symbol _NetLocalGroupDelMembers@20
groupremoval.obj : error LNK2001: unresolved external symbol _NetLocalGroupDel@8
groupremoval.obj : error LNK2001: unresolved external symbol _NetLocalGroupEnum@28
groupremoval.obj : error LNK2001: unresolved external symbol _NetLocalGroupGetMembers@32
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Release/groupremoval.exe : fatal error LNK1120: 23 unresolved externals
Error executing link.exe.
groupremoval.exe - 25 error(s), 0 warning(s)
|
|
|
|
|
Do you link with the Netapi32.lib file and including Lm.h as MSDN Library says?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I want to write an application to monitor our company employees. In other hand, monitoring visited sites by users, their activity on internet and so on.
Does anybody have any idea to start this project? Where can I find some documents, APIs, Classes and ...?
Thanks, A. Riazi
|
|
|
|
|
Why don't you just buy something that's already done? It'll be cheaper in the long run that it would be to pay a developer to write it all from scratch.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Hi John,
It has some reason.
1- I want to learn!
2- Customize my needs!
3- Add extra functionality, GUI, charting and ...
Thanks, A. Riazi
|
|
|
|
|
how to disable button on CDlgBar?
I tested this member function
button.EnableWindow(FALSE);
sleep(5000)
this code operate only 5 second
if erase sleep(5000)
code does not operate(exactly speaking... operate 0.001 second?)
I test other formview button
formviewbutton.EnableWindow(FALSE)
is operate correctly...
what's problem CDlgBar?
gjun@netian.com
|
|
|
|
|
How did you declare the button ? If it is declared as a local variable in a function, it will vanish as soon as you leave it. Try out with a member variable.
~RaGE();
|
|
|
|
|
member variable ...
not local variable
and not vanish button.......
I cannot disable button...
|
|
|
|
|
Does it matter if I call the base class first then put in my code, or should the base class call be last. VS does say place your code here...sometimes before and sometimes after, but I just noticed that in some places, the order is not enforced by the person who wrote the sample, yet it still works. Is this dangerous?
void CBKView::OnInitialUpdate()
{
<code>CFormView::OnInitialUpdate();</code>
ResizeParentToFit();
m_FirstSearchKeyInMenu = "None selected";
}
or
void CBKView::OnInitialUpdate()
{
ResizeParentToFit();
m_FirstSearchKeyInMenu = "None selected";
<code>CFormView::OnInitialUpdate();</code>
}
Appreciate your help,
ns
|
|
|
|
|
It mainly depends on the function. In the example you showed, it could matter if you are doing changes on what is done in the base class function, which is almost unprobable. So changing the order is rather harmless. But look at the following example :
CMyDialog::OnOK()
{
...
pWApp->WriteProfileInt("Settings","Window width",m_width);
CDialog::OnOK();
}
compared to
CMyDialog::OnOK()
{
...
CDialog::OnOK();
pWApp->WriteProfileInt("Settings","Window width",m_width);
}
In the first case, you write settings in the registry before calling the base class function. In the second case, you do it after, and your settings are never saved, since CDialog::OnOK() close the window.
In some overrided, you have to comment out the call to base class, for example to change the cursor in OnSetCursor, otherwise your changes won't apply.
I would recommand you to insert your code where the comments invite you to do it, unless you're absolutely sure of what you're doing.
~RaGE();
|
|
|
|
|
I looked up OnSetCursor and saw where you say you shouldnt call the base class.....
The registry example also makes things really clear!
Appreciate your help,
ns
|
|
|
|
|
From a CP article by Brian Hart he has the following:
void CMainFrame::RecalcLayout(BOOL bNotify)
{
CWnd* pClientWnd = CWnd::FromHandle(m_hWndMDIClient);
<code>
pClientWnd->SendMessageToDescendants(WM_SIZEPARENT,
0, 0, FALSE, FALSE);
CMDIFrameWnd::RecalcLayout(bNotify);
}
Its used in:
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CMDIFrameWnd::OnSize(nType, cx, cy);
RecalcLayout();
}
The comment
<br />
worries me.
It seems to work but is it not reliable? Any suggestions/improvements/comments?
Appreciate your help,
ns
|
|
|
|
|
hello!
i have two CStrings:
<br />
CString str1;<br />
CString str2;<br />
I want to combine them:
<br />
CString together;<br />
together=str1+str2;<br />
but between the strings must be a return, because i want to fill the CStrings together into a .txt-file and there must begin a new line, when the second CString is added.
someone in this forum said that in this case you can do this:
<br />
together=str1+0X0A+0X0D+str2<br />
but it does not work.
can someone help me???
thank you
lucky
|
|
|
|
|
|
You need to do this:
together=str1 + CString("\n") + str2
or this:
together.Format("%s\n%s", str1, str2);
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
John Simmons / outlaw programmer wrote:
together=str1 + CString("\n") + str2
Why do you need the CString() called for "\n" ? It's only CString objects, so a simple "\n" should work, in contrast to f.i. LPTSTR used. Or am I wrong?
|
|
|
|