|
Is it possible to have an edit control wrap the text so that you don't have to press return in order to go to the next line? If so how?
Thanks.
- monrobot13
|
|
|
|
|
Hi
Set the properties of the edit box so that
Auto HScroll = false
Multiline = true
Paul Hooper
If you spend your whole life looking over your shoulder, they will get you from the front instead.
|
|
|
|
|
Thanks for the reply. I'll try that out.
- monrobot13
|
|
|
|
|
EDIT: I Solved my own problem
I moved my button-logic to the MainFrm.cpp class, and used the GetPane() function to access the correct pane. I guess the best solutions are the ones you come up with yourself.
********************************************************************************************
Original Post Below:
I've read a number of posts here about communicating when using splitters, but I'm still having a problem, so I'd appreciate any help. I have an SDI application with a toolbar and three views ... one of which is a CHtmlView derived view. I'm trying to control the web browser control using the toolbar buttons.
Here's what I have:
-------------------
I have a pointer to the MainFrm object in my MyApp.cpp (defined MyApp.h).
In my MainFrm.cpp, I'm using the RUNTIME_CLASS(CClassType) macro to create each of the three splitter panes, and I'm saving pointers to each views.
In MyApp.cpp, I have a message handler for the user clicking the "Back" button:
void CMyApp::OnBack(){
CMainFrame* p_localMainFrameRef = (CMainFrame*) p_viewMain;
CMyAppHTMLView* p_localWebFrameRef = (CMyAppHTMLView*)(p_localMainFrameRef->p_viewWeb);
p_localWebFrameRef->GoHome();
}
I'm getting the following error when I click the "Back" button:
Unhandled exception at 0x7c1a8130 (mfc71d.dll) in YourApplication.exe: 0xC0000005: Access violation reading location 0x00003972.
Can anyone lend some advice as to what I'm doing wrong ... or suggest a better approach to allowing me to communicate between frames, and with the toolbar?
Thanks very much,
telstar
|
|
|
|
|
Need to grey out the background of a ClistBox on pressing button grey on a dialog. The list can contain items which should also be greyed out and on pressing button enable list the list should be enabled with all its items
using wm_ctlcolor message with appropriate brush works, but when the list has items the portion with those items are white while rest is grey.
|
|
|
|
|
You have to enable the transparent background mode for the DC in the WM_CTLCOLOR method BEFORE returning the new brush:
HBRUSH CSampleDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetBkMode(TRANSPARENT);
if (pWnd->GetDlgCtrlID() == IDC_MYLISTBOX)
{
if(m_bGrayed)
return (HBRUSH)GetStockObject(GRAY_BRUSH);
else
return (HBRUSH)GetStockObject(WHITE_BRUSH);
}
return hbr;
}
Regards, mYkel
|
|
|
|
|
How can i use a DLL to link 2 different Static Lib in Visual C++ 6.0?
I need help URGENTLY!!!
Thank you very much...
|
|
|
|
|
As an advice if you have more than one dll loaded in ur application then you need to consider rebasing ur dll.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Hello guys,
I am encountering a problem with serveral ComboBox objects created directly from the resouce editior of my dialog-based program. The style is drop-down with a pre-entered set of data. The comboboxes in Windows XP would appear fine, clicking the arrow on the side will show a dropdown list displaying all the item strings. But when running the app in Windows 98, the dropdown list only extends to the height which just occupies the first item. I can, however, go through previous/next items by using the up/down arrow keys. Further, if I then enable "Vertical Scrollbar", a vertical scrollbar will now be available on the dropdown list, which I can use to go through the items. In Windows XP, enabling vertical scrollbar does not make any difference. Clicking on the arrow still gives the complete dropdown list.
I am not sure why it happens? Does it sound like IDE related issue? I am using .Net 2002
Please help,
thanks alot
|
|
|
|
|
hi
I think the problem is u didnt pull down the extent of ur combo drop down in the resource view, Go to your resource view,get the respurce where ur combo is,click on the dropdown arrow,u will get a dotted box, pull it down to the extent u want to display the data
When u do this, vertical scroll appears automatically...
Thanks
krithika
|
|
|
|
|
Thanks for the reply, krithika,
I go back to the resource view and indeed there are two different selection boxes, when you click on the combobox conetent location and the drop-down arrows. I have extended the drop-down view box and hopefully it will make a difference. Will report back. Assuming it works, why it doesn't cause a problem when the app is running on Windows XP?
|
|
|
|
|
J.B. wrote:
why it doesn't cause a problem when the app is running on Windows XP?
The OS is compensating for the (very common) error of forgetting to set the combo box height properly.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Michael Dunn wrote:
The OS is compensating for the (very common) error of forgetting to set the combo box height properly.
That's exactly the mistake I made. Reszing Combobox's dropdown box height solves the problem in Windows 98.
Thanks guys
|
|
|
|
|
hi:
AS we know ,there are several CD_ROM track mode. The first one is CD_DA,The second one is MODE1 ,The last one is MODE2,which has two forms .
Who can help me?
Thank you very much.
|
|
|
|
|
I am writing an MFC dialog application where I have an edit box. If I know the start and end char's, what is the best way to get the substring? Any help is appreciated.
-Dev578
|
|
|
|
|
if you have the start and end indexes the use Mid()
str.Mid(start, end-start);
|
|
|
|
|
int begin = str.Find(char_begin);
int end = str.Find(char_end);
return str.Mid(char_begin + 1, char_end - char_begin - 1);
Robert-Antonio
"Life is very hard, if you apply E-R model to it."
|
|
|
|
|
I'm leaning English.I'm Korean.
I need that oldeDB use programming.
DB:MS-Access
language: visual C++ 6.0
I need sample code.
|
|
|
|
|
Check out the OLE-DB samples in MSDN, and the ATL support for OLEDB in ATLDBCLI.H
along with the online documentation for them.
They aren't (or should not be) specific to MS ACCESS, and have the advantage that they are reasonably lightweight compared to ADO.
Steve S
|
|
|
|
|
I am working on an on-screen keyboard replacement for Tablet PC's. I am using SendInput to send the characters. This works fine with "normal" windows. However, if a console window has the focus, it gets no output. I know that this can be done because the On-Screen Keyboard that comes with Windows XP does it. Can anyone point me in the right direction.
Thanks,
Dave
|
|
|
|
|
Check out MSDN.
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q190/3/51.asp&NoWebContent=1
Kuphryn
|
|
|
|
|
|
I have an application where I need to access the doc page and put data there from a function that is part of the mainframe.cpp file. I know how to access the doc page from the view...but I am not doing that in this application.
Also, can someone show me a simple SDI or MDI program where I can pass messages between classes, using handles to a class...forward referencing , etc, as is done in a typ C++ program with a main().
Thanks.
jerry1211a
jerry1211a
|
|
|
|
|
Hi jerry
here is the code to access doc page from mainframe.cpp
/////////////////////////////////////////////////////////////
//get main wnd handle
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
// Get the active MDI child window.
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
// or CMDIChildWnd *pChild = pFrame->MDIGetActive();
// Get the active view attached to the active MDI child
// window.
m_pView = (CTDGView *) pChild->GetActiveView();
m_pDOC = m_pView->GetDocument();
///////////////////////////////////////////////////////////
this code can be used from any part of the application to access a document.
Hope this helps
thanks
Krithika
|
|
|
|
|
I am having problem setting a dirty flag to a record (CRecordset). I am adding controls to the interface so that no updating to the database is allowed if the form has already been approved. So I did something like the code below. However, I always get the dialog saying "field is still dirty, do not know why". I am not expecting to see this dialog.
m_pSet->Edit();
m_pSet->UpdateData(TRUE);
if (m_pSet->IsFieldDirty(NULL))
{
If (m_pSet->m_is_approved == "1")
{
//reset the dirty flag
m_pSet->SetFieldDirty(NULL, FALSE);
AfxMessageBox("no updating is allowed on an approved application.");
if (m_pSet->IsFieldDirty(NULL) )
{
AfxMessageBox("field is still dirty, do not know why");
}
}
}
m_pSet->Update();
Elizabeth
|
|
|
|