C# :: Using The Sage Data Object?
Jan 29, 2015
I've downloaded a Sage 50 2014 data object and added a reference to it in my project. I'm able to connect to the Sage Account package using:
SDOEngine sdoEngine = new SDOEngine();
WorkSpace workSpace = sdoEngine.Workspaces.Add("MyCompany Limited");
try
[Code].....
View 4 Replies
ADVERTISEMENT
Apr 15, 2014
All i need is to create a "read" function to read all the data for a Player Object.
So Far i made a display function to display all the data for the "Player" object, but i don't know how to make a read function.
Here is my program:
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include "player.h"
[Code] .....
View 3 Replies
View Related
May 24, 2014
How do you create an object (like in the title) something more simple than a struct? I wanna know that cuz I'm writing a function that could return a boolean and an integer at the same time.
View 2 Replies
View Related
Dec 14, 2013
I am writing a program that manages a group of tool bins. This group is handled as an object that is an array of two element structures called InvBin. I initialize the bins with data from a file which contains the descriptions and initial quantities. I also have functions to add or subtract items from a bin and a function to display a report of the description and quantity of all of the bins.
The add and remove functions work correctly based on the cout statement in the functions, however when I display the report, it displays the initial quantity instead of the new quantity. In addition, when I use the add and remove functions again on the same bin, they use the initial quantity.
These are the add and remove functions and the report function from the main program.
Code:
//Adds an item to a bin
void addItem(HANDLE screen, BinManager tools, int &count) {
int binNum;
int addNum;
system("cls");
[Code].....
View 2 Replies
View Related
Dec 21, 2013
I have an abstract class Base, with derived classes Derived1, Derived2, etc. I don't know how many there are. So, I have declared an object of Derived like so:
Base* der1 = new Derived1(/* constructor details */);
That gets passed to a function, which modified the data contained by this pointer. However, I need to keep the data from the object, which means that I need to copy the data somehow. The problem is, this copying needs to be done within the function, due to the requirements of the program. I do not know what type the object is, This function will need to reset this data potentially hundreds of times, so I can't just provide lots of objects, as either the function will run out of objects to call or I will run out of space in memory.
How would I create a copy of this, so that I would be modifying a temporary object that could be deleted and I would keep the data that I started with?
View 4 Replies
View Related
Feb 26, 2012
Basically, I've got one object which has to access private data in another object... and can't.
Here's the specifics: I'm writing a little war game program where players deploy units (soldiers, tanks, planes, etc.) onto a gameboard. Players and Units are modeled as objects:
Code:
class GameUnit {
public:
string GetName() {return Name;}
protected:
string Name;
};
class Player {
[Code] ....
Here's the problem: In the above code, Player's ListUnits() function doesn't work because Player can't access GameUnit's GetName() function.
Specifically, here's the compiler's error message:
Code:
In file included from Main.cpp:18:
Player.h: In member function 'void Player::ListUnits()':
Player.h:47: error: 'GetName' undeclared (first use this function)
Player.h:47: error: (Each undeclared identifier is reported only once for each function it appears in.)
I've tested enough to realize that the problem is the GameUnit::GetName() function is a public function within the GameUnit object. Why can't a Player call this function? Making both friend classes of each other doesn't work.
View 3 Replies
View Related
Nov 12, 2013
How does an object access its private data members in copy constructor.
The relevant part of the code: Code: C::C(const C &obj)
{
x = obj.x;
y = obj.y;
}
Normally the object1 called "obj" cannot access its private data members outside. But in this situation it can access. How can it be explained?
Here are the complete code:
Code:
#include <iostream>
using namespace std;
class C{
public:
C(int,int);
C(const C &);
[Code] .....
View 7 Replies
View Related
Aug 20, 2013
What is the size of object in c++ , if there is no data member in the class ?
View 3 Replies
View Related
Mar 19, 2014
#include <iostream>
#include <string>
using namespace std;
class book {
private:
string bookname;
double bookprice;
public:
book(string k="calculus",double b=25.5)
{ bookname=k;
bookprice=b;
}
View 2 Replies
View Related
Sep 20, 2012
class CPop {
CBSVector<CTour> pop;
CBSVector<double> probability;
int popsize;
double TotalFitness;
CTour Elite;
CTspGAParams GAParameters;
}
error C2059: syntax error : 'constant'
error C2238: unexpected token(s) preceding ';'
I don't know y these errors, it runs fine in simple c++ environment
View 14 Replies
View Related
Dec 5, 2014
I am trying to read a file use the data line by line to create into an object. The current file I have is like this and the code reading the file will be found below.
1223 Fake1 Name1 60 70 80 24 89 add1 Male
1224 Fake2 Name2 61 70 81 80 24 add2 Male
1225 Fake3 Name3 63 70 82 80 89 add3 Male
1226 Fake4 Name4 63 70 83 80 88 add4 Male
The problem I am having is that I need to put delimiters in the file so that a person can have more than one name and also the address can now hold multiple strings until the delimiter.
I would like to change my file to this;
1223 : Fake1 Name1 : 60 : 70 : 80 : 24 :89 : This will be address1 : Male
1224 : Fake2 Name2 : 61 : 70 : 81 : 80 :24 : This will be address2 : Male
1225 : Fake3 Name3 : 63 : 70 : 82 : 80 :89 : This will be address3 : Male
1226 : Fake4 Name4 : 63 : 70 : 83 : 80 :88 : This will be address4 : Male
How can I update the code below so that it can use the delimiters to create an object?
void loadFile(Person people[], int* i) {
ifstream infile("people2.txt");
if ( !infile.is_open()) {
// The file could not be opened
cout << "Error";
[Code] .....
View 5 Replies
View Related
Apr 14, 2014
I'm having a problem trying to modify my patient's data. It seems to work, but once the block of code ends it does not save to the linked list.
Problem located in case M.
linked list template header: [URL] ...
patient header: [URL] ...
patient implementation: [URL] ...
#include <iostream>
#include "listTemplate.h"
#include "PatientRecord.h"
using namespace std;
char menu() {
char input
[Code]...
View 1 Replies
View Related
Jun 26, 2012
I am to first increment data members of object that has not created dynamically (i have done with this part),now i have created object dynamically and how to increment its data which i have passed as argument as:
obj3 = new manage(35 , 36)
View 4 Replies
View Related
May 16, 2013
Error:
--------------------Configuration: nc - Win32 Debug--------------------
Compiling...
cv.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/nc.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
nc.exe - 2 error(s), 0 warning(s)
Compiles with 0 error but on running 2 Errors appear.
I'm Inputting data of an object from user and then inserting it in the link list.
#include <iostream>
//#include <fstream>
using namespace std;
#define LEN 100
////////////////////////////////////////////////////////////////////////////////////////////////////
class employee{
[Code] ....
View 1 Replies
View Related
Jan 21, 2014
I have two puzzling issues I am dealing with.
Issue 1: I am using a stringstream object in a block of my program that needs to be visited repeatedly depending on a user's selection from a menu. I want the contents of this stringstream object to be cleared any time control gets to this part of the program. I have tried the clear and flush functions to no avail.
Issue 2: I am reading data from a source text file that would be regularly changed during the course of program run. After the program run is over, I am supposed to save the results(which is basically the source text file AND all updates) in a destination file. This destination file would then serve as the source file when next the program is run. In other words, I want a scenario where my results overwrite the original contents of the source file; implying that my source and destination files are now one, pretty much. How can I do this?
View 7 Replies
View Related
Mar 16, 2013
will copy constructor does object initialization using another already created object? I understand that it can be applied for object initialization and not for assignment.Is it correct?
View 10 Replies
View Related
Jul 3, 2014
I have a method to take a Tile object and make an instances of it based on some data from the original object. Than it is suppose to manipulate the a specific instance and save the results. The first loop through it works but it changes all instance as well as the base.
public static int recurse(int count, Tile[,] b,Huristic h,int check) {
if (check==1) {
boardState.Add(B)/>;
return check;
} if (check == 0)
[Code] .....
View 6 Replies
View Related
Dec 13, 2012
#include "B.h"
class A {
public :
A()
{
s_b = new B();
b = new B();
[Code] ....
In my project i have seen static object as above . But not able to know what is the exact use of it and how they are different from general object .
View 2 Replies
View Related
Sep 11, 2014
a function returns a temporary object like
int myfun(){
int x = 0;
return x;
}
this function will return a temporary integer now void fun1(const int & num); this function can receive from myfun().BUT void fun2(int & num); this function cannot receive from myfun() Why is that, Moreover what is lifetime of a temporary object like one returned in myfun() ???
View 7 Replies
View Related
Mar 28, 2014
I am trying to use web api in order to return custom json response keys. For this i have return a custom class to return json response
Custom Class:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
[Code].....
View 2 Replies
View Related
May 4, 2013
I have a combobox with Items 1024
2048
4096
8192
String cach = form.comboCache.SelectedItem.ToString();
I am using the above code to retrive an item selected by user,But this line is giving an exception "Null Reference Exception, Object reference not set to an instance of an object"
View 1 Replies
View Related
Mar 28, 2014
I am using session to pass object from controller to custom class in MVC Web API. here is my code, i am getting error at session.
public HttpResponseMessage Get()
{
var person = db.Persons.ToList();
[Code]....
View 1 Replies
View Related
Aug 23, 2013
In Visual Studio 2010 C++
I have a series of existing text objects
The text properties names are
item1_lbl,
item2_lbl,
item3_lbl,
….
Based on a selection I want to change an object. I generate the name of the object I want to change in a string so from this string is there a way to get a pointer to the correct text object that is same name?
View 3 Replies
View Related
Sep 22, 2014
I'm trying to figure out how I can create a vertex array object at offset of a vertex buffer object.I've created the buffer object. I'd like the "texs" idnex data to start at the texture coordinate content of the vertex_t structure.
Type definitions:
struct vertex_t {
vector3d_t position;
float s; // Texture coordinate s
float t; // Texture coordinate t
};
Code so far:
// How do I make this start at a certain spot of the VBO?!
glVertexAttribPointer(texs, 2, GL_FLOAT, GL_FALSE, sizeof(vector3d_t), nullptr;
//...
View 1 Replies
View Related
Dec 6, 2013
I need to find inverse of a matrix data in binary file should be used to form matrix.its not finding inverse correctly rest is working good.
Code:
#include <stdio.h>
void createbin();
void display();
void inverse();
int main()
{
createbin();
display();
inverse();
[Code] ....
View 4 Replies
View Related
Dec 26, 2013
I am writing a program where I need to read a byte of char data and convert it into a text string of binary data that represents the hex value...
i.e. The char byte is 0x42 so I need a string that has 01000010 in it. I've written the following subroutine....
------------- My Subroutine ----------------------------------------------------------------------
void charbytetostring(char input, char *output){
int i, remainder;
char BASE=0x2;
int DIGITS=8;
char digitsArray[3] = "01";
[Code] ....
When I submitted the byte 0x42 to the subroutine, the subroutine returned to the output variable 01000010... Life is good.
The next byte that came in was 0x91. When I submit this to the subroutine I get garbage out.
I am using a debugger and stepped through the subroutine a line at a time. When I feed it 0x42 I get what I expect for all variables at all points in the execution.
When I submit 0x91 When the line remainder = input % BASE; gets executed the remainder variable gets set to 0xFFFF (I expected 1). Also, when the next line gets executed..
input = input / BASE; I get C9 where I expected to get 48.
My question is, are there data limits on what can be used with the mod (%) operator? Or am I doing something more fundamentally incorrect?
View 6 Replies
View Related