.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 9th, 2005, 03:04 PM
kolokol kolokol is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 18 kolokol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 3 m 5 sec
Reputation Power: 0
Structuring a .NET program.

Maybe this should be in c++ but its vc++.net so ill put it here.
The problem is that it dosen't know what the getData function is. It says AminoAcids is not a class name. As far as i can tell this is the last error...please help

#pragma once
#include <string>
#include <cstdio>
#include <cstdlib>
#include <iostream>
//include file stream functions
#include <fstream>
//include string stream functions
#include <sstream>



namespace cDNAtoProtein01
{


using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:ata;
using namespace System:rawing;
using namespace cDNAtoProtein01;

/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>





public __gc class Form1 : public System::Windows::Forms::Form
{
public:

Form1(void)
{
InitializeComponent();
//call InitializeFileReader
InitializeFileReader();
}

protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super:ispose(disposing);
}

private: System::Windows::Forms::Panel * panel1;
private: System::Windows::Forms::Label * conout;
private: System::Windows::Forms::Button * eSeaq;
private: System::Windows::Forms::TextBox * newout;
private: System::Windows::Forms::Label * label1;

private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container * components;

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>



void InitializeComponent(void)
{
//icstuff
}


public:
//prototype getData
void AminoAcids::getData(System::String __gc *pLetter, System::String __gc *pName, System::String __gc *pHp);
//aminoacids class
__gc class AminoAcids
{
public:

//default constructor
//getdata function because i cant use array if i have non default
//constructor, i.e. one with arguments
void getData(System::String __gc *pLetter, System::String __gc *pName, System::String __gc *pHp)
{
//use the function to copy values into the object
letter = pLetter;
name = pName;
hp = pHp;
}
// char (*pgD)(char* pLetter, char* pName) = &getData;

//more public stuff, these are not protected
System::String __gc *letter;
System::String __gc *name;
System::String __gc *hp;

};
//filereader function
bool parseString(System::String __gc *pString, System::String __gc *pLetter, int lasize,
System::String __gc *pName, int nsize, System::String __gc *pHp, int hsize)
{

bool failstate;
failstate = false;
//to implement arrays in managed c++
//i have to use the array list method

using namespace std ;


pLetter = pString->Substring(1,1);
pName = pString->Substring(2,3);
pHp = pString->Substring(5,1);

if (pLetter != NULL && pName != NULL && pHp != NULL)
{
failstate = true;
}
return failstate;

}
void InitializeFileReader(void)
{
using namespace cDNAtoProtein01;
//initialize an array of aminoacids
AminoAcids *array[] = __gc new AminoAcids*[21];
//filereader code
String __gc *szFileName;
szFileName = "AminoAcids.txt";
using namespace System::IO;
FileStream* fsInput = new FileStream (szFileName, FileMode::Open,
FileAccess::Read);
StreamReader* pFileStreamThree = NULL;
pFileStreamThree = new StreamReader(fsInput);
for (int i = 0;i < 21
{

System::String __gc *tBuffer;
tBuffer = pFileStreamThree->ReadLine();
using namespace std;
if (pFileStreamThree->Peek() >= 0)
{
Form1::conout->Text = "end of file";
break;
}
using namespace std ;
char inpletter[3];
char inpname[5];
char inphp[3];

using namespace cDNAtoProtein01;
bool result = parseString(tBuffer, inpletter, 3, inpname, 5, inphp, 3);

if(result == false)
{
Form1::conout->Text = "error parsing string\n";
continue;
}
else
{
String __gc *x = inpletter;
String __gc *y = inpname;
String __gc *z = inphp;
array[i]->getData(x , y , z);
i = i + 1;
}

}
}







private: System::Void eSeaq_Click(System::Object * sender, System::EventArgs * e)
{

System::String __gc *cabbage;
cabbage = "stoat";
conout->Text = cabbage;

}

};
}

Reply With Quote
  #2  
Old October 10th, 2005, 10:27 AM
kolokol kolokol is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 18 kolokol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 3 m 5 sec
Reputation Power: 0
Well it turns out that i didn't need to prototype getData.
I removed that line and it worked....

Reply With Quote
  #3  
Old October 12th, 2005, 06:16 PM
comrade Cooney comrade Cooney is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Location: England
Posts: 3 comrade Cooney User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 25 sec
Reputation Power: 0
Send a message via AIM to comrade Cooney Send a message via MSN to comrade Cooney Send a message via Yahoo to comrade Cooney
Quote:
Originally Posted by kolokol
Well it turns out that i didn't need to prototype getData.
I removed that line and it worked....

lol, I hate when it's something that simple

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Structuring a .NET program.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT