|
-
Mar 9th, 2001, 08:22 PM
#1
Thread Starter
Frenzied Member
Code:
--------------------Configuration: win32 Class Practice - Win32 Debug--------------------
Compiling...
class.cpp
C:\Windows\Profiles\Steve\Desktop\C c++\win32 Class Practice\class.cpp(17) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Error executing cl.exe.
win32 Class Practice.exe - 1 error(s), 0 warning(s)
I don't know what to do Do I Have to re-install it? 
Here's the code I'm using...(class practice)
PHP Code:
// Class Practice For A Win32 Application
// By Steve Mack\
// March 9, 2001 (09.03.01)
#include <windows.h>
HWND ghWnd_Main; // this is the main window
HWND ghWnd_enter;
HWND ghWnd_Text;
class NAME {
public:
char setname(char myname[40]);
void showname();
char finalname[40];
}
NAME::setname {
finalname = myname;
return finalname;
}
NAME::showname {
MessageBox(hWnd, finalname, "name:", MB_OK);
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch(uMsg) {
case WM_CLOSE:
DestroyWindow(ghWnd_Main); // Destroy the main window
return 0;
case WM_DESTROY:
NAME::~showname {
}
NAME::~setname {
}
PostQuitMessage(0); // Quit the application
return 0;
case WM_COMMAND:
if(LOWORD(wParam) == BN_CLICKED && (HWND)lParam == ghWnd_enter) {
NAME steve;
steve.setname("Steveman");
steve.showname;
}
return 0;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam); // Not handled - let the system deal with it
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
WNDCLASSEX wcxMyClass;
wcxMyClass.cbSize = sizeof(WNDCLASSEX); // Size of structure in bytes
wcxMyClass.style = 0; // Extra style information
wcxMyClass.lpfnWndProc = WndProc; // Pointer to window procedure
wcxMyClass.cbClsExtra = 0; // Extra bytes in class definition
wcxMyClass.cbWndExtra = 0; // Extra bytes for each window
wcxMyClass.hInstance = hInstance; // Instance handle for the class
wcxMyClass.hIcon = NULL; // Default icon - use system
wcxMyClass.hCursor = LoadCursor(NULL, IDC_ARROW); // Load the system arrow
wcxMyClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); // Background brush
wcxMyClass.lpszMenuName = NULL; // Menu name [MAKEINTRESOURCE(IDM_MAINMENU)] - none here
wcxMyClass.lpszClassName = "TESTCLASS"; // Class name
wcxMyClass.hIconSm = NULL; // Small icon
RegisterClassEx(&wcxMyClass); // Register the class
ghWnd_Main = CreateWindow("TESTCLASS", "Steve's Class Practice", WS_OVERLAPPEDWINDOW, 100, 100, 400, 445, NULL, NULL, hInstance, NULL);
if(ghWnd_Main) {
ghWnd_Text = CreateWindowEx(WS_EX_CLIENTEDGE, "Edit", "Enter Your Name Here...", WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_VSCROLL, 0, 40, 330, 40, ghWnd_Main, NULL, hInstance, NULL);
ghWnd_enter = CreateWindow("Button", "Enter Info", WS_CHILD | WS_VISIBLE, 0, 0, 100, 30, ghWnd_Main, NULL, hInstance, NULL);
ShowWindow(ghWnd_Main, nCmdShow); // Show using the specific show style
}
/////////////////////////
// Handle message loop //
/////////////////////////
MSG msg;
while(GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg); // Translate keycode messages
DispatchMessage(&msg); // Send to the window
}
UnregisterClass("TESTCLASS", hInstance); // Unregister our window class
return msg.wParam; // msg.wParam contains the code passed to PostQuitMessage()
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|