Can only use one addtional form in VC++ .NET, when using native code + managed code.

Posted on 2004-11-12
Last Modified: 2013-12-03
I have written a C++ .NET app that watches for a proxy authentication dialog from IE (or anything) and sends USERNAME|TAB|PASSWORD|ENTER using keybd_event.  I am experiencing an issue on this project that I experienced on my last project.  When I create a new .NET form and try to instantiate that class, I get 'undeclared'; only after I already have one other form in use.  But if I create a new .NET project and add two forms it works fine, calling both.  Could it be because of the use of managed code and native code in the same source?  This is only my third useful programming project ever, so this is all a learning experience for me.  

So, I'm trying to learn why this is a problem.

The particular error is happening with this:

Line 432 of Form1.h:
Confirm * confirm = new Confirm();
c:\...\Form1.h(432) : error C2065: 'Confirm' : undeclared identifier
c:\...\Form1.h(432) : error C2065: 'confirm' : undeclared identifier
c:\...\Form1.h(432) : error C2061: syntax error : identifier 'Confirm'

The entire solution can be downloaded at

Thanks for the help,
Question by:nwgarner
    LVL 48

    Expert Comment

    APA::Confirm * confirm = new APA::Confirm();

    This class belongs to another namespace.
    LVL 48

    Accepted Solution

    Or add line

    using namespace APA;

    to the beginning of the file (after namespace AutoProxyAuth).

    Author Comment

    Worked like a champ AlexFM, thanks for the help.


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now