473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Passing structs between Windows Forms - VC++

iknc4miles
Back with another question. How I go about rewriting this code so that I can pass the pointer to my data from one form to another to be modified there. Here is roughly what I'm doing, but the pointer I end up with is pointing to a blank struct.

Expand|Select|Wrap|Line Numbers
  1.   // code in Form1 defines tempStruct1 and tempStruct2
  2. // tempStruct2 has variable int count
  3. Form2 *vForm = new Form2(&tempStruct1, &tempStruct2);
  4. vForm->Show();
Expand|Select|Wrap|Line Numbers
  1.  // code in Form2 Constructor
  2.  
  3. Form2(structType1 *tempStruct1, structType2 *tempStruct2)
  4.     {
  5.         InitializeComponent();
  6.         int i;
  7.         for(i = 0; i < tempStruct2->Number; i++)
  8.         {
  9. // DO STUFF
  10.         }
  11.     }
Everything compiles but when I check Number (after defining it of course), I get a <non-value> when I try to retrieve it.

Anything else I need to pass data between forms?

- iknc4miles
Mar 5 '07 #1
0 1506

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: kazack | last post by:
I am a little confused with code I am looking at. My c++ book does not go into passing a structure to a function so I pulled out a c book which does. and I do not understand the prototype verses...
11
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
1
by: Adam Clauss | last post by:
I have a few variables that I want declared as global. To accomplish this, I made the files globals.h and globals.cpp. In globals.h I have the declarations for the structs, and one variable...
1
by: Jiang Yue Brandon | last post by:
I am very confused about the different ways of VC++ and C# for doing windows form/dialog design in Visual Studio.NET. In C#, after you drag & drop the components to the form, the underlying...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
6
by: RBCC | last post by:
Public Class fraction Dim m_numerator As Int16 Dim m_denominator As Int16 Public Event zerodenom() Public Property numerator() As Int16 Get Return m_numerator
3
by: Neal | last post by:
managed C++ VS 2003 I have a beginner question about windows forms.... I need to call a function when a certain limit has been reached, now with the way VS sets up the .NET windows Form I get...
2
by: Carl Heller | last post by:
Working in VS2003, .Net 1.1 I'm working on a project where I compare data between two databases. This is a lengthy process, and very data intensive, so I decided to create a class, and thread...
2
by: jonpb | last post by:
Using .NET 3.5, I need to pass an array of structs as parameter to a C++ unmanaged function. The C++ dll stores some data in an unmanaged cache, the function writes the values into the array of...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.