|
The above example is still correct, but perhaps you'd like something like:
<br />
UINT id[] = { IDC_CONTROL1, IDC_CONTROL2, IDC_CONTROL3, 0 };<br />
<br />
<br />
for (int i = 0; id[ i ]; i++)<br />
{<br />
CWnd *item = GetDlgItem( id[ i ] );<br />
item->EnableWindow( FALSE );<br />
<br />
}<br />
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
I see its like for a simple multi edit
m_string= "T line 1Text line 1\r\n";<br />
m_string += "Text line line 1Text lineText line 1 Text line line 1Text lineText line 1w\r\n";<br />
m_string += "Text line 1Text l 2\r\n";<br />
m_string += "Text line 4\r\n";
THen these entries are separate lines, and horizontal scrollbar shows up when necessary.
What I have is a bunch of text thats like a couple of paragraphs and I want to have it look normal in th editbox. I thought of using a richedit but dont know how to populate it. MSDN is talking about a StreamIn function but it looks awfully complicated. The text I have is coming in as a char* pointer.
Any hints?
Thanks,
ns
|
|
|
|
|
I'm going to try (from CP)
Couple of Questions: OnReadIn() is not a function in response to a message right? I didnt see anything like that in the classwizard.
This std_call function. Do I need to include it in the h file?
Thanks,
ns
|
|
|
|
|
In my dialog window, I have inset a child dialog using this code in the main dialog's OnInitDialog(). Since SubclassDlgItem() can't be used with a CDialog, I have used this code to place it in the location of the CStatic item IDC_SINSET:
<br />
m_pFrameViewWnd = new CFrameViewDlg(this);<br />
m_pFrameViewWnd->Create(CFrameViewDlg::IDD,this);<br />
<br />
GetDlgItem(IDC_SINSET)->GetWindowRect(r);<br />
ScreenToClient(r);<br />
m_pFrameViewWnd->MoveWindow(r.left,r.top,r.Width(),r.Height());<br />
m_pFrameViewWnd->ShowWindow(SW_SHOW);<br />
GetDlgItem(IDC_SINSET)->ShowWindow(SW_HIDE);<br />
There are more than forty various buttons and controls in the main dialog and the CStatic IDC_SINSET has a tab order of 12. However, no matter what the tab order of that static item is, the controls in the subdialog always seem to start only after all other controls in the main dialog. How can I make the controls in the subdialog have a tab order which is inserted at the same point in order as the static item to which the subdialog is assigned?
|
|
|
|
|
1.Add your child dialog in the tab order, in your OnInitDialog , add a call to ModifyStyle(0, WS_TABSTOP); .
2.If you want to pass control to the next available control in the tab order of the main dialog, you need to extract that information from your child object (IDC_SINSET)
and set focus on it when the last control. You will need to overwrite PreTranslateMessage and call NextDlgCtrl of the main dialog.
|
|
|
|
|
I want to click on a (3rd party) picture box which has an image with a particular index in it. I want to pass this index into the Buttondownhandler for the picture box which has this signature:
void CTrain1View::OnLButtonDownThbimage3(long Keys, long x, long y) <br />
{<br />
<br />
}<br />
How would I do that?
Thanks
|
|
|
|
|
First of all, you probably don't want to mess with the OnLButtonDown signature. I don't think that is the best approach. As far as I know there is no way to do what you are asking. Button handlers are implemented with callbacks using macros. There is no way that I can see to tell the macro to pass a variable to the button handler. Someone correct me if I'm wrong.
Since you're talking about a third party product, it's difficult to tell you the best way to do this without knowing the API for that product. If, for instance, your picture box handles it's own events (click, mouse over, etc.), the index for the current picture is probably being updated automagically. Just find a member function in your picture control ( GetIndex or something like that ), that tells you what the current picture index is. If, however, you have to handle the events on your own, it could be any number of possibilities. I don't think there's an easy answer for you in that case.
Here's a few questions you need to answer:
1. Where is the index for each picture getting stored?
2. Is the value of the current index being updated automatically by the control or is that something I have to do myself?
3. If the control does handle the updating of the index value, do I have a way to access the control member variable from my button handler?
4. Is there a member variable ( m_cPictureControl or something like that ) representation of the control? If not, use class wizard to create one.
That's the best I can offer. Good luck.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
I'm using the following to get the DC for the printer:
CDC dc;
if (!AfxGetApp()->CreatePrinterDC(dc))
AfxMessageBox("unable to create dc")
But, it always returns FALSE. When I trace into it, it goes into CWinApp::CreatePrinterDC, and then into AfxCreateDC - but this returns NULL as hDevNames (CWinApp::m_nDevNames) is NULL (as is hDevMode).
What I'm a doing wrong?
Dylan Kenneally
London, UK
|
|
|
|
|
I want to use the CRectTracker for tracking objects and the the CScrollView for scrolling the Document, but , every time I scroll the current tracked object out of sight and in again the tracker is not redrawn, anyone suggestions ?
|
|
|
|
|
I have several CListCtrl which display over 50000 items. So i created my own CListCtrl with LVS_OWNERDATA so i can handle the memory myself. It works fine except for one simple thing...
the MFC CListCtrl posts a message if an SetItemText is called on an item which is selected. I added
<br />
int CMyListCtrl::SetItemText(int iItem, int iSubItem, LPCSTR txt) {<br />
...<br />
NM_LISTVIEW nmlv;<br />
nmlv.hdr.hwndFrom = m_hWnd;<br />
nmlv.hdr.code = LVN_ITEMCHANGED;<br />
<br />
nmlv.iItem = iItem;<br />
nmlv.iSubItem = iSubItem;<br />
SendMessage(this->m_hWnd, LVN_ITEMCHANGED, 0, (LPARAM)&nmlv)<br />
return iItem;<br />
}<br />
to my costum SetItemText function but it doesnt work...
the item changed events are sent if i click on an item
Any Ideas?
Thanks for your help
Eibwen
|
|
|
|
|
does the forum belong to microsoft? otherwise to whom?
thx
includeh10
|
|
|
|
|
|
Can't you tell that it's part of the Linux/Unix world?. It's elementary!
Best regards,
Alexandru Savescu
|
|
|
|
|
I've recently been given the task of modularizing our main dialog class in a project at work. Currently I am creating a sub-class of CTreeCtrl called Gallery which will be used to wrap the basic functionality of our Tree control.
Here are the steps I have taken. I created CGallery as a subclass of CTreeCtrl. I used the class wizard to change the CTreeCtrl object in our main Dlg be the member variable of type CGallery called m_gallery.
Here is the problem. How can make it so that events are passed to my instance of CGallery and not to my main Dialog. I know I'm overlooking something obvious but this is my first time dealing with VC++ and I'm quite lost. Any help would be greatly appreciated.
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
|
jparsons wrote:
How can make it so that events are passed to my instance of CGallery and not to my main Dialog.
You mean events like TVN_* notifications? If this is the case, you'll need to use so-called message reflection. In ClassWizard add CGallery handlers for messages marked with '='.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
I'm having trouble printing a document that is more than one page in length. ie (3 pages). It only prints the first page. What am I doing wrong.
Please Help, thanks
|
|
|
|
|
are you using the CDC::StartPage / EndPage calls?
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Yes, I'm reading the contents of a listview box inside the StartPage and EndPage.
|
|
|
|
|
are you calling StartPage at the beginning of each page?
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Do you have any code sample on what it should look like. This is very new to me.
|
|
|
|
|
the code roughly goes like this:
StartDoc
While (pages_to_do)
StartPage
PrintPage
EndPage
EndDoc
the hard part, is setting pages_to_do - it requires you to keep track of how much you've printed compared to the size of the page.
do an MSDN search on "startdoc" - there are a lot of printing articles.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Has anyone had any experience using BizTalk synchronously? We need to send a message to BizTalk and receive a reply including results of the message. Documentation in this area is very sparse as is the MS way
If you don't but know somebody that does....please send them my way!
Thanks!
ed
|
|
|
|
|
why "gethostbyname" can sometimes return WSAHOST_NOT_FOUND while the pc is connected to the internet and the destination www-site should be shurely accessible?
|
|
|
|
|
gethostbyname will not be able to retrieve the IP address of a server in Internet if you're connected to it through a HTTP proxy.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|