Visual C++ :: MDI Switch Between Tabbed And Cascaded Views

Jan 16, 2014

Essentially I have an MDI that I want to be able to switch between having all my views tabbed when one is maximized and having all my views cascaded or tiled to their previous sizes. The MFC app wizard provides options for either tabbed or untabbed views.

How to implement this? What is the class that MFC uses to place each of the MDI child frames in tabs?

View 1 Replies


ADVERTISEMENT

Visual C++ :: MFC MDI Tabbed Child Window Positioning

Jul 18, 2013

Is it possible to specify the size/position of tabs in an MFC MDI tabbed application?

I am trying to save the open tabs when exiting the program and restoring them when the application is relaunched. I have come up with a method of saving and reloading the tabs, but I cannot restore their position.

I have seen SaveMDIState and LoadMDIState but I can't make it do anything and I'm also not sure if it's what I need.

View 3 Replies View Related

Visual C++ :: Tabbed Dialog - Getting Text From Edit Control

Apr 26, 2014

I have a tabbed dialog with a couple of Separate dialogs. I created classes of CDialog for each dialog. Im trying to get the text from the edit control from the tabbed dialog and it appears in a message box when I press a button on the main dialog.

Code:
myDialog test;
test.UpdateData(TRUE);
CString bla = test.m_edit1;
test.UpdateData(FALSE);
MessageBox(bla,bla,MB_OK);

The m_edit is a variable of CString for the edit box

it gives me a error and crashes.

How do I get the text from the other dialogs edit control?

View 8 Replies View Related

C# :: Compare Tree Views?

Aug 7, 2014

I have two Tree views populated from XML files. I have them loaded side by side in a windows form. treeView1 and treeView2. I need to compare these two treeviews and highlight any difference in any of the nodes. I am using C#.NET Visual Studio 2012 professional.

treeView1
BIOS_DETAILS
-Manufacturer
-- Hewlett Packard

[Code].....

I need to compare these and highlight the differences in color.

View 14 Replies View Related

C++ :: Characters With Integers Tabbed To Right?

Oct 2, 2014

I took a month's break from programming, and got rusty. Here's the problem:

The character 'b' is char('a'+1), 'c' is char('a'+2), etc. Use a loop to write out a table of characters with their corresponding integer values:

a (tab) 97
b (tab) 98
...
z (tab) 122

View 2 Replies View Related

Visual C++ :: Switch From TXT To RTF During Runtime

May 2, 2015

While running a Doc/View SDI, is there any way to switch from text mode to rtf mode during runtime? Search reveals nothing.

Say I have an editor and I want the app to use text, I can set the ctor as follows.

Code:

CEditorDoc::CEditorDoc() {
// TODO: add one-time construction code here
m_bRTF = FALSE;
}

But once I've done that and compiled the app, while it's running, is there a way for the user (or programmer) to change the mode back to RTF? One solution that occurred to me is to use 2 document classes, but that's a hassle.

View 8 Replies View Related

Visual C++ :: Using If Or Switch With LPCWSTR?

Oct 9, 2013

i am trying to read an ini file and usse an if or switch to take action.

i have this in ini.h file

LPCWSTR ini_read_string(LPCWSTR _ini_File_Name, LPCWSTR _ini_Section_Name, LPCWSTR _ini_Key_Name, LPCWSTR _ini_Default )
{
TCHAR _Rvalue[5];
GetPrivateProfileStringW(_ini_Section_Name,_ini_Key_Name,_ini_Default,_Rvalue,5,_ini_File_Name);
return (LPCWSTR) _Rvalue;
}

now when i do this:

OverLay[0]=ini_read_string(map_file_ini,_T("Section"),_T("Key"),_T("NULL"));
if(OverLay[0]==_T("NULL"))MessageBox(NULL,_T("File or kay not exists"),_T("Error"),MB_ICONEXCLAMATION|MB_OK);

but the key dos not exists, so it will return NULL, but yet i am not getting the message box (LPCWSTR) i also dit try

if(OverLay[0]=="NULL"), if(OverLay[0]==L"NULL"),if(OverLay[0]== (LPCWSTR)"NULL"), if(OverLay[0]== (LPCWSTR)L"NULL"), if(OverLay[0]== (LPCWSTR)_T("NULL"))

but it never dit work.to be sure of the returning value i also dit this

MessageBox(NULL,ini_read_string(map_file_ini,_T("Section"),_T("kay"),_T("NULL")),(LPCWSTR)L"Error!",MB_ICONEXCLAMATION|MB_OK);

and ther it is, an message box with the text "NULL" so why is the if(OverLay[0]==xxx) not working? and i also need a big list so an working switch(OverLay[0]) will be nice as well (else i need to do if/ else if many times)

View 14 Replies View Related

Visual C++ :: File Processing Within A Switch?

Nov 17, 2014

The error ive been getting with this code is after i go to the check out option, enter the data then click (ctrl + z). Then program glitches back and forth from the menu to the check out option continuously and im not entirely sure why.

Heres my code:

Code:
#include <iostream>
#include <windows.h>
#include <iomanip>
#include <fstream>
using namespace std;
void checkOut(){
cout << setw(10) << "Ministry of Health Hospital System

[code]....

View 7 Replies View Related

C :: Use Switch Case As A Menu To Switch Between Patients

Dec 30, 2014

I am trying to make a program which manages the data of 5 different patients (its an uni assignment), and i want to use a switch case as a menu to switch between the patients. All other functions (as for example putting the infromation on a file) work, but i cant figure out to bring the switch to work. First it asks for the number of the patient which should be worked with, this works perfectly, but afterwards changiung between the persons doesnt work as thought. It should ask everytime after it switches to one patient (i removed some functions to make it easier to read) and then asks to which it should jump next. If i put the number of one case (lets say 3) it just stops the program.

********Example:
user@pc ~/wherever $ ./program
current variables:
jo = 2
a = 0
1 //the entered number
The variable a = 1
patient 1
Enter the number of the next patient2
// and then it closes
**************

The same thing happens if i compile an example code from a book, it writes the first case and then stops.

I looked already through the forum but didnt find a person with a similar problem, maybe i didnt dig deep enough.

I am running Linux Mint 17 and use gcc as compiler.

Code:

include <stdio.h>
#include <stdlib.h>
int a=0;
int jo=2;
int main(void){
printf("current variables:
jo = %d
a = %d

[Code]...

View 13 Replies View Related

C :: How To Use String And If Or Switch Together

Oct 11, 2013

How to use string and if or switch together

I want to make something like some users using the same machine so they need to be registered to the system and the their id something like this (H510698541) and their information should appear on the screen.

View 2 Replies View Related

C++ :: From If Else To Switch Statement

Mar 6, 2013

I was wondering how you would put this if else statement to a switch statement.

void PlayerDB::AddPlayer(const Player& avatarPlayer) {
char * playerName = new char[avatarPlayer.lenName()];
Player*player = NULL;

[Code] ....

View 1 Replies View Related

C++ :: Switch Statement Is Not Working?

Aug 16, 2014

okay so like case 2 and 3 is not working, also the program is still not finish but why isn't case 2 and 3 not functioning well on the switch part? case 1 works just fine

Code:
#include<stdio.h>
main ()
{
//passcode part (passcode is 1234)

[Code].....

View 5 Replies View Related

C :: Possible To Switch Two Array Positions?

Feb 12, 2015

I have a fundamental question due to my lack of understanding how arrays work.Let say I have a character array (byte array).

1. do array elements have memory adresses? i guess not but ....
2. if yes is it possible to switch two array positions? For examle:

a[x] change with a[y] for x,y < |a|

as oppose to changing values assigned to individual array positions.

View 2 Replies View Related

C :: LED Switch On When Error Detected?

Jul 9, 2013

I'm currently doing a project which will trigger an alarm and light up an LED when a character 'E' is detected from a bluetooth input. I'm supposed to program a pic18f4525 board.

I'm having troubles with where to start on the codes to enable the LED to light up upon detection of character 'E'. I'm using ports RD0-RD3. This is how I initialised them in the main loop.

Code:
TRISD = 0b11000000;
PORTD = 0xC0;

Am I doing the initialising right? Also, how to program it to light up when the character's detected?

View 2 Replies View Related

C :: Operators In Switch Statements?

May 20, 2013

Switch case statements are a substitute for long if statements that compare a variable to several "integral" values ("integral" values are simply values that can be expressed as an integer, such as the value of a char).

So does that mean switch statements can only test if variable == value and nothing more, like > < >= <= != etc... ? I tried to make a program to test this and it seems like switch statements are limited to == but I'm not sure, maybe I'm doing something wrong.

This is the program I tried to make to test this:

Code:
#include <stdio.h>
int main () {
int n;

[Code]....

So is it true that switch statements only work with the built in == operator? if that was the case then I would feel rather meh about switch statements.

View 7 Replies View Related

C :: Switch Statement Array

Apr 15, 2014

so I am trying to have an switch statement array. but every time i complete a case statement the whole process is returned. the thing is i want the menu to stay up even if i complete the case.

View 2 Replies View Related

C++ :: Switch Statements In GLUT

Jan 3, 2014

I'm making a game in OpenGL GLUT. A ball is going to move forwards along the Z axis and hit a wall. I want to be able to move the ball left and right, up and down before firing it off on the Z axis. I'm using glutSpecialKeys for this, and I've got everything set up, but I'm not sure how I use it with a switch statement? Here is a snippet of code:

void Special_Keys (int key, int x, int y){
switch(key){
case GLUT_KEY_UP: //do something
break;
case GLUT_KEY_DOWN: //do something

[Code] .....

Where the comment is saying "do something", I'm not sure what I actually need to do? Is it a method or what?

View 1 Replies View Related

C++ :: How To Link A Switch Statement To A If / Else

Aug 8, 2014

The sample output of this program would be:

Please select:
1 - Year
2 - Day
3 - Month
Input choice: 1
Input Number: 2
I'm a Sophomore!

Please select:
1 - Year
2 - Day
3 - Month
Input choice: 2
Input Number: 2
It's Tuesday.

Please select:
1 - Year
2 - Day
3 - Month
Input choice: 3
Input Number: 2
February. Heart's month!

Here is my code, I only typed the Year(levels) yet because when I tried to input 2(day) and 3(month) for the Input choice and after that, Inputting a number to 1-4 would yield the same result to case 1's year levels.

#include <stdio.h>
#include <conio.h>
using namespace std;

[Code].....

how to link the case 2 to days and case 3 to months?

View 1 Replies View Related

C++ :: How To Use Getline With Switch Statement

Sep 17, 2014

I have a problem with the switch statement because it doesn't prompt me to input something.

#include <iostream>
#include <fstream>
#include<cstring>
using namespace std;
//Compiler: Dev C++ and cygwin
void rd() {
string txt;

[Code] ....

I want to get rid of this kind of output ...

View 5 Replies View Related

C++ :: Converting If / Else To Switch Statement

Oct 8, 2014

if( vehicleUse == 'C' ) // Carpool
{
// TODO: Convert to a switch statement

if( vehicleLoad == 'E' ) // 6-8
cout << "Ford Windstar" << endl;
else if( vehicleLoad == 'F' ) // 8-10

[Code] .....

View 1 Replies View Related

C++ :: Compare Value In Switch Statement?

Sep 23, 2013

is it possible to compare value in switch statement? i.e: a > b

View 5 Replies View Related

C++ :: Switch Statement As A Menu?

Nov 1, 2013

I am using a switch statement as a menu. If I enter a non-integer value as my choice, I expect the error message , "Invalid entry", to display but instead the output keeps running.

View 2 Replies View Related

C/C++ :: Switch Statement Using Seekg

Mar 21, 2014

Right now I have to use seekg to read a letter from a text document then using a switch statement i have to show what that letter is

#include <iostream>
#include <fstream>
#include <math.h>
#include <time.h>

[Code]....

View 7 Replies View Related

C/C++ :: How To Switch Characters In Array

May 1, 2014

I have tried to search all about strings,I have the occurrences and have worked out what letter corresponds with which. I have searched that much i can remove the vowels and reverse my string but I dont know how to swap them. This is what i have this far. When it compiles it just prints the decipher is:

If i even find out am i on the right track ive used caps when swapping to try and stop the doubles over writing,...

#include<stdio.h>
#include<string.h>
int main(void){
int i,count=0;
char secretText[] = "lopsy, hssepokd wl okrhsowk:

[code]....

View 1 Replies View Related

C/C++ :: File Processing Within A Switch?

Nov 16, 2014

The error ive been getting with this code is after i go to the check out option, enter the data then click (ctrl + z). Then program glitches back and forth from the menu to the check out option continuously and im not entirely sure why.

Heres my code:

[#include <iostream>
#include <windows.h>
#include <iomanip>
#include <fstream>
using namespace std;
void records(){
cout << setw(10) << "Ministry of Health Hospital System

[code].....

View 1 Replies View Related

C++ :: Switch Statement Falling Through All Cases

Jan 16, 2014

I was getting errors and I looked into the error and it told me to fix it by adding Code: { } in my case statements. I did, it compiled but fell through the whole thing. Lets say I enter 1, it outputs the was not found 5 times in a row.

Code:
void addressbook::EditNameOrDate() {
std::cout << "Enter 1 to Edit the contacts First Name: " << "
";
std::cout << "Enter 2 to Edit the contacts Last Name: " << "
";
std::cout << "Enter 3 to Edit the contacts Street Address: " << "

[Code] .....

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved