Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

rbwest86

@rbwest86
About
Posts
43
Topics
18
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • GetRegValue and using it correctly, need help.
    R rbwest86

    Ok, so after trying for hours on end to get things working correctly I am posting here. I am new to programming and trying to learn. Please provide me with clarification of how I have this screwed up. Also, please include how I can fix this. I learn through practicals. Also, I have changed things so many times trying to call the function correctly with assigning the correct arguments but I am just so confused at this point I am asking for help.

    #define _WIN32_WINNT (0x0601)
    #include <windows.h>
    #include <winbase.h>
    #include <winreg.h>
    #include <iostream>
    #include <iomanip>
    using namespace std;

    int main()
    {
    // REGISTRY PORTION
    DWORD pdwQuotaAllowed, pdwQuotaUsed;
    GetSystemRegistryQuota(&pdwQuotaAllowed, &pdwQuotaUsed);

    // Backup Current Registry
    // Open Registry Key (RegGetValue)
    DWORD dwFlags;
    RegGetValue(&dwFlags);
    // Delete Contents of the Key (RegDeleteValue)
    // Write New Content of the key (RegSetValueEx)
    // Close Registry Handle (RegCloseKey)

    // DISPLAY RESULTS
    cout << pdwQuotaAllowed << endl;
    cout << pdwQuotaUsed << endl;
    return 0;
    }

    C / C++ / MFC help windows-admin

  • Win32 Processor - How to implement this correctly?
    R rbwest86

    bump?

    C / C++ / MFC tutorial visual-studio com hardware question

  • Win32 Processor - How to implement this correctly?
    R rbwest86

    Ok, So after looking at doing this I feel I need to use WMI (Windows Management Instrumentation). Now to make sure I understand this, WMI is a tool that windows uses to read hardware information very accurately? Now back to the programming portion. In order for me to use Win32_Processor Class, I first have to initialize CoInitilizeEx and CoInitilizeSecurity? I am a little confused about this. The COM (Component) is a library, and this library tells WMI and the Win32_Processor Class how to communicate with hardware? Just making sure I understand everything and trying to put everything together.

    C / C++ / MFC tutorial visual-studio com hardware question

  • Win32 Processor - How to implement this correctly?
    R rbwest86

    I am tying to figure out and start small on retrieving hardware information. I am making a very simple program that does this: 1.) Find processor information 2.) Write found information to a log file ".txt" 3.) Display the found information on the screen Very simple right? So I found this Win32 Processor Class at: Win32 Processor Class What I dont understand is how to implement this. On the website it does not say how to utilize this code. If it does, I do not see the example that is being displayed. I just see the breakdown of the Win32 Processor class and not a typical usage scenario. So if anyone can please provide me some clarification on how to utilize this class correctly please respond back to this with what bits of information I have failed to recognize.

    C / C++ / MFC tutorial visual-studio com hardware question

  • Classes and Inheritance, question inside.
    R rbwest86

    Thank you very much for the prompt response. So I take it that the non-flying birds will not and can not inherit CBird class. So there would have to be another class to define CNonbird correct?

    C / C++ / MFC question oop learning

  • Classes and Inheritance, question inside.
    R rbwest86

    Hello everyone, Just so its known this question is related to my programming class. Here is the question out of the book: "Is it reasonable to create a CHawk by deriving from CBird? How about a COstrich? Justify your answers. Derive an avian hierarchy that can cope with both of these birds."

    class CBird
    {
    protected:
    int wingSpan;
    int eggSize;
    int airSpeed;
    int altitude;
    public:
    virtual void fly() { altitude = 100; }
    };

    I thought that the class has to be declared first. Like #include CBird.h goes in the include list. If I am wrong, then the question from the book is YES, CHawk and COstrich can be inherited from CBird. Can anyone provide me with clarification to classes related to OOP? Thanks in advance. V/R Rob

    C / C++ / MFC question oop learning

  • Structures and Classes giving me problems. This program simply calculates volume of a CBox class.
    R rbwest86

    thank you everyone. I figured out what the problem was. Thank you all again.

    C / C++ / MFC performance

  • Structures and Classes giving me problems. This program simply calculates volume of a CBox class.
    R rbwest86

    Hello all, I am working on my homework and I am having issues. When I added a third box to the equation, the total volume in bytes went from 24bytes down to 8bytes. This is not right, when adding another box to my program it should increase in size. But all I had to do was add a third box and calculate the Length, Width, and Height of the third added box. Then calculate the total volume for all three boxes. Sounds very simple but after adding my third box and changing the code a little bit, I am having issues. I do not understand why it is not adding the two boxVolume1 + boxVolume3 together and then displaying it. The source is listed below. Thank you all to can contribute to pointing out why this program is not working correctly.

    #include <iomanip>
    #include <iostream>
    using std::cout;
    using std::endl;
    class CBox // Class definition at global scope
    {
    public:
    double m_Length; // Length of a box in inches
    double m_Width; // Width of a box in inches
    double m_Height; // Height of a box in inches
    };
    int main()
    {
    CBox box1; // Declare box1 of type CBox
    CBox box2; // Declare box2 of type CBox
    CBox box3; // Declare box3 of type CBox
    double boxVolume1 = 0.0; // Stores the volume of a box1
    double boxVolume3 = 0.0; // Stores the volume of a box3
    double volumetotal = 0.0;
    box1.m_Height = 18.0; // Define the values
    box1.m_Length = 78.0; // of the members of
    box1.m_Width = 24.0; // the object box1
    box2.m_Height = box1.m_Height - 10; // Define box2
    box2.m_Length = box1.m_Length/2.0; // members in
    box2.m_Width = 0.25*box1.m_Length; // terms of box1
    box3.m_Height = 108.0; // Define the values
    box3.m_Length = 32.0; // of the members of
    box3.m_Width = 18.0; // the object box3
    // Calculate volume of box1 and box3
    boxVolume1 = box1.m_Height*box1.m_Length*box1.m_Width;
    boxVolume3 = box3.m_Height*box3.m_Length*box3.m_Width;
    cout << endl
    << "Volume of box1 = " << boxVolume1;
    cout << endl
    << "Volume of box3 = " << boxVolume3;
    cout << endl
    << "box2 has sides which total "
    << box2.m_Height+ box2.m_Length+ box2.m_Width
    << " inches.";
    // Calculate total volume of all boxes
    volumetotal = boxVolume1+boxVolume3;
    cout << volumetotal;
    cout << endl // Display the size of a box in memory
    << "A CBox object occupies "
    << sizeof volumetotal << " bytes.";
    cout <<endl;
    return 0;
    }

    C / C++ / MFC performance

  • Making an adaptive studying application [modified]
    R rbwest86

    Ok, this is what I have so far:

    // Robs N+ test question overview

    #include <iostream>
    #include <string>

    using namespace std;

    int main()
    {

    // Local Variables
    int userinput;
    int inputcounter = -1;
    int correctanswer;
    int wronganswer;
    int choice;
    int A,a,B,b,C,c,D,d;

    // Welcome Message
    cout << "Roberts Network+ Test Questions" << endl;
    cout << endl;
    cout << endl;
    cout << "Please Select a Chapter:" << endl;
    cout << "Chapter One = 1" << endl;
    cout << "Chapter Two = 2" << endl;
    cout << "Chapter Three = 3" << endl;
    cout << "Chapter Four = 4" << endl;
    cout << "Chapter Five = 5" << endl;
    cout << "Chapter Six = 6" << endl;
    cout << "Chapter Seven = 7" << endl;
    cout << "Chapter Eight = 8" << endl;
    cout << "Chapter Nine = 9" << endl;
    cout << "Chapter Ten = 10" << endl;
    cout << "Chapter Eleven = 11" << endl;
    cout << "Chapter Twelve = 12" << endl;
    cout << "Chapter Thirteen = 13" << endl;
    cout << "Chapter Fourteen = 14" << endl;
    cout << "Chapter Fifteen = 15" << endl;
    cout << endl;
    cin >> choice;

    // START SWITCH
    switch (choice)
    {
    case 1: goto chapterone;
    break;
    case 2: goto chaptertwo;
    break;
    case 3: goto chapterthree;
    break;
    case 4: goto chapterfour;
    break;
    case 5: goto chapterfive;
    break;
    case 6: goto chaptersix;
    break;
    case 7: goto chapterseven;
    break;
    case 8: goto chaptereight;
    break;
    case 9: goto chapternine;
    break;
    case 10: goto chapterten;
    break;
    case 11: goto chaptereleven;
    break;
    case 12: goto chaptertwelve;
    break;
    case 13: goto chapterthirteen;
    break;
    case 14: goto chapterfourteen;
    break;
    case 15: goto chapterfifteen;
    break;
    default: cout << "Error, invalid entry." << endl;
    }

    // Start While
    while (inputcounter <= 20)
    {
    // Chapter One
    chapterone:
    system("cls");
    // Question 1
    cout << "Fill in the blank." << endl;
    cout << "Loosely defined, a ____ is a group of computers and other devices (such as printers) that are connected by some type of transmission media." << endl;
    cout << "A.)Network " " B.)Router " " C.)Switch " " D.)Internet " << endl;
    cin >> userinput, inputcounter ;
    ++inputcounter ;

    // Start If Statement
    if (userinput == B || userinput == b || userinput == C || userinput == c || userinput == D || userinput == d

    C / C++ / MFC question help tutorial discussion

  • Making an adaptive studying application [modified]
    R rbwest86

    K I just got done reading that power point file you sent me. Now after reading it I think I need to "flush" the stream? so I should include a cin.clear() ? Im a little confused. Because I need to store the amount of correct answers, and the amount of incorrect answers. I will mess with it more in the morning.

    C / C++ / MFC question help tutorial discussion

  • Making an adaptive studying application [modified]
    R rbwest86

    thank you for helping me with a lot of my syntax problems. I am still learning C++ obviously. Now another question I have is how to limit the users input to just A-D. If you put in 0 the program buggs out. So how can I implement more controls in my program? A separate note is how to make the program progress correctly. If you get it wrong, I need it to count the questions wrong along with the correct questions and display the results at the end. Do I need to associate userinput with correct and wrong strings?

    C / C++ / MFC question help tutorial discussion

  • Making an adaptive studying application [modified]
    R rbwest86

    here you go:

    // Chapter One
    chapterone:
    system("cls");
    cout << "Fill in the blank." << endl;
    cout << "Loosely defined, a ____ is a group of computers and other devices (such as printers) that are connected by some type of transmission media." << endl;
    cout << "A.)Network " " B.)Router " " C.)Switch " " D.)Internet " << endl;
    cin >> userinput ;

    // Start If Statement
    if (userinput == B,b,C,c,D,d)
    cout << "Sorry, that was a wrong answer." << endl;
    else
    cout << "Congradulations, your answer is correct!" << endl;

    system("cls");
    cout << "Fill in the blank." << endl;
    cout << "Loosely defined, a ____ is a group of computers and other devices (such as printers) that are connected by some type of transmission media." << endl;
    cout << "A.)Network " " B.)Router " " C.)Switch " " D.)Internet " << endl;
    cin >> userinput ;

    C / C++ / MFC question help tutorial discussion

  • Making an adaptive studying application [modified]
    R rbwest86

    thank you very much, I am reading that now. Now I have a question. I have the program ask the question "What is the answer to this queston?" It then reads the users input, and checks if the answer was correct. If the answer was correct, it will continue. The problem it reads the user input and checks it with the answer, the program exits. I think the problem is its not clearing the user input for the next question.

    C / C++ / MFC question help tutorial discussion

  • Making an adaptive studying application [modified]
    R rbwest86

    Hello all, I am trying to figure out how to make an adaptive program, which asks questions and if you get it wrong, it will ask you another question in that area. I know this will utilize arrays but I am just asking for some guidence on if I should use looping statements or write the whole thing out. Thoughts on where to start? "EDIT: The source is on the 9'th reply to this thread. Please read it to help me out." V/R Rob

    modified on Thursday, January 28, 2010 10:25 AM

    C / C++ / MFC question help tutorial discussion

  • Reading a (MAC) Address on my (NIC) or any other hardware device information.
    R rbwest86

    Thanks for all to who responded. To answer your question, I am looking to retrieve any and all information if possible from any hardware device. This is a way for me to learn how to tap into the fingerprint of hardware devices such as (NIC)'s. All for learning experience. I am taking a Networking class and want to make a simple program which can retrieve information from the (NIC) or entire network.

    C / C++ / MFC tutorial c++ sysadmin hardware question

  • Reading a (MAC) Address on my (NIC) or any other hardware device information.
    R rbwest86

    Hello again everyone, I am posting this after a long night of research. Hopefully when I wake up I can begin to take whatever helpful information replied to this message and continue onwards. My goal is to be able to read information from devices, and in this example my Network Interface Card. I want to learn how to do this in C++ which is why I posted here instead of the Hardware and Devices section. So what am I asking for? A good reference on where to start with reading information from hardware devices. Once again thank you all in advance for pointing me in the right direction. This web site has been nothing but helpful to me and I learn something new every time I browse around. V/R Rob

    C / C++ / MFC tutorial c++ sysadmin hardware question

  • Program Which: Takes numbers from a user, and sum's them.
    R rbwest86

    Now that the program adds the numbers and provides the sum at the end, I need to provide a means of displaying how many times a user input something. The example output would be: Sum = 134 Total numbers of inputs = 8 So I have been looking to find something on counters. I have looked at multiple web sites yet again and can not find anything. I have fixed my previous code and it is listed below. Once again, I DO NOT WANT THE ANSWER, I WANT THE REFERENCE SO I CAN LOOK IT UP MYSELF. Being pointed in the right direction helps me most. Thank you all again.

    #include <iostream>

    using namespace std;

    int main()
    {

    // Local Variables
    int userinput;
    int sum = 0;
    int count = 0 ;

    // Welcome Message
    cout << "Roberts Number program v1" << endl;
    cout << endl;
    cout << endl;
    cout << "When you are finished, enter '0'" << endl;
    cout << endl;

    // Start While loop
    while (userinput != 0)
    {
    // Prompt User for input
    cout << "Input a number, then press enter. " ;
    cin >> userinput ;
    sum += userinput;

    }
    cout << "The sum is:" << sum << endl;
    return 0;
    }

    C / C++ / MFC c++ html com

  • Program Which: Takes numbers from a user, and sum's them.
    R rbwest86

    Thank you very much. I got it working now. I read over this while I was at dinner with the wife and figured it out at the dinner table! here is the working code:

    #include

    using namespace std;

    int main()
    {

    // Local Variables
    int userinput;
    int sum = 0;

    // Start While loop
    while (userinput != 0)
    {
    // Prompt User for input
    cout << "Please enter a number. When you are finished, type 0 and press Enter." ;
    cin >> userinput ;
    sum = sum + userinput;

    }
    cout << "The sum is:" << sum << endl;
    return 0;
    }

    C / C++ / MFC c++ html com

  • Program Which: Takes numbers from a user, and sum's them.
    R rbwest86

    Hello all, I am working on my homework for my C++ programming class and I am hitting a brick wall. Everywhere I look online does not seem to have any information in which I can apply to my program. I am supposed to use a "while" loop which I am, and thats working. The part which is not working is the users input should add it to the previous entry, and after the user types "0" it will display the sum on the screen. I have looked at the following references to try and make sense of things: http://www.cplusplus.com/reference/std/numeric/partial_sum/[^] http://www.cplusplus.com/reference/std/numeric/accumulate/[^] http://frank.mtsu.edu/~csci117/manual/lab7/lab7.html[^] I am trying very hard to understand this, but I can not find a good online reference of the libraries. www.cplusplus.com is very good but dosent have the info I need, or more than likely I can not find it. But here is the code to which I am trying to correct:

    #include <iostream>
    #include <string>

    using namespace std;

    int main()
    {

    // Global Variables
    int userinput;
    int sum = 0;
    sum = sum + userinput;

    // Start While loop
    while (userinput != 0)
    {
    // Prompt User for input
    cout << "Please enter a number. When you are finished, type 0 and press Enter." ;
    cin >> ++userinput ;

    }
    cout << "The sum is:" << sum << endl;
    return 0;
    }

    Thank's to all in advance for pointing me in the correct direction so I can figure this out. I should have put this at the top: I DO NOT WANT THE ANSWER, I WOULD PREFER THE REFERENCE TO FIND MY OWN.

    C / C++ / MFC c++ html com

  • Simple input and output program that quits to soon. I cant find the problem, please take a look.
    R rbwest86

    Just to let everyone know, I included a do-while loop to ask the user if he wanted to include another entry. I did not want to use some sort of OS dependent rule to get my program to stop closing.

    C / C++ / MFC help css debugging beta-testing tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups