Couldn't open first dialog from second dialog in a single project (VC++)

Hai all,
  Good Day. I am very new to Visual C++. I am learning VC++ and doing practice side by side using IDE - Visual Studio 2005. In my project i created two dialogs. In
first dialog  BARCODE_DIALOG (CBarCodeDlg) if i clicked  a button "password", i want to open a
second Dialog DIALOG2(CPasswordDlg).  in this if i clicked main button  DIALOG2 closed at same time i want to open first Dialog and have to do changes in first dialog. 
my problem is i closed the second dialogv by calling OnOK(). but i couldn't open first dialog. How to do?
//For opening second dialog from first dialog:
//CBarCodeDlg.cpp
void CBarCodeDlg::OnBnClickedBpswd()
// TODO: Add your control notification handler code here
OnOK();
m_dPswdDlg.DoModal(); // added variable public CPasswordDlg m_dPswdDlg
//For close second dialog and do changes in first dialog
//CPasswordDlg.cpp
void CPasswordDlg::OnBnClickedBmain()
OnOK();
m_dBarCodeDlg.DoModal(); //added varible public CBarCodeDlg m_dBarCodeDlg
if i added this 
m_dBarCodeDlg.DoModal(); //added varible public CBarCodeDlg m_dBarCodeDlg
getting errors.  How to call it and also i have to do changes in BarcodeDlg if clicked main button. can you plese help me to do it.

yes david. Thanks a lot david.  i got it. but what i am doing in second dialog, i getting a string and comparing with another string. if equal then enabling another button "main". if i clicked main i want enable product number combo box
in first dialog. how to enable it.
You are thinking wrong about the second dialog. It should not be trying to control the first dialog. What it should do is set some internal state that the first dialog can interrogate after DoModal() returns. The simplest (bur not best OOP practice) is to
use a public member variable, say a bool m_bSame. Then you could do
//CBarCodeDlg.cpp
void CBarCodeDlg::OnBnClickedBpswd()
CPasswordDlg dlg;
if( (dlg.DoModal() == IDOK) && dlg.m_bSame)
// enable Combo box
else
// report some kind of error
Or, even simpler, you could only allow the second dialog to return IDOK if the two strings are the same. Then you would not need the bool variable.
Or you could put the user-entered string in a public member variable and do the test in the first dialog. Then you could create the entire second dialog in the designer, without adding any code (just add a public CString variable that is bound to an edit
control).
Modal dialogs are usually just information gatherers. They should bot be reaching out into the rest of the application.
David Wilkinson | Visual C++ MVP

Similar Messages

  • HT200250 I couldn't open the files from a Canon XF 300 so I downloade the plugin from Apple but still can't open the files. I opened and clicked on the installer icon. I'm not sure the plugin was actually installed. can anyone help?

    I couldn't open the files from a Canon XF 300 into Final Cut Pro 7, so I downloade the plugin from Apple but still can't open the files. I opened and clicked on the installer icon. I'm not sure the plugin was actually installed. C
    an anyone help?
    Message was edited by: BigDealCam123

    As you probably know the Canon plug-in enables Log & Transfer in FCP7. I'm not sure whether it works with Final Cut Express or not.
    Look in Applications>Canon Utilities. I'm running 10.6 as well and that is where it's located on my machine.
    Good luck.
    Russ

  • Transfer of Open PO's from multiple co codes to single co code-  possible ?

    Hi MM Experts,
    I have a scenario where we want to transfer some Open PO's(Including MIGO/MIRO transactions) from company code say 5001, 5006 and 5007 to snother company code say 5999.
    Is it possible to do so?
    Has someone comemacross this kind of a requireemnt ?
    Thanks in advance.
    Dasaradh

    Hello its not possible to change compant code of PO
    u will have to shot close all such POs and create new PO in required company code
    reward if usefull

  • Couldn't open a file

    Hello, this morning I couldn't open any files from my iCloud, anyone having same issue?
    Error message:
    The file “[file_name].pages” couldn’t be opened.
    Version: 5.1 (1769)
    Thanks,
    ~M

    I'm seeing the same issue with iCloud, I've been using Apple iCloud since the inception, but there is something going on with the file sync lately.  I purchased more storage and I'm getting the above issue after saving a file to iCloud, the sync processing seems to invalidate the file.  I've mostly seen this with image and PDF files that I've created or saved, but also Excel when saving.
    Hopefully @apple addresses this soon, I really want iCloud to be a better alternative to dropbox, but I'm running both side by side for now.
    MacBook Pro 15" Retina and iMac 5K all running the latest Yosemite all having the same issue.

  • How can I make multiple PDF links open in the same second tab, instead of a 3rd, 4th etc.

    I am working on a project for my Universities 125 year anniversary.  Essentially I've created a 125 year long digital yearbook, with a link to the University's actual digital yearbook for each individual year.  I'm wondering if there is a way that I can make all of the yearbook links open in the same second page.
    IE:  Main Project open in a window,  when I click the 1939 Yearbook pdf hyperlink, the 1939pdf will open in the second window.  I then want to find a way so that after this, on the main page, I can click the 1940 yearbook pdf link and have the 1940 yearbook load on the second window, replacing the 1939pdf, instead of just opening the 1940pdf on a third new tab/window?
    Note: I have all of the yearbook PDF's online and downloaded, so I can make the hyperlink send you to the site, or do a download style thing. 
    Thank for any help, and if anyone needs further information just ask me!

    Hi
    Please take a look to this thread Re: Can I refresh the browser rather than open a new tab?

  • How to make a remote panel file dialog open remote directory from any computer

    Hello to everybody. I am using Labview 6.1 and I would like to know how to make a remote panel file dialog open remote directory from any computer (Not only from a specific computer. If I open the file with a specific computer, I have to conect the path of the remote machine, but if I don´t know which remote computer is going to run the aplication, how can I do it?)?

    Hi!
    first you have to know progammatically the name of the remote pc connected to your server: this is a problem!
    I did not find a straigth way, LV 6.1 doesn't allow much progammatic control on the remote panel connection feature, but I'm confident that in the next LV version this will be improved!
    The point is that the Remote Panel Connection Manager (from the Tools menu) has all the informations about the connection: client name, server vi and whatever.
    This application is embedded in the \PROJECT\REMOTEPANEL.LLB and consists of a set of password protected vis.
    So here's the trick: use VIServer to grab data from the rpcm Get Server Data.vi when the Remote Panel Connection Manager is in run mode. By this you get all the informations (not only client name)o
    f the remote panel connection. See my example.
    By the way use client machine name to build the file dialog function input path.
    If anybody has an alternative method it would be more than appreciated to share it.
    Good luck,
    Alberto Locatelli
    Attachments:
    get_remote_machine_data.vi ‏151 KB

  • Removing Open With dialog from contextual menus

    Does anyone know how to remove the "Open With..." option from contextual menus?
    Thanks

    musicwind95 wrote:
    What are you trying to do?
    I'm hoping to find an option to remove the Open With dialog which I never use. If I right click on a simple JPEG to move it to the trash and happen to land on the Open With dialog it takes almost ten seconds to populate the dialog before I can move off of it. It is a consequence of having, and using, hundreds of applications. I'm also an extensive user of contextual menus. I get stuck with that unexpected delay numerous times each day. It is annoying.

  • I am trying to open CR2 files from a Cannon EOS 1DX camera in Photoshop CS6 and I have already updated the Camera Raw Plug in but Photoshop is still giving me the cannot open files dialog box? Help?

    I am trying to open CR2 files from a Cannon EOS 1DX camera in Photoshop CS6 and I have already updated the Camera Raw Plug in but Photoshop is still giving me the cannot open files dialog box? Help?

    Canon 1DX support was added to ACR in version 6.7, 7.1.  An updated CS6 should be at level ACR 8.6.  If your ACR is not at level 8.6 try using CS6 menu Help>Updates.  If that does not install ACR 8.6 try downloading the ACR and DNG 8.6 converter and see if ACR 8.6 will install into your CS6.
    Adobe - Adobe Camera Raw and DNG Converter : For Windows
    Adobe - Adobe Camera Raw and DNG Converter : For Macintosh

  • I clicked on iMessage on my Macbook Pro today for the first time, and now NOTES keeps opening up every 5 seconds, with a new note.  I cannot stop it from opening. If I close it or force close, it opens again in 5 seconds.  I can't get rid of it.  I have

    I clicked on iMessage on my Macbook Pro today for the first time, and now NOTES keeps opening up every 5 seconds, with a new note.  I cannot stop it from opening. If I close it or force close, it opens again in 5 seconds.  I can't get rid of it.  I have tried to clear out the iMessage settings I had put in, and I've tried to adjust the Accounts to not include notes to synch.  But, Notes will not stop.  It opens a new note, and even if you ignore it, it assumes preference every 5 seconds, and the Mac is impossible to use.

    Do you have any Boot Camp or other secondary partitions set up on your system? If so then try running a disk verification routine (chkdsk, etc.) in Windows to repair the disk. While I've not heard of it happening recently, in the past errors in these partitions have resulted in stubborn ghost files appearing in OS X.

  • Remove applications from 'Open With' dialog

    I have searched seemingly everywhere for an answer to this question. When I right click on an html file (or really any other file) and to go the 'open with' dialog there is a huge laundry list of applications listed. For the html files there are DivX converters, Big Bang games, etc.
    How can I remove all of the applications that I know can not open an html file and others that I would never use to open those files either? I like the ability to easily open the file with different browsers but really dislike scrolling through 30 different applications to find them.
    I have deleted the "com.apple.LaunchServices" file and rebooted.
    I have run "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServ ices.framework/Support/lsregister -kill -r -domain local -domain system -domain user" and rebooted.
    Neither of these solutions are helping the problem at all. I even tried some Onyx program. Is there a way to "trim the fat" from that window?

    The command you ran "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServ ices.framework/Support/lsregister -kill -r -domain local -domain system -domain user" is for 10.4, it is not the correct command to rebuild LaunchServices in 10.5.
    Launch /Utilities/Terminal and copy & paste this at the command line to rebuild LaunchServices:
    Code:
    <pre class="alt2" style="margin:0px; padding:3px; border:1px inset; width:640px; height:34px; overflow:auto">/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user</pre>
    Then press return. Wait until terminal returns to the command line. Quit Terminal. After that, log out and back in or restart. That should solve it. Let us know
    -mj

  • I want to change the default file type in the Open File dialog - e.g. from Word to All Files

    I want to change the default file type in the Open File dialog - most recently specifically in Adobe Acrobat, from Adobe Files to All Files, so I don't have to do it again and again manually.  Is this possible?  Is it an OS setting or an app-specific setting?

    The Apps set the default to the file type it can open, sort of. However, there normally isn't a type specified. All document types that the app can handle will be offered.
    Adobe, and Microsoft, tend to roll their own dialogs, so they may not be standard. I don't have Acrobat, so I can't verify that. If Adobe is puting a file type selector in their open file dialogs, it would be up to them to store the preferences.
    EDIT: I checked Reader, and i see what you mean. Not terribly useful.
    Message was edited by: Barney-15E

  • Opening secondary window from javahelp window activated from modal dialog

    hello,
    has anyone had this problem before? I open javahelp from a dialog with setActivationWindow(modalDlg), but then, opening secondary windows from that javahelp appear hidden, unreachable because of the modal windows (the dialog and the help window). is there a solution for this?

    Christian,
    This problem is occuring on 2 machines which has Java 1.5. But rest of the machines which has 1.5,1.6,1.4 are supporting modal windows. So not really sure whether its a browser issue or JRE issue or it is how the modal windows behave in an inconsistent way. Really need a solution for this problem as early as problem.
    Regards,
    Rajesh.

  • How to open print dialog from web dynpro abap application

    Hi experts,
            I have a web dynpro application with several views and onone of the view there is a button that should open print dialog with printers list and all other options (standard print dialog we see in windows). I did reserach on SDN and came to now that this is a limitation of web dynpro abap. I did find some code also but unfortunately our current version of ABAP(7.0) do not support the code I found. I am not able to find any proper solution for this. Could someone please let me know how I can open a print dialog by clicking on a button in web dynpro abap? Any sample code or any information would be greatky appreciated.
    Thanks.
    Mithun

    Hi Mithun,
    Have you check this?
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/f8/872806981d4411b5ce51a00207ed31/content.htm
    and also go through..
    How to print in a web dynpro application
    Print button
    Cheers,
    Kris.

  • Open/save dialog boxes not working correctly.

    Environment: CS6 (PS 13.0.1) Mac OS X 10.7.5. Plenty of hardware. (Generally starting with .CR2 RAW.)
    Two open/save problems
    Recently (maybe since the 13.0.1 update??), I have been having problems with the open and save as dialog boxes.
    First. The open file dialog always defaults to Enable: blank (i.e. no file types enabled). Each time I have to  go to the bottom of the dropdown list and select "All readable documents" before I can open ANY type of file. I've searched in everyway I can think of looking for some method to have OPEN default to "all readable" but can't find anyway to do this. Anyone have a suggestion? I admit this is a nuisance more than anything, but when whipping around at deadline having to stop each time and make this change is irritating. No other program has this difficulty (including Illustrator and InDesign). PS5.5 did not exhibit this behavior on the same machine.
    Second. When I save as and try to select any file format, say going from psd to tiff, the format dropdown list ALWAYS selects the format ABOVE the one I choose. Example: If I select JPEG, PS tries to save as .iff. If I pull the selection down to JPEG2000 it will then save as standard JPEG. Again just an irritant but, tiff (which I need for several other programs) is last on the list thus there is no way I can go one below it to get tiff format selected. It always comes out as png. Also note that the Format selection indicates the correct format - in the case of tiff the dialog box shows TIFF selected, but the program is apending .png. (Continuing the save as (without altering my selection) always results in the incorrect format no matter what the Format dialog says in the save as operation.) Again, no other program I work with (including several Adobe products) exhibits this behavior.
    I seriously need to be able to save as tiff. Anyone with any thoughts on this?
    Thanks much,
    Robert

    I appreciate all responses particularly from an "Official Adobe" human being!
    Unfortunately, a significant amount of effort has been expended with no joy here.
    I have done the following;
    (1) examined every plug-in folder for duplicates - None found
    (2) deleted the symlinks (aliases) Topaz created referencing their plug-ins in /Library/Application Support
    (3) reinstalled the Topaz bundle - no change
    (4) Spoke at length with Topaz support and have been assured that all of their plug-ins are CS6 compatible.
    (5) Have had the same conversation with Nik regarding their 2 plug-ins - assured that they are compatible.
    Frankly I'm stumped here. I've combed my system in everyway I can without any change in PS behavior - on Open it defaults to blank and "Save as" selects the wrong format.
    Question for the experts. Would deleting PS completely and then reinstalling make a difference or am I now in uncharted territory and on my own?
    Thanks for all assistance,
    Robert
    Still need to save as TIFF but can't seem to get there.

  • What does the open file dialog do 'under the hood' and is there a way to simulate it

    What does the open file dialog do 'under the hood' and is there a way to simulate it?
    I have a bug in my code (that I've posted about before, here) which I can't fix at the moment, but I do have a workaround.
    Briefly, the bug:
    I call a dll from a function node, to initialise and run a spectrometer. If I start up the PC, LabVIEW and run my vi the code runs without complaint, the first call to the dll to initialise the spectrometer doesn;t return an error but the spectrometer is not detected either.
    I've tried various solutions, see the link above, and none work
    The workaround:
    If, at any time before running the code containing the function node I open an 'open file' dialog window, select the dll and click ok/hit enter then everything is fine. When I run the main code the spectrometer is detected.
    I use an express vi to open the file dialog, I specify the start path and file name as constant inputs and just click ok/hit return when the dialog pops up. I don't do anything with the dialog outputs. In fact the vi that contains the open file dialog can be run before the project containing the bug is even open.
    I have to do this everytime I turn the PC on.
    So, either
    1) Can somewone suggest a fix for the original bug?
    2) What is the easiest way to simulate the enter keypress when the open file dialog pops up
    or
    3) Can someone tell me what the open file dialog does under the hood that somehow causes the dll to work and can it be simulated in straight LabVIEW
    I suspect that the dll itself is dodgy ( I have in the past talked to the supplier but not got very far, and I will try again but I would like a quick, temporary solution too). I'm guessing that the file dialog is making some kind of check on the file, and possibly registering its presence with the OS (winXP). I tried using the file/folder exists vi to see if checking the file like that worked but no luck.
    Any help greatly appreciated.
    Dave

    Hi David
    I am very conscious about thread hijacking but this sounded like my issue so I hope you dont mind me asking about your issue. I am hoping that you have a spectrometer from the same vendor as me and its not just me seeing an Error 1097 issue. My spectrometer is from a company called Stellarnet.
    So far I have unable to get it to work with other VIs. There is one condition where I can get it to work but its no good for me.
    Case 1
    I open the VI in a fresh labview environment with no other VIs in memory. The code runs with no issue.
    Case 2
    Labview is not opened. I double click the spectrometer VI in windows explorer.  The VI opens but it fails to run resulting in Error 1097. Personally, I dont see the difference between this and Case 1 above and yet it fails.
    Case 3
    If I already have other VI's in memory and try to load the spectrometer VI and run it fails with Error 1097. This case is the one that most important to me. I have a test executive that will load test VIs dynamically and I can't get this to work. Same problem Error 1097.
    I wanted to share what I have seen with you and to let you know that maybe somebody else has the same issue. I am convinced its the DLL but the vendor dis-agreed saying it was LabVIEW. I couldn't convince him otherwise.
    Thanks in advance
    David

Maybe you are looking for