| View previous topic :: View next topic |
| Author |
Message |
clanner Master Cheater
Reputation: 0
Joined: 26 Jul 2006 Posts: 290
|
Posted: Fri Oct 24, 2008 8:44 pm Post subject: Visual c++ express edition question |
|
|
| Alright well I have the Visual C++ express Edition. They have this option to create a "Windows Form Application". Does that create a "Gui"? Just curious and if it does not create a gui, could you tell me what does? Thanks.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Oct 24, 2008 8:45 pm Post subject: |
|
|
| That will create a managed C++ project.
|
|
| Back to top |
|
 |
clanner Master Cheater
Reputation: 0
Joined: 26 Jul 2006 Posts: 290
|
Posted: Fri Oct 24, 2008 8:46 pm Post subject: |
|
|
| Umm, could you be more descriptive on what that means? xD I'm not to "updated" on terms yet.
|
|
| Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Fri Oct 24, 2008 8:48 pm Post subject: |
|
|
That'll make a windows FORM application, where a FORM is a form of GUI - yeah, it did make me a window to start with back in 2005.
_________________
Get kidnapped often. |
|
| Back to top |
|
 |
clanner Master Cheater
Reputation: 0
Joined: 26 Jul 2006 Posts: 290
|
Posted: Fri Oct 24, 2008 8:49 pm Post subject: |
|
|
| Awesome. Is there a tutorial somewhere where it can tell me basic steps on how to work it?
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Oct 24, 2008 8:52 pm Post subject: |
|
|
| slovach wrote: | | That will create a managed C++ project. |
.NET C++ is a far cry from regular C++, I don't think it's supported any more even.
|
|
| Back to top |
|
 |
clanner Master Cheater
Reputation: 0
Joined: 26 Jul 2006 Posts: 290
|
Posted: Fri Oct 24, 2008 8:55 pm Post subject: |
|
|
So those .net framework updates that I have to download sometimes are used because applications like these (.net) require them? Would you consider this an "easy" way to create a gui?
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
|
| Back to top |
|
 |
clanner Master Cheater
Reputation: 0
Joined: 26 Jul 2006 Posts: 290
|
Posted: Fri Oct 24, 2008 9:01 pm Post subject: |
|
|
| just curious but does that tutorial use c codes or c++ codes? It doesn't seem to compile right on my computer.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Oct 24, 2008 9:18 pm Post subject: |
|
|
A C++ compiler will compile C
post the errors.
|
|
| Back to top |
|
 |
clanner Master Cheater
Reputation: 0
Joined: 26 Jul 2006 Posts: 290
|
Posted: Fri Oct 24, 2008 9:22 pm Post subject: |
|
|
| Alright maybe i'm doing this wrong but what type of "project" should it be?
|
|
| Back to top |
|
 |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Sat Oct 25, 2008 12:01 am Post subject: |
|
|
you can make forms easy, but yeah, the framework used to make the premade gui and controls are .NET
if you are going to use .NET
i suggest using c# instead
I'm learning c# so add me on msn or aim if you have questions
_________________
|
|
| Back to top |
|
 |
sotaukko Cheater
Reputation: 0
Joined: 23 Oct 2007 Posts: 32
|
Posted: Sat Oct 25, 2008 4:55 am Post subject: |
|
|
| slovach wrote: | A C++ compiler will compile C
post the errors. |
When i try to compile the "Simple Window" source from TheForger's Win32Api tutorial. Im getting 4 errors.
Im using MSVC++
The Simple Window Source:
| Code: | #include <windows.h>
const char g_szClassName[] = "myWindowClass";
// Step 4: the Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX wc;
HWND hwnd;
MSG Msg;
//Step 1: Registering the Window Class
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = g_szClassName;
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
if(!RegisterClassEx(&wc))
{
MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
// Step 2: Creating the Window
hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
"The title of my window",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
NULL, NULL, hInstance, NULL);
if(hwnd == NULL)
{
MessageBox(NULL, "Window Creation Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
// Step 3: The Message Loop
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
} |
Errors:
| Code: | Error 1:
error C2440: '=' : cannot convert from 'const char [14]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error2:
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [28]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error3:
error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [14]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error4:
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [24]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast |
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Sat Oct 25, 2008 5:02 am Post subject: |
|
|
| sotaukko wrote: | | When i try to compile the "Simple Window" source from TheForger's Win32Api tutorial. Im getting 4 errors. | Compile in ANSI or use unicode strings. Better yet, use the unicode/ansi-macro thing, Iono what should I call it. I'd really suggest you to learn the basics before moving to Win32/GUI/sth.
|
|
| Back to top |
|
 |
sotaukko Cheater
Reputation: 0
Joined: 23 Oct 2007 Posts: 32
|
Posted: Sat Oct 25, 2008 5:14 am Post subject: |
|
|
| Jani wrote: | | sotaukko wrote: | | When i try to compile the "Simple Window" source from TheForger's Win32Api tutorial. Im getting 4 errors. | Compile in ANSI or use unicode strings. Better yet, use the unicode/ansi-macro thing, Iono what should I call it. I'd really suggest you to learn the basics before moving to Win32/GUI/sth. |
Well i've been learning C++ for couple of months now but never needed ANSI becouse i made console applications. Im very noob at Win32 Apis but however i can now compile it
|
|
| Back to top |
|
 |
|