Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. asimov500

    Scope of a function

    Hi Sdowd, Thanks for all the help but I am thinking of trying out Visual C#. Tried it yesterday and managed to do what I wanted to in minutes rather than weeks. I might come back to c++/cli when the documentation gets better. I mean I have downloaded lots of ebooks on it but none of them go...
  2. asimov500

    Scope of a function

    HI SDowd, Will try that in a bit, but I have a question. When I create a project it does not create Form1.cpp automatically. It creates a .cpp file with the project file name and it calls that the main project file. Yet if I make another Form it auto creates the cpp file with it. Do I put...
  3. asimov500

    Scope of a function

    Hi there, I am programming Visual C++/cli 2008. I can make functions with no problem and I can call them from Form1.h without a problem. The problem comes when I want to change a textBox or Label control from a function. I realise it won't work because the textBox is out of scope. How do I...
  4. asimov500

    Open a Form2 with a Button

    Hi SDowd, Thanks anyway. It's hard enough learning a new language, but even harder when the documentation is limited. Trouble is whenever I search for C++/cli stuff in google I end up getting C++ stuff and I can't always tell the difference.I wish they used an entirely different name and then...
  5. asimov500

    Open a Form2 with a Button

    Hi SDowd, Sorry I misunderstood your message. Well the program works until I add the extra lines for the forward declarations. The program only compiles at the moment because they are commented out. I believe most of the errors come because Form2 cannot see Form1. I think gcnew that I run in...
  6. asimov500

    Open a Form2 with a Button

    Hi Dowdy, Sorry I screwed up the link. Asimovhttp://www.asimov.dsl.pipex.com/addressbook.jpg
  7. asimov500

    Open a Form2 with a Button

    Hi SDowd, This is strange. Seeing as you got a compile error I redownloaded my code off my website to check it, and it compiled without error. I am puzzled. I didn't get the error C2872 that you got. There is a link to a screenshot below. I thought I may have left some dubious code in from...
  8. asimov500

    Open a Form2 with a Button

    Hi SDowd, Thanks for taking the time to look. Luckily VS 2008 is free to download. I looked at the example. Still not quite sure how it works. I understand the concept of a forward declaration but I am not sure where to put the code in my program. You see if I was writing a dos program I would...
  9. asimov500

    Open a Form2 with a Button

    Hi SDowd, Since your original email I have been googling "Forward Declarations" since there was no tomorrow. They tend to show an example but don't really explain how it works. I do however understand the concept thanks your your mail. I have followed your instructions and still get errors. I...
  10. asimov500

    Open a Form2 with a Button

    Hi SDowd, Thanks for your help so far. I read your last post and thought I understood what to do but the class Form1; causes an error in my code, something to do with gcnew. I will try and explain and will try and paste the relevant code. In Form1.h I #include Addrecord.h which is my second...
  11. asimov500

    Open a Form2 with a Button

    Hi Sdowd, I have never used a forward declaration before, and even though I read the page you gave, I am still not sure how it works. I have Form1.h and another form called Addrecord.h. Do I need to add a.h .b.h to my program or are they just example names? I am new to c++/cli and would...
  12. asimov500

    Open a Form2 with a Button

    Ok I found out how to do this but now I have another problem. At the start of form1 after #pragma I put the lines #include "resource.h" #include "Addrecord.h" Then on a button event I put this to call form2 Form1::Hide(); Addrecord^ form = gcnew Addrecord(); form->Show(); This...
  13. asimov500

    Changing a control in a function

    Hi CooperDBM, Strangly enough I found this forum by googling. I spent days googling before I found this site and I also found the site you mentioned. It is quite informative in places but it doesn't have everything. I have learn't z80 machine code on the spectrum. C, Amos Basic and Amiga Basic...
  14. asimov500

    Changing a control in a function

    Hi all, I am learning something here. I now know I wasn't using MFC at all. Got confused there. I am using Visual C++ express edition 2008 and I am using windows forms. I cannot alter textBox's, use MessageBox's or anything inside a function or from when I click on a button event. I...
  15. asimov500

    Open a Form2 with a Button

    I would also like to open another form from a button but I do not understand the explanation. I have used the #include Form2.h at the beginning of Form1 but I don't understand how to open it. I get an error when I try Form2::open(); Asimov
  16. asimov500

    Classes and Where Do I put stuff in MFC

    Hi CooperDBM, Thankyou for your help. Using the #include file method worked. I now know how to include a class in my program. Don't know everything about classes yet, but I hope to learn more. I have done a lot of programming in the past, but the big problem I have with C++/CLI is the syntax...
  17. asimov500

    Classes and Where Do I put stuff in MFC

    Hi, I am actually using Visual C++ 2008 Express edition. The only way I could get it to use forms was to select New/Project/CLR/Windows Forms Application. There is no option for MFC. From what I read I assume that this version of C++ used MFC so I may have put two and two together and got six...
  18. asimov500

    Classes and Where Do I put stuff in MFC

    I am not new to programming but I am new to Visual C++ and the MFC. I read the example I get the cli versions to work in dos but the problems come when I start to use MFC. I have never used Classes before and so I read the example and I almost get it to work but not quite in the form. I know...
  19. asimov500

    Changing a control in a function

    I have just realised I have probably said something stupid as I have just found main. It is in the cpp file. My function is in the form1.h file, and the main part of my program is in form1.h in the form1 part. There is an #include "form1.h" in the cpp file before main. So if the buttons are...
  20. asimov500

    Changing a control in a function

    Hi xwb, I understand that variables declared outside main are global but I didn't think this applied to textBox and such. The textBox was drawn using the designer and it puts it where it puts it. Is there a way to change the default location in the program or do I have to manually move it...

Part and Inventory Search

Back
Top