Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8225043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:16:52+00:00 2026-06-07T15:16:52+00:00

Edit: new files. I’m having troubles accessing a public function in the Form1 class.

  • 0

Edit: new files. I’m having troubles accessing a public function in the Form1 class. I get identifier not found when I try to use it.
Form1:

#pragma once

#include "OpenGL.h"
#include "serialcom.h"
#include "calculations.h"

namespace GUI_1 {

    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;
    using namespace OpenGLForm;


    /// <summary>
    /// Summary for Form1
    /// </summary>

    public ref class Form1 : public System::Windows::Forms::Form
    {
    public:
        Form1(void)
        {
            InitializeComponent();
            OpenGL = gcnew COpenGL(this->panel4, this->label16, 785, 530);
        }
        void changelabel2(float num)
        {
            label2 -> Text = " " + num;
        }
    protected: ...

OpenGL.h:

#include "stdafx.h"

#ifndef opengl
#define opengl

#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")

#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <math.h>

// Declare globals
...

using namespace System::Windows::Forms;

namespace OpenGLForm 
{
    public ref class COpenGL: public System::Windows::Forms::NativeWindow
    {
    public:

        COpenGL(System::Windows::Forms::Panel ^ parentForm, System::Windows::Forms::Label ^ lbl, GLsizei iWidth, GLsizei iHeight)
        {
            CreateParams^ cp = gcnew CreateParams;

            c_p_v v1, v2;
            changelabel2(189); 
...

So that doesn’t work (above, in “changelabel2”). Perhaps because I’m not using class name?

This is my main:

#include "stdafx.h"
#include <string.h>
#include <iostream>
#include <stdio.h>
#include < vcclr.h >
#include < stdio.h >
#include < stdlib.h >
#include < vcclr.h >    
#include "Form1.h"
#include "calculations.h"
#include "serialcom.h"

using namespace GUI_1;

[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
    // Enabling Windows XP visual effects before any controls are created
    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false); 


    // Create the main window and run it
    Form1^ form = gcnew Form1();
    Application::Run(form);

    return 0;
}

Calling form.changelabel2 doesn’t work either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:16:54+00:00Added an answer on June 7, 2026 at 3:16 pm

    It looks like you have a circular dependency between OpenGL.h and Form1.h

    Try removing the #include "Form1.h" if you can, or converting it to a forward declaration like class Form1;

    Also, be careful when using using namespace in headers as it will pollute the namespace of any file it is subsequently included in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This works: Entities.WorkOrderSet.Where(MyCustomMethod); This does not: Entities.WorkOrderSet.Where(o => MyCustomMethod(o)); ( [Edit] Even without new
EDIT: I added in where I create new instance of the class Process as
edit/operacoes.php header('Content-Type: application/json'); include('../../lib/mysql.class.php'); $db = new MySQL(); if($db->Error()) $db->Kill(); //VARIÁVEIS DA FORM $id
new_story GET /story/new(.:format) {:action=>new, :controller=>stories} edit_story GET /story/edit(.:format) {:action=>edit, :controller=>stories} story GET /story(.:format) {:action=>show,
How can i setup my Xcode project so that it creates new class files
I am trying to get the Edit with Vim context menu to open files
Say I have two fields in a new or edit form: <%= f.text_field :email
Whenever I try to edit existing or create new distribution provisioning profile on iOS
Why new()/delete() is slower than malloc()/free()? EDIT: Thanks for the answers so far. Please
EDIT : proper solution: void add(Student s) { if(root == null) root = new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.