Graalians

Graalians (https://www.graalians.com/forums/index.php)
-   Creative Corner (https://www.graalians.com/forums/forumdisplay.php?f=17)
-   -   Anybody know C++? (https://www.graalians.com/forums/showthread.php?t=450)

Skill 10-09-2011 10:42 PM

Quote:

Posted by MattKan (Post 20120)
1) Pretty sure you and I are like the same exact age.

2) I'm not interested in trying to be cool by making a giant mmo like you are. I know my limits.

1: I'm 15, I thought you were 12 or 13.

2: Did I say I wanted to make a giant mmo? I just want to make a simple game using unity. Well if you consider a Graal server a "giant mmo" then yes, maybe you are right. Anyways I gave you two of the easiest suggestions to making games if you are interested in making one, and a simple solution to making an interface. Many people I know that are my age use visual basic to make games and interfaces.

MattKan 10-09-2011 11:14 PM

Quote:

Posted by Skill (Post 20130)
1: I'm 15, I thought you were 12 or 13.

2: Did I say I wanted to make a giant mmo? I just want to make a simple game using unity. Well if you consider a Graal server a "giant mmo" then yes, maybe you are right. Anyways I gave you two of the easiest suggestions to making games if you are interested in making one, and a simple solution to making an interface. Many people I know that are my age use visual basic to make games and interfaces.

Just stop trolling. And I'm not 12 or 13.

Skill 10-09-2011 11:38 PM

Quote:

Posted by MattKan (Post 20140)
Just stop trolling. And I'm not 12 or 13.

sorry last time I talked to you you were either 12 or 13 so you must be 14 sorry. And aren't you the one trolling? I was just trying to give you advice and you suddenly decide to say I try to do things much more difficult then I am capable and that I'm just trying to sound cool.

Kavan 10-10-2011 12:17 AM

Just shut up.
This is a thread for learning, not trolling.

MattKan 10-10-2011 12:48 AM

Well, I'm still a bit confused about how wxWidget works in correlation to C++.. can anybody provide some more insight please?

Maikeru 10-10-2011 01:09 AM

Use the express version of Microsoft Visual C++
Once you learn the basics, then i recommend you try an application meant to build C-related language Console Applications

For those that are entirely new to this whole programming experience, i recommend you start off using Visual Basic. Call it a beginner's course if you may

fp4 10-10-2011 02:24 AM

Quote:

Posted by MattKan (Post 20166)
Well, I'm still a bit confused about how wxWidget works in correlation to C++.. can anybody provide some more insight please?

It's a library to make GUIs. Learn Python or Ruby (My favorite) instead, you'll make much cooler **** in less time and headaches.

Could also just use MS Visual C++ Express and use .NET with it's nice GUI Maker.

BboyEatsbacon 10-10-2011 09:01 PM

Quote:

Posted by fp4 (Post 20200)
It's a library to make GUIs. Learn Python or Ruby (My favorite) instead, you'll make much cooler **** in less time and headaches.

Could also just use MS Visual C++ Express and use .NET with it's nice GUI Maker.

I attempted to learn C++ through "C++ For Dummies," but I soon got bored a few chapters into the book learning all of the same stuff that I did in GS2, I'll try to attempt for some online tutorials, and I'm currently downloading MS Visual C++. :)

Skill 10-12-2011 01:09 AM

Quote:

Posted by BboyEatsbacon (Post 20816)
I attempted to learn C++ through "C++ For Dummies," but I soon got bored a few chapters into the book learning all of the same stuff that I did in GS2, I'll try to attempt for some online tutorials, and I'm currently downloading MS Visual C++. :)

if you think you learned the same stuff as gs2 then I think you are missing out on many things. I don't know c++, but I think you have to allow/remove memory,make sure a variable is signed/unsigned, choose a data type like float/double/int/long, and much more.

MattKan 10-12-2011 01:23 AM

Quote:

Posted by Skill (Post 21350)
if you think you learned the same stuff as gs2 then I think you are missing out on many things. I don't know c++, but I think you have to allow/remove memory,make sure a variable is signed/unsigned, choose a data type like float/double/int/long, and much more.

Well if you don't c++ you wouldn't know.

I'm just starting C++ and I agree with BBoy

Kavan 10-12-2011 04:48 PM

Quote:

Posted by Skill (Post 21350)
if you think you learned the same stuff as gs2 then I think you are missing out on many things. I don't know c++, but I think you have to allow/remove memory,make sure a variable is signed/unsigned, choose a data type like float/double/int/long, and much more.

You don't necessarily have to make sure a variable is unsigned/signed and you don't really have to zero memory/declare pointers to a certain memory location for simple applications, but yes, variable types have to be declared before they are used.

Kavan 10-24-2011 06:44 PM

So, you guys want to post any code for the things you're making with C++?
I'll set the ball rolling with a text editor I'm trying to piece together. It's my first one. :p

PHP Code:

#include <Windows.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>

#define ID_EDIT 1001
#define ID_BUTTON 1002
#define ID_OPEN 9001
#define ID_SAVE 9002
#define ID_EXIT 9003
#define ID_COPY 9004

static TCHAR szWindowClass[] = _T("win32_test");

LRESULT CALLBACK WndProc(HWND hWndUINT messageWPARAM wParamLPARAM lParam)
{
    switch(
message)
    {
    case 
WM_CREATE:
        {
        
HMENU hMenuhSubMenu;
        
HICON hIconhIconSm;

        
hMenu CreateMenu();

        
hSubMenu CreatePopupMenu();
        
AppendMenu(hSubMenuMF_STRINGID_OPEN_T("Open"));
        
AppendMenu(hSubMenuMF_STRINGID_SAVE_T("Save"));
        
AppendMenu(hSubMenuMF_STRINGID_EXIT_T("Exit"));
        
AppendMenu(hMenuMF_STRING MF_POPUP, (UINT)hSubMenu_T("File"));

        
hSubMenu CreatePopupMenu();
        
AppendMenu(hSubMenuMF_STRINGID_COPY_T("Copy"));
        
AppendMenu(hMenuMF_STRING MF_POPUP, (UINT)hSubMenu_T("Edit"));

        
SetMenu(hWndhMenu);

        
HWND hEdit CreateWindowEx(
            
WS_EX_CLIENTEDGE,
            
_T("EDIT"),
            
_T(""),
            
WS_CHILD WS_VISIBLE WS_VSCROLL ES_MULTILINE ES_AUTOVSCROLL,
            
00,
            
100100,
            
hWnd,
            (
HMENU)ID_EDIT,
            
GetModuleHandle(NULL),
            
NULL);

        
HGDIOBJ hfDefault GetStockObject(DEFAULT_GUI_FONT);
        
SendMessage(hEditWM_SETFONT, (WPARAM)hfDefaultMAKELPARAM(false0));

        
HWND hButton CreateWindowEx(
            
NULL,
            
_T("BUTTON"),
            
_T("Button that does something"),
            
WS_BORDER WS_CHILD WS_VISIBLE BS_PUSHBUTTON,
            
00,
            
10030,
            
hWnd,
            (
HMENU)ID_BUTTON,
            
GetModuleHandle(NULL),
            
NULL);
        }
        break;

    case 
WM_SIZE:
        {
        
HWND hEdithButton;
        
RECT rcClient;

        
GetClientRect(hWnd, &rcClient);

        
hEdit GetDlgItem(hWndID_EDIT);
        
SetWindowPos(hEditNULL00rcClient.rightrcClient.bottom 50SWP_NOZORDER);

        
hButton GetDlgItem(hWndID_BUTTON);
        
SetWindowPos(hButtonNULL10rcClient.bottom 4020030SWP_NOZORDER);
        }
        break;

    case 
WM_COMMAND:
        switch(
LOWORD(wParam))
        {
        case 
ID_EXIT:
            
PostQuitMessage(0);
            break;
        case 
ID_COPY:
            
MessageBox(NULL_T("This popup button does absolutely nothing as of yet."), _T("Notice"), NULL);
            break;
        case 
ID_OPEN:
            {
            
OPENFILENAME ofn;
            
            
ZeroMemory(&ofnsizeof(ofn));

            
ofn.lStructSize        sizeof(ofn);
            
ofn.hwndOwner        hWnd;
            
ofn.lpstrFilter        _T("Text Files (*.txt)\0*.txt\0All files (*.*)\0*.*\0");
            
ofn.lpstrFile        _T("");
            
ofn.nMaxFile        MAX_PATH;
            
ofn.Flags            OFN_EXPLORER OFN_FILEMUSTEXIST OFN_HIDEREADONLY;
            
ofn.lpstrDefExt        _T("txt");

            if(
GetOpenFileName(&ofn))
            {
                
// Going to do this later...
            
}
            }
            break;
        default:
            return 
DefWindowProc(hWndmessagewParamlParam);
        }
        break;

    case 
WM_DESTROY:
        
PostQuitMessage(0);
        break;

    default:
        return 
DefWindowProc(hWndmessagewParamlParam);
        break;
    }

    return 
0;
}


int WINAPI WinMain(HINSTANCE hInstance,
                
HINSTANCE hPrevInstance,
                
LPSTR lpCmdLine,
                
int nCmdShow)
{
    
WNDCLASSEX wcex;

    
wcex.cbSize            sizeof(WNDCLASSEX);
    
wcex.style            CS_HREDRAW CS_VREDRAW;
    
wcex.lpfnWndProc    WndProc;
    
wcex.cbClsExtra        0;
    
wcex.cbWndExtra        0;
    
wcex.hInstance        hInstance;
    
wcex.hIcon            LoadIcon(hInstanceMAKEINTRESOURCE(IDI_APPLICATION));
    
wcex.hCursor        LoadCursor(NULLIDC_ARROW);
    
wcex.hbrBackground    = (HBRUSH)(COLOR_WINDOW+1);
    
wcex.lpszMenuName    NULL;
    
wcex.lpszClassName    szWindowClass;
    
wcex.hIconSm        LoadIcon(wcex.hInstanceMAKEINTRESOURCE(IDI_APPLICATION));

    if(!
RegisterClassEx(&wcex))
    {
        
MessageBox(NULL_T("Call to RegisterClassEx failed!"), _T("Kavan's Text Editor"), NULL);
        return 
1;
    }

    
HWND hWnd CreateWindow(
        
szWindowClass,
        
_T("Kavan's Text Editor"),
        
WS_OVERLAPPEDWINDOW,
        
CW_USEDEFAULTCW_USEDEFAULT,
        
800600,
        
NULL,
        
NULL,
        
hInstance,
        
NULL);

    if(!
hWnd)
    {
        
MessageBox(NULL_T("Call to CreateWindow failed"), _T("Kavan's Text Editor"), NULL);
        return 
1;
    }

    
ShowWindow(hWndnCmdShow);
    
UpdateWindow(hWnd);

    
MSG msg;
    
    while(
GetMessage(&msgNULL00))
    {
        
TranslateMessage(&msg);
        
DispatchMessage(&msg);
    }

    return (int)
msg.wParam;


Some feedback from more knowledgeable beings would be appreciated, as I'm not exactly sure how to open a text file and place the text in it onto my window.

Bubble 10-25-2011 01:29 AM

Aren't there some file functions?

Kavan 11-03-2011 12:07 AM

Quote:

Posted by Bubble (Post 26293)
Aren't there some file functions?

Care to elaborate?
I'm aware of ifstream and ofstream variables, but I'm using the GetOpenFileName function, and I'm not exactly sure how to use it... :'(

Lettro 11-10-2011 01:42 AM

If any of you want to learn C++, this guy's not bad.
http://www.youtube.com/watch?v=PuzH8ZZ1j0s


All times are GMT. The time now is 05:56 PM.

Powered by vBulletin/Copyright ©2000 - 2025, vBulletin Solutions Inc.