473,406 Members | 2,619 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,406 software developers and data experts.

problem putting things together

Hi,
I am new to C++ .Net so please forgive me if the question sounds
silly.

I have implemented a class, as well as some client code that uses
the class. Now I decided that I want to add a GUI using C++ .net.
The problem is that I can't seem to link everything together.

I had the following files:

my_vector.h: contains the class implementation
test.cpp: contains the client code

Now I add the followings:
form1.h: for the GUI
form1.cpp: for the GUI
The following is a function that I want to call on my form's menu item
"Open". DTS is my class name. My question is, where should I place
the interface functions, such as this one, now? Do I declare it as a
member function of the Form1 class, or as a member function in the DTS
class, or should I just leave it stand-alone, as it is now? I tried
all options but I got some linking errors.
void GetInput(String *sFileName, DTS *dtsData)
{
const char* str = (const char*)
(Marshal::StringToHGlobalAnsi(sFileName)).ToPointe r();

// free string
Marshal::FreeHGlobal(IntPtr((void*)str));

ifstream ifIn(str);
double dblInputVal;
int cline = 0;

if (ifIn.fail())
{
cerr << "Error: cannot open " << str << endl;
exit(1);
}

while (!ifIn.eof())
{
ifIn >> dblInputVal;
dtsData->Insert(dblInputVal);
cline++;
}

cout << "# observations = " << cline << endl;

ifIn.close();
}

This is in form1.h:
private:

DTS *dtsData;

System::Void menuItem2_Click(System::Object * sender,
System::EventArgs * e)
{
OpenFileDialog *opFileDlg = new OpenFileDialog ();
opFileDlg->Filter="Text files (*.txt;*.dat)|*.txt;*.dat";

//if user has clicked on the Open button
if(opFileDlg->ShowDialog()==DialogResult::OK)
{
String *s=opFileDlg->FileName;
GetInputSimple(s, dtsData);
}
}
I am pretty lost now so any input would be appreciated!

Jessica
Nov 16 '05 #1
0 933

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: bdwise | last post by:
I have this in my body tag: something();something(); document.thisForm.textBox1.focus();something(); And I want to find a part between the semicolons that ends in focus() and remove the...
2
by: Anshul Seth | last post by:
I have been dealing with the page-break problem for long, and have not been able to come to a solution. I am using XSL:FO to generate PDF report for my XML, generating it in tables. I want that...
1
by: Adam.Paschke | last post by:
I wrote a program using Visuall C++ .Net 2003 and tried to run them on a different computer and they don work. It is a pretty simple program that uses ADO to get some info from a database. It...
9
by: Christian Hubinger | last post by:
Hi! I've implemented some DropDown list in ASP.NET that use Ajax to fetch the data from the server. The javascript is written to call cascading to the bottom most dropdown in order to update...
8
by: John M. Gabriele | last post by:
I'm putting together a small site using Python and cgi. (I'm pretty new to this, but I've worked a little with JSP/servlets/Java before.) Almost all pages on the site will share some common...
22
by: Tony Girgenti | last post by:
Hello. I'm developing and testing a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2 computer. I'm using a web form. Using...
7
by: ljuljacka | last post by:
I'm just trying to run a fileupload script from the manual, just to see how it works, and it won't. I've checked if file upload is enabled and it is. Also, the file I'm trying to upload is smaller...
19
by: Dave Rado | last post by:
On 15 Apr, 23:23, John Hosking <J...@DELETE.Hosking.name.INVALID> wrote: A lot of my pages wouldn't display correctly in IE6 if I did that. IE6 didn't implement the w3c rules properly and as...
2
Motoma
by: Motoma | last post by:
Hello everyone, I am having a tiny problem putting together a small script. I tried throwing together a multi-threaded ping utility, but the threads are not behaving the way I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.