|
2 questions
1) I have a Rich edit control in a dialog box. I add text to the end through a CString. I want to keep the scroll position it the bottom of the text. Whenever you call UpdateData (FALSE); it springs back to the top of the text. I've had a look at the setscrollpos, etc (that are in CWnd), but they are not very effective.
2) In the rich edit control i want to have different colours, but since the user does not enter text directly i use updatedata and all formatting is lost (and all text goes to the last setting used). Anyway around this?
thanks
|
|
|
|
|
for question #1
Have you tried the LineScroll() member function ?
For example, after UpdateData(FALSE);
int nVis = m_edit1c.GetFirstVisibleLine();
int nscroll = m_edit1c.GetLineCount() - nVis;
m_edit1c.LineScroll(nscroll);
(assuming that you have a control variable,
m_edit1c, associated with the Rich edit control)
|
|
|
|
|
I've tried to implement an Unicode program, to read and write Unicode character, but when I compile the program, this is the error message :
msvcrtd.lib(wcrtexew.obj) : error LNK2001: unresolved external symbol _wWinMain@16
Debug/DAS Converter.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
I already define _UNICODE, and also use wWinMainCRTStartup as the entry point.
Please help me,
Thanks
|
|
|
|
|
I have in an application several List controls. I don't want scrollbars, even when all the content of the list is not visible.
I have tried different ways but I didn't find the solution.
I did this with CListBox with no problems but list controls are different.
The LVS_NOSCROLL style is not what I want, because I still want to be able to scroll programatically.
I would appreciate a hint.
Best regards
Jose
|
|
|
|
|
1. What are the minimum requirements to use 'Microsoft Web Publishing API' programs? To run a application developed using this API what do I need to have installed? I could not find this info anywhere.
2. The following code segment crashes with a 'Unhandled exception in <whatever>.exe[WEBPOST.DLL]: 0xC0000005: Access Violation.', after WpPost is called. I have Administrative privileges on my system.
<code_segment>
char *fname[] = {"E:\\workdocs\\book.xml"};
LPTSTR szLocalPaths = NULL;
szLocalPaths = *fname;
LPTSTR szSiteName = NULL;
char *dname[] = {"http://160.86.13.190/"};
LPTSTR szDestURL = NULL;
szDestURL = *dname;
lReturn = WpPost(NULL, 1, &szLocalPaths, 0, NULL, 0, szDestURL, WPF_NO_UI);
<\CODE_SEGMENT>
What am I doing wrong here?
Thanks,
Sai
|
|
|
|
|
You need to have the web post installed on the client machine to post files to a server.
Search MS web site for this client-related download :
pa20setup.exe - Web post acceptor
Keyword search for "web publishing wizard" and "web post"
You need to have web server extensions installed to the server machine to accept web publishing.
Use these links to get started on server side :
Resource Kit
officeupdate.microsoft.com/frontpage/wpp/serk/adoview.htm
Download
msdn.microsoft.com/workshop/languages/fp/2000/winfpse.asp
I recently had to get all this sh*t programmatically installed to a machine, so there are definitely two parts required - one on each end. You are probably more interested in the client portion for now.
|
|
|
|
|
Hi,
I wanr ro disable the Copy and Drag operations in Webbrowser control . One way of doing it is in Pretranslatemessage of Webrowser container we can trap the CTRL+C and WM_LBUTTONDOWN AND disable them. Is there any other way of doing it ????.
Thanxs in advance.
Balak
|
|
|
|
|
I have designed and implemented a set of services for NT. I used the ATL COM wizard to create the skeleton and then fleshed it out with my desired Run() actions. I want to make ( and have tried to ) several user-defined controls. Whenever I call the ControlService() API I get ACCESS_DENIED. I have domain admin rights on both machines so I do not think NT security is the issue. I obtained a service handle using OpenService. I have passed EVERY combination of SERVICE_ACCEPT_ flags to OpenService
including SERVICE_ALL_ACCESS. None of them work. All of them result in GetLastError() = 5 ( ACCESS_DENIED ). I am able to START and STOP the service but all other controls fail. I have noticed that the SERVICE_STATUS returned after opening indicates that only STOP controls are accepted. Could some kind soul out there enlighten me on how to get PAUSE, CONTINUE, and USER-DEFINED controls to work for the ATL NT service model ? Please send any reply to my email address ( although I will check this site as often as I can ). If you have a good example of a
service ( source code ) then send it along.
Many thanks,
Robert
|
|
|
|
|
Hi,
How do i disable the PrintScreen and Print functionality in a dialog based MFC application???. Can anybody
enlighten me about this
|
|
|
|
|
In a dialog, i have some buttons and a CEdit control. How would I set the focus to the edit control?
tanx
|
|
|
|
|
|
okay, whoops, i should have said that i have a CString mapped to the control. I suppose I have to map a CEdit as well to be able to focus it...
|
|
|
|
|
What does it mean 'to have a CString mapped to the control' ??? If you'll be more specific maybe I'll help you
Honza
|
|
|
|
|
i meant that in Class Wizard member variables i put a CString onto the edit box. I put a CEdit onto the edit box as well, so i can use SetFocus like that. I was just wondering if you could do it without having to have a CEdit just for that. if u get what i mean .
|
|
|
|
|
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT);
pEdit->SetFocus ();
|
|
|
|
|
Two ways:
1. GotoDlgCtrl ( GetDlgItem ( IDC_MY_EDITBOX ));
2. GetDlgItem ( IDC_MY_EDITBOX )->SetFocus();
|
|
|
|
|
Use this:
GotoDlgCtrl(GetDlgItem(IDC_MYCONTROL));
That way, you don't need to setup a member variable of the control type...
|
|
|
|
|
How can I set separately any Video for Windows parameters (Brightness,Saturation,Contrast, Hue and others)
from my application without vfw standard dialogs?
ok@aquanet.co.il
|
|
|
|
|
I am looking for some clues as to how to do Detachable Menus using MFC. These menus can be seen in Microsoft Powerpoint under Slide show\Action Button menu pick.
They have a tiny caption bar on them, and user can click and drag them to detach them.
I could get the same look using Owner draw menus. But I am having a hard time trying to emulate click and drag because it is menu, and not a window. Any ideas are greatly appreciated.
|
|
|
|
|
You might Like to have a look at Stas Levin's BCGControlBar library. It's free and supports tearoff menus, as well as the rest of the Office 2000 UI.
His homepage is:
http://msnhomepages.talkcity.com/WindowsWay/stasl/index.html
Not sure if this will be of use to you, but it could be.
Yours,
|
|
|
|
|
hi,
in fact, these menu are simply toolbar (detachable) with textbutton wich display a popup menu when pressed. There is no way to add a CMenu to a CToolBar, and as CMenu is not a CWnd derived, there is no way to dock it in anything ...
you should check this great article wich explain the popup method :
http://www.microsoft.com/msj/defaulttop.asp?page=/msj/0199/c++/c++0199top.htm
I've currently my own implementation of this system, but this is a lot of code since you have to do all menu i/o management yourself. You should use the pixielib on the
dilascia page (he wrote the article below)
++, Benoit
authem_b@epita.fr
|
|
|
|
|
Dear Friend...
Thanks for the reply..I was wondering myself that this tearoffs should be toolbars mimicing menus.
In fact for menu customization, I ended up creating a custom menu class which is a toolbar by itself.
However, I found one issue with the customdraw notification that CToolBar sends us. These tearoffs
normally have a small caption, which I believe is just a customdrawn button. But if you specify a smaller
height for a tearoff button ( of normal window caption / 2 ), CToolBar still draws the button with the normal
size. So in effect what you get is a button which is partically filled with the caption color. How do we solve
this problem?
Thanks for pointing me to Paul's article. That is a great help. And also thanks for substantiating my guess
that these popups are actually toolbars, and that Microsoft haven't found an ingenuous way of manipulating
menus!!!
Regards
Shailesh
|
|
|
|
|
Hi,
I recently purchased visual studio 6.0, and the book Programming Microsoft Visual C++, Fifth Edition. Now, by trade I am a unix programmer, so my normal day to day activities are via the 'vi' editor. In the book (mentioned above), chapter 1, page 10 under "The Source Code Editor", the first sentence states that Visual C++ 6.0 contains keyboard bindings for "a variety of popular editors (such as VI and EMACS).." - maybe I'm just looking wrong, but I can't find out how to do this, the 2 included with VS6.0 are Developer Studio, Visual C++ 2.0, Epsilon, and BRIEF. I've loaded service pack 4, and have searched endlessly through MSDN, to no avail. If someone knows what I need to do to enable VI key bindings within the source code editor of Visual C++ 6.0+SP4, I would be very happy.
Thank you,
Nick
|
|
|
|
|
This is probably a simple question to answer, but I can't seem to find a solution. I am trying to create two new documents when the user chooses the "File|New" command. I have two document templates set up, and wish to create one of each automatically.
Also, how would I go about handling an "File|New Document 2" command - To create a new document from template 2, without showing the user the MFC "new file type" dialog.
I hope semobody can help me with my problem.
Thanks in advance,
David Wulff
Battleaxe Software
|
|
|
|
|
#1 First create two new data members in your application class.
for example:
CMultiDocTemplate* m_pDocTemplate1;
CMultiDocTemplate* m_pDocTemplate2;
#2 Change the document template registering to something
like this.
m_pDocTemplate1 = new CMultiDocTemplate(
IDR_MYDOC1,
RUNTIME_CLASS( CMyDocument1 ),
RUNTIME_CLASS( CChildFrame ),
RUNTIME_CLASS( CMyView1 ) );
AddDocTemplate( m_pDocTemplate1 );
m_pDocTemplate2 = new CMultiDocTemplate(
IDR_MYDOC2,
RUNTIME_CLASS( CMyDocument2 ),
RUNTIME_CLASS( CChildFrame ),
RUNTIME_CLASS( CMyView2 ) );
AddDocTemplate( m_pDocTemplate2 );
#3 Overwrite the "OnFileNew" command handler in your
application class.
void CMyApp::OnFileNew()
{
// don't call CWinApp::OnFileNew()
// Create a new document from template 1
m_pDocTemplate1->OpenDocumentFile( NULL );
// Create a new document from template 2
m_pDocTemplate2->OpenDocumentFile( NULL );
}
That's it.
Best regards
Holger Persch
|
|
|
|