Announcement

Collapse

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

MDI question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MDI question

    I've not written any MDI programs except to look at PBNOTE in samples and a couple of examples by others. My question is: Is there any way to create a MDI app without it all being in one huge EXE?

    BOB MECHLER

  • #2
    ?????

    Well, I guess you could put some functions in a "*.DLL" file, but if you need the procedures, you need the procedures, so there won't be any compiled code space savings either on disk or in RAM.

    What was it you had in mind as an option, or thought you might like to do instead?

    MCM
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      MDI Size Reduction

      The on disk compiled size of PBNote2 is 61 KB. Which leeads to question; Just how small were you hoping to make you app.??

      Comment


      • #4
        Well, to get the MDI look and feel.

        In an app I'm working on there is a single entry into the system which consists of quite a few exe's about 300 kb a piece. There is a login which creates an instance security token based on who logged in. I keep this in a memory mapped file and none of the Exe's will run without getting a correct value from this memory mapped file. There is a main menu from which all programs are called and to which all programs return prior to logging out of the system.

        Up till now you could only jump from one program to the other, which worked fine and customers did not complain. Now with some heavy powerusers they would like to run several programs at a time (imagine that). They actually set up several users and log in several times to get the ability to do this on one machine with multiple monitors.

        All of our customers have a standard set of programs and a set of custom programs written especially for them. In other words we need to keep functionality down to separate exe's controlled by the login.

        Previously, when a user selected a program, I would write the security info to the memory mapped file, shell to the new program, wait a second before exiting the menu program to make sure the new program could find the memory mapped file created by the menu. This works fine. As each program jump is done the memory mapped file is updated until the user eventually gets back to the menu and logs out.

        What I want to do is not exit the menu after shelling to a chosen program but keep track of the Process id's, and the program names in the menu in two arrays. This way they can open 10 or so programs and leave them open all day if they want.

        When they are finished and ready to log out, I would use OpenProcess with the process id's and if I can get a handle, I know the process is still going on. I would then notify the user that a particular program is still running and not allow them to log out until all programs launched from the menu are all closed.
        I've had some success in doing this so far.

        I would still like to be able to present this as a frame around the menu and programs that are called and have it work in such a way as the user can minimize programs they want left open but not to the task bar. I'd like to minimize them the way an MDI interface does it.

        Also, I'd like the applications running to act like MDI child windows when the outside frame is resized or minimized to the taskbar.

        To me a MDI application is acting like a Windows Desktop inside a Windows Desktop. Isn't the Windows Desktop just a charged up ListView control?

        May not be possible but is a tantalizing way to give our customers the look and feel of an MDI app and retain the individual small exe's that work so well with our constant updating and customization.

        Bob Mechler

        Comment


        • #5
          Bob,
          Minus the whole Login, and keeping track etc...

          Is what you are looking at is a batch of small exe's that each does a job and can run fine without another exe? (in this case some "Traffic Cop" would make it all work as one app enclosed in your window (kinda like Photoshop, you can have multiple picture open, work on one, but they all appear in Photoshop, and not all over your desktop) ?
          (although bad example, because the tools can float anywhere on the desktop)
          Engineer's Motto: If it aint broke take it apart and fix it

          "If at 1st you don't succeed... call it version 1.0"

          "Half of Programming is coding"....."The other 90% is DEBUGGING"

          "Document my code????" .... "WHYYY??? do you think they call it CODE? "

          Comment


          • #6
            That's correct. Traffic cop with a MDI uniform on.

            I'm looking for ideas on how to make an application look like a MDI application but each MDI child actually be an EXE called from the pseudo MDI frame window. Each exe's dialog will need to be restricted to the pseudo MDI frame client area. When resized and/or minimized it needs to act as a unit. Also if an exe within the MDI frame is minimized that it minimize to the bottom of the MDI frame and not the task bar. The MDI frame will also need THICKFRAME style and all EXE's within the frame comply with sizing of the outer pseudo MDI frame.

            It's probably impossible to get all of these features. I'm pretty sure I can get the application to support multiple exe's running at the same time and track the process id's. To preserve security I'll need to enforce that all open exe's be exited cleanly before I allow them to log out. It's the other cosmetic MDI look alike features that I've been requested to make happen but don't know if it's possible or even desirable.

            Surely other programmers have inherited a Dos style application that they brought to Windows without completely rewriting them.

            Bob Mechler

            Comment


            • #7
              AFAIK if the EXEs are not cooperating applications, this cannot be done.

              e.g., any of the EXEs can do a CreateWindowEx() with no parent Window specified (or specifying HWND_DESKTOP), meaning that window is owned by the desktop meaning it minimizes to the task bar and sizes and locates itself whereever it darn well pleases itself to do so.

              If these are all CONSOLE applications, now you can do something, assuming these programs 'obey' the directions supplied in the STARTUPINFO structure used by CreateProcess(). (Eg PB/CC programs thru at least 3x do not).

              Of course if these applications are cooperating YOU can do whatever you darn well please vis-a-vis size/location, etc.

              MCM
              Michael Mattias
              Tal Systems Inc. (retired)
              Racine WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                Bob, I made the same mistakes before, and "Semi" learned from them (Aka...my next version, I am going back to basics knowing what I know now and not what I knew then")

                In your case (I can not remember what happens when each EXE is truly a separate EXE and you Max Min) but beyond that, the short answer is you can use "SetParent" to make it look like part of your MDI environment

                (most likely a few other problems you will run into, but may either be solved, or find "You Can't Do That")

                The DOS side of things (I REALLY need to talk to those that use PBCC so much...(maybe its a market thing or whatever) but I thought DOS looking (whether real or just looked it) was basically dead

                (although do NOT get me wrong, cause I always go to DOS when I can not do it Windows wise)...(and I probably already sparked another debate unfortunately)

                Minus all that...I see no reason as long as each exe is separate and one has nothing to do with the other, that you could not just make it "Look" like it was all one program (damned MDI cops )

                On the other..if 1 part needs another part it gets trickier, and you may be better off building all in 1 big app, or separate dll's that happen to show your interface, and get mapped into your main traffic cop

                Confusing I know...but I think you get what I was trying to say
                Engineer's Motto: If it aint broke take it apart and fix it

                "If at 1st you don't succeed... call it version 1.0"

                "Half of Programming is coding"....."The other 90% is DEBUGGING"

                "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                Comment

                Working...
                X