How to retrieve the string from dialog box

Hi All,

Does anyone know how to retrieve a string in IDC_STATIC on a dialog box?
I have to print out a report with an application version at the bottom line 
for users to be aware of it in my application.

I don't know how to retrieve the string in IDC_STATIC control on a dialog box.
It would be very nice that someone let me know how to do that without 
calling the dialog box.

TIA

Hwasoo Lee


0
Utf
10/27/2004 9:25:08 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1068 Views

Similar Articles

[PageSpeed] 55

Back 9 wrote:
> Hi All,
> 
> Does anyone know how to retrieve a string in IDC_STATIC on a dialog box?
> I have to print out a report with an application version at the bottom line 
> for users to be aware of it in my application.
> 
> I don't know how to retrieve the string in IDC_STATIC control on a dialog box.
> It would be very nice that someone let me know how to do that without 
> calling the dialog box.
> 
> TIA
> 
> Hwasoo Lee
> 
> 

First you have to change the ID from IDC_STATIC to some unique name with 
unique ID value for that dialog.  Then you can read the control's text 
all the ways you can read an edit control, such as GetWindowText and 
GetDlgItemText.

It is not clear what you mean by "without calling the dialog box."

-- 
Scott McPhillips [VC++ MVP]

0
Scott
10/27/2004 11:34:10 PM
He probably means without invoking the dialog.

Perhaps he should ensure the application's version is stored in a version
resource and then read the resouce for the paper report and for the dialog
box too.

I can't find the right calls at the moment, but I know they exist.


"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:OvsXyVHvEHA.3228@TK2MSFTNGP12.phx.gbl...
> Back 9 wrote:
> > Hi All,
> >
> > Does anyone know how to retrieve a string in IDC_STATIC on a dialog box?
> > I have to print out a report with an application version at the bottom
line
> > for users to be aware of it in my application.
> >
> > I don't know how to retrieve the string in IDC_STATIC control on a
dialog box.
> > It would be very nice that someone let me know how to do that without
> > calling the dialog box.
> >
> > TIA
> >
> > Hwasoo Lee
> >
> >
>
> First you have to change the ID from IDC_STATIC to some unique name with
> unique ID value for that dialog.  Then you can read the control's text
> all the ways you can read an edit control, such as GetWindowText and
> GetDlgItemText.
>
> It is not clear what you mean by "without calling the dialog box."
>
> --
> Scott McPhillips [VC++ MVP]
>


0
10/28/2004 2:15:12 AM
Reply:

Similar Artilces:

GP9, BP Requisition string length: Truncate is your friend!
We seem to have some wordy requisition creators here who tend to make very long entries in the ItemDescription field. We receive a length error when those Requisitions are converted to Puchase Orders. We do not allow requisitions to be edited once they've received final approval. We would like the system to truncate the excess characters and finish the conversion! The message is similar to: Message The string length is greater than the maximum allowed. Parameter Name: ItemDescription Actual Value was..... The string length is greater than the maximum allowed. Parameter Name...

How to retrieve the string from dialog box
Hi All, Does anyone know how to retrieve a string in IDC_STATIC on a dialog box? I have to print out a report with an application version at the bottom line for users to be aware of it in my application. I don't know how to retrieve the string in IDC_STATIC control on a dialog box. It would be very nice that someone let me know how to do that without calling the dialog box. TIA Hwasoo Lee Back 9 wrote: > Hi All, > > Does anyone know how to retrieve a string in IDC_STATIC on a dialog box? > I have to print out a report with an application version at the bottom line &g...

Trying to calculate # of times text string is displayed
I have a worksheet where I track what I've applied the number to; i.e. acct # in column A and user type in column E (nanny, sitter). I'd like to use a function to calculate how many rows are classified as "nanny" or "sitter". The outcome I'm looking for is the same as if I go Ctrl+F, "Nanny", Find All which gives me 66 right now. But rather than having to do this manually, I'd like a running total. The data is in rows 2 to 133, columns A to E, but I only need column E to calculate. I can provide more info if needed, I just don&#...

Using CHtmlView in a dialog (VC6)
I have an old application (VC6) that uses CHtmlView in a dialog. It works fine for online browsing but crashes the app on some sites (e.g. Wikipedia). Does anyone know if VC6 compiles CHtmlView against IE4 or does it use a newer version? Also, is there a more up-to-date option for embedding a browser in a dialog using VC6? Thank you all. You don't have to rig a CHtmlView in a dialog. You can simply use the browser control http://msdn.microsoft.com/en-us/library/aa752046.aspx http://www.codeproject.com/KB/IP/CustomBrowser.aspx Have you create a simple SDI program that uses the CHtmlVie...

Opening a dialog within an extension DLL
Hi, I am trying to open a simple dialog within an MFC extension DLL. I exported a function in which I just call DoModal. I also tried to pass the dialog parent window pointer, which is a part of the client app, but it didn't help. The function doesn't open the dialog in Client Release - DLL Release mode and it crashes in Client Release - DLL Debug mode with afxCurrentResourceHandle != NULL. Is it a special case to open a dialog within an extension DLL ?!?!? One more detail:I had to add manually #include "resource.h" so the dialog resource will be compiled. Thanks, Tal...

keystroke in MFC(Dialog app)
hi I am trying to capture the keyboard input user press in my application i have declared the message WM_KEYUP and WM_KEYDOWN and their correspoding function also get declared void CTeestDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { MessageBox("Key Presses"); CDialog::OnKeyDown(nChar, nRepCnt, nFlags); } now when user press any key in my dialog application message box should be displayed but nothing happend no message box displayed I also used the break point in side this function but no break point is called .... please let me know how to solve this problem T...

retrieve an AVERAGE of a range using VLOOKUP to locate start/end d
Can I calculate the average of a range based on VLOOKUP? In other words, can I get Excel to "look up" the respective START / END dates of an investment position listed in Sheet 1 and then go and locate those 2 distinct cell values in in a different sheet (Sheet 2) utilizing VLOOKUP function and then return the calculated AVERAGE of the cells within that range back into Sheet 1? Appreciate any thoughts if doable in Excel in any way? tAKE A LOOK AT AverageIFS and see if that does what you want. If it were me, I'd probably enter the formula manually, record the resu...

ATL Object suspend Dialog's main thread?
I make a dialog with a progress bar in it, and I create a Timer to change the progress's status. When some button pressed, a long term process is called in another work thread. In the work thread a ATL COM object's method is called, this method is the long term process. But it seemed the ATL COM object's method suspend the dialog's thread, and the OnTimer is never called until the work thread is finished. I found a article "OnTimer never gets called in the dialog box." yesterday, but it was not suit for me. the code is like this: class CMyDlg : public CDialog { ...

Close Message box
I have created a message box with the following: Private Sub Form_BeforeUpdate(Cancel As Integer) If ([REASON1] = 1 And [PLATFORM] = "QL" And [CLIENT_CARRIER_CODE] = "lzboy") Then MsgBox "Please check elegibility on RxClaim for DOF!" Me.PLATFORM.SetFocus '<---Assumption: control name is 'Platform" Cancel = True End If ExitProc: Exit Sub ProcError: MsgBox "Error" & Err.Number & ":" & Err.Description, vbCritical, "Error in procedure Form_BeforeUpdate..." Resume ExitProc End Sub What this does...

Retrieve mouse position
Hi, I am writing an app in which I need to retrieve the mouse coordinates even when it mouse is outside the main frame. How do I do it? Thanks! xg >Hi, I am writing an app in which I need to retrieve the mouse coordinates >even when it mouse is outside the main frame. How do I do it? Thanks! Have you tried calling GetCursorPos? If you want to know when the mouse is moving I think you'll need to use a hook - have a look at SetWindowsHookEx WH_MOUSE. Dave IN addition to David's answer, you have not stated the problem you are trying to solve. For examp...

Creating smooth animated dialog based apps ( google picassa style)
Hello all, Recently i tried the Google Picassa2 , the image editor tool and was amazed by its smooth UI. I would like to do the same for my dialog based applications. Is there any library or something to create such kind of GUI in VC++ MFC or WTL. I have seen many such windows applications where they use such kind of smooth UI. They add various effects. Can we do the same in VC++ for dialog based applications. Thanks in advance, The following article is in C# but you can look at the fading in/out algorithm for collapsing/expanding group boxes and employ some such approach. http://www.cod...

Retrieving comment using range name
I have singular cells in different places referenced by their range names. Is there a way to get the comments corresponding to the referenced ranges (singular cells)? Thanks in advance, Tomek Set testrng = Range("A3:A4", "C3:C4") comment1 = testrng(1).Comment.Text .... commentn = testrng(n).Comment.Text Stefi „topola” ezt írta: > I have singular cells in different places referenced by their range > names. Is there a way to get the comments corresponding to the > referenced ranges (singular cells)? > Thanks in advance, > Tomek > > did yo...

Retrieving messages
Help, I mistakenly restored all the defaults on Outlook (the computer did not crash) losing all the messages and address book. I have had to set up the application from scratch entering account details etc. Question is: are all the messages and contacts still held on the computer even the program needs to be set up again and, if so, how do I retrieve them. Any assistance greatly appreciated. Thanks. P89 If you made a backup of your system or My Documents, search for a file called Outlook.pst. If you have that you can import all the information. Al "peterson89" <peterson...

How can a calculated value be displayed wiyhin a text string
I am trying to display calculated value in a text string. The value could change as the variables change. the use of the Ampersand "&" ="all " & (2+3) & " people" will show as all 5 people If you want the number to be in a given format check the text() funciton in help. "Furrukh" wrote: > I am trying to display calculated value in a text string. The value could > change as the variables change. You don't give any details, but perhaps something like ="The sum of the first 10 values is " & SUM(A1:A10) &a...

Retrieving lost messages after Synchronization in Outlook Express
Setup for my hotmail messages to be downloaded to Outlook Express. When tried to connect to see an old message, didn't realize that it was setup to auto synch. My messages were deleted from hotmail, and are now lost on Outlook Express after synching. Is there anyway to retrieve the lost messages from Outlook Express? I really needed some of the items in there, and had downloaded them so they wouldn't be lost. Thanks! ...

Mail Merge
Hi I am the admin on the crm 4.0 environment here. Whenever i do a mail merge through outlook or through the web client i dont get the create activites dialog box. Instead i always get a pop up saying "Opening this document will run a SQL command and data from the database will be placed into your document" When i click yes to continue , I get a pop saying mail merge can not find the data source... and then two options to remove all merge info or remove data header source.. any ideas what i could do to fix this? regards Snow White ...

removing space from the start of a string
hi all; i have a list of a million names to sort. some names have a space at the beginning and thus appear at the top (A->Z sort) irrespective of the actual first letter. how do i check for and remove such spaces? eg " vista" should be replaced by "vista" and sorted accordingly. Thanks and regards Suppose your names are in column A: In a helper column type =TRIM(A1). Copy and PasteSpecial Values to get rid of the formulas. JM "n" <nikhil.abhyankar@gmail.com> wrote in message news:a8c57c02-cfde-4204-838b-cb485a95dd0c@59g2000hsb.googlegroups.com... ...

Creating popup dialog as child of a view
Hi, I maintain an SDI document-view architecture based application, for which I'm also writing an extension dll. Basically, this extension dll defines a viewer for some particular log data. Now this viewer has a splitter window, in which I'm loading two views. One is a CListView, and the other is a CScrollView. The list view shows the log entries, and the idea is that when a user double clicks on any entry, a dialog with some graphs related to that event needs to be displayed. The user can open various graph dialogs, then tile vertically or horizontally, as he wishes. The pr...

Multiselect List Box
I'm trying to modify Allen Browne's Search form to use a multiselect list box, but my listbox has only one column. I want to filter my list by choosing multiple counties in my listbox (I also have other choices in text boxes of state, date fields, etc.). I have pasted my code below for my filter button. I'm not great with writing and deciphering code, but seem to do ok sometimes in modifying, but I can't get this one. I've read through many other posts here, and still can't figure it out. Everything works till I put in the listbox. txtFilterCity is the...

Retrieve
Hi how do i retrieve all the postings i have posted in this group. sometimes forget of where i posted my i will be glad to get to know how to pull out my own questions cheers Click on your name to view the profile...Then click 'Recent posts by this user' http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?&lang=en&cr=US&guid=&sloc=en-us&dg=microsoft.public.excel.misc&p=1&tid=467a932d-65b6-4bb1-98e1-25def53a971a&mid=467a932d-65b6-4bb1-98e1-25def53a971a -- Jacob (MVP - Excel) "Amin" wrote: > Hi how ...

pictures on email will not forward with text. just a white box
when i forward an email with pictures on it - not attachments - it will not enclude the picture. just a white box where the pictures were. thanks ...

Paramater Report based on Combo Box and dealing with No Data
I have a paramater report that is based on a combo box (on unbound form that is called from Report's on open event, form value is used in Report's Record Source Query). This works great and I have no complaints about that. But what I want to do is the following: Have a MsgBox appear if no records are returned from the Record Source query and to close the report. I tried doing this in the No Data Event, but since I use a paramater form it doesn't work. Can someone help me determine the best place to run my code? Dim Msg, Style, Title, Response Msg = "There are no Activ...

how to give cell reference using Combo Boxes in Excel?
Hi, is it possible to have Combo Boxes in cells in Excel? How could I link a particular cell in excel with the selected value from the combobox. Kindly help me in this regard. Joseph J Hi Joseph See http://www.contextures.com/xlDataVal01.html for several approaches on this. HTH. Best wishes Harald "Joseph" <Joseph@discussions.microsoft.com> skrev i melding news:04BEC1FF-38D0-4A01-B0D4-EA97799D2426@microsoft.com... > Hi, is it possible to have Combo Boxes in cells in Excel? > How could I link a particular cell in excel with the selected value from the > combobox....

Retrieving
Is there any way to retrieve how many web pages are opened by Internet Explorer, and what URLs are opened by it, from another process? I searched for IHTMLDocument5 and so on, however, I could't find any hint. Please reply. Thanks in advance. Regards, Hyun-jik Bae ...

ACC2000: change string to int
I have a customer number that is a string, but I need to change it to an integer variable. Assigning: iCust = sCust does not work. (I just want to drop leading zeroes in the string. It can stay a string if that's easy.) Is there a function to convert string to int? I could not find one in Access help. String() seems to convert a numeric to a string data type. Thanks. Try use: Int(sCust) or Val(sCust) If you want to find Help on these types of functions, first open any module and then open Help. -- Duane Hookom Microsoft Access MVP If I have helped you, please help me by donat...