Thread: VC++ New Window

  1. #1
    Registered User
    Join Date
    Aug 2010

    VC++ New Window

    I am currently making a notepad application, and I got 90% of it programmed, one thing that compeletly eludes me is making a new window!

    What I mean is, when you click "File -> New" it opens a new window of that same program.

    My code:
    private: System::Void newToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
    			  gcnew Form1() = newWindow;
    The error:
    1>------ Build started: Project: SeaPad, Configuration: Debug Win32 ------
    1>  SeaPad.cpp
    1>c:\users\dc\documents\visual studio 2010\projects\seapad\seapad\Form1.h(357): error C2065: 'newWindow' : undeclared identifier
    1>c:\users\dc\documents\visual studio 2010\projects\seapad\seapad\Form1.h(358): error C2065: 'newWindow' : undeclared identifier
    1>c:\users\dc\documents\visual studio 2010\projects\seapad\seapad\Form1.h(358): error C2227: left of '->ShowWindow' must point to class/struct/union/generic type
    1>          type is ''unknown-type''
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Thanks in advance! Cody

    P.S. On a side note, does anyone know why Intellisense/Auto Complete is not working at all for Visual C++ 2010?

  2. #2
    Join Date
    Oct 2007
    Inside my computer
    This is not C++. That is why IntelliSense is non-working.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Hannover, Germany
    It's C++/CLI. Please for the love of god, think about your choice. Do you need C++/CLI? If you want the .NET Framework, use C#. If you want performance and the ability to compile for multiple platforms, use C++. If you have legacy code, masochistic tendencies or suicidal thoughts, feel free to continue with C++/CLI.

    gcnew Form1() = newWindow;
    ...shoud be:

    Form1^ newWindow = gcnew Form1();
    That's still not wht you want, but it should compile. Look into the Process class to actually start a new process and not just a new subwindow.

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C or C++
    By AcerN30 in forum Game Programming
    Replies: 41
    Last Post: 05-30-2008, 06:57 PM
  2. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  3. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM