C# :: XmlSerializer Constructor Is Failed
Sep 6, 2014
im trying to save my windows application into an xml file, but the operation failed i when im trying to create XmlSerializer ( no error accures).
void main() {
this.saveFileDialog1.Filter = "Xml Files (*.xml)|*.xml";
this.saveFileDialog1.FilterIndex = 2;
this.saveFileDialog1.RestoreDirectory = true;
if (this.saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
XmlSave.SaveData(GuestsManager.Instance, this.saveFileDialog1.FileName);
[code]....
View 14 Replies
ADVERTISEMENT
Mar 1, 2014
i am writing this bank accounts program using structures. i haven't implemented the function before that i want to check if the data is being read and printed. When i build and run the program in visual studio it gives me the following error. "No constructor could take the source type, or constructor overload resolution was ambiguous". Now whats wrong in this program?
/* Bank Accounts Program */
#include <iostream>
#include <string>
#include <fstream>
#include <cstdlib>//needed to use system() function
using namespace std;
const int MAX_NUM = 50;
struct Name{
[code]....
View 1 Replies
View Related
Jan 25, 2014
VS 2012 / Windows 7 64 bit
class
class myclass {
public:
myclass(){/*stuff here*/}
myclass(int* p) {MyPointer = p; myclass()}
[Code] ....
it works until the myclass(int* p) calls myclass()
then the MyPointer will become CCCCCCCC (NULL value)!
is there a way to stop the second constructor from resetting the pointer value to null?
View 3 Replies
View Related
Apr 12, 2014
So here I have a program that is supposed to basically sort out who passed and failed. I am currently stuck on the switch statement, I'm trying to count how many students received an A, B, C, etc.
Here's what I have so far:
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
void printIdInfo(ofstream &fout);
void printColumnHeaders(ofstream &fout);
[Code] ....
View 1 Replies
View Related
Mar 12, 2014
I have developed the msword automation using the following link
[URL] ....
and using VC++ in Visual studio 2010,and msoffice 2007.
Its working fine. but the exe can not run in windows xp (same msoffice 2007 and installation folder also same). i do not know what is the problem. plz tell about how compactability in both os and different version of office like 2003, 2007, 2010, etc....
View 6 Replies
View Related
Jan 13, 2013
what i want to do is if memory allocation fails it display a message shown in the example but its not working
vehiptr = new VEHICLE[vnum];
if(vehiptr == 0)
{
cout<<"Failed to Allocate Memory"<<endl;
return main();
}
View 18 Replies
View Related
Nov 12, 2013
I got this message after i delete allocated class object, should i check the deleting? if it's object what is the correct way to delete/delete[]?
theCars[nToDel] is a static array of pointers
bool Cars::deleteElement(int nToDel) {
if (theCars[nToDel] != NULL) {
delete[] theCars[nToDel];
theCars[nToDel]=NULL;
inUse--;
return true;
} else
return false;
}
View 3 Replies
View Related
Sep 21, 2013
I have a.h as follows
namespace one{
namespace two{
enum Filter {
GRAPE, COSINE, SYNC
};
}
}
If I do this in another header file b.h
#include <one/two/a.h>
namespace one {
namespace three {
}
}
I get error 'n' does not name a type.
View 3 Replies
View Related
Nov 28, 2013
I am facing an issue of file open failure after CopyFileW.
I suspect that some of the handle which is part of copy is still holding the file.
How can i wait till the OS handle free the file.
Any API's available to check this ?
View 4 Replies
View Related
Mar 22, 2014
I am trying to use MessageBox in OnInitialUpdate function but its giving me "Debug Assertion Failed Message"
File: f:ddvctoolscrt_bldself_x86crtsrcvsprintf.c
Line:244
I am using the following code:
Code:
void CRotateImageView::OnInitialUpdate() {
int k;char str[2];
CView::OnInitialUpdate();
CString szStr,szstr1;
[Code] .....
However when i am using the same code in OnDraw its working.
Code:
void Csprintf_sEGView::OnDraw(CDC* /*pDC*/) {
Csprintf_sEGDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
[Code] ....
View 3 Replies
View Related
Mar 11, 2014
I am trying to run the code below but I receive the following error message :
Debug Assertion Failed!
Program: C:TestDebugTest.exe
File: c:program filesmicrosoft visual studio 10.0vcincludevector
Line:932
Expression:vector subscript out of range
Code:
#include <fstream>
#include <cstdlib>
#include <iostream>
#include <strstream>
#include <cstring>
#include <cmath>
#include <map>
#include "Swap.h"
#define SIZE_X 100
[Code] .....
View 14 Replies
View Related
Dec 8, 2013
Basically, I'm moving a VC project from my Windows 7 build machine to a new build machine that's running Windows 8.1. One of the pre-build steps (for a particular project) runs a script which needs to call the M4 macro processor (which is installed on my C: drive). I've been pretty careful to set everything up the same on both machines (including my PATH) but when I try to build the project on my Windows 8 box, MSVC's IDE shows me this error output when running the script:-
m4 failed with exit code 255
View 5 Replies
View Related
Feb 19, 2014
Well still working on my project, now the bubble sorting failed. For some reason the first slot in the array is empty and when I attempt to enter a record to access, it just crashes or prints a blank record. Here is my code for the viewing of the record and a SS of the empty array slot.
Code:
void searchRec(void) {
void Printing(int *ver, int *max);
FILE *fPtr;
struct Students vStudnt;
int set;
int ver;
int i = 0;
int fin = 0;
int sel;
char order;
[Code]...
Well I don't see why there is a empty slot, why?
View 6 Replies
View Related
Feb 23, 2015
My use case is this: I have a C# Console application. I would like to run it via the Windows Task Scheduler, and would like it to attempt to run until it succeeds. My problem is that I can't achieve this. How does the Windows Task Scheduler recognize that a program has failed? I tried returning 1 or 32 instead of 0 but that didn't work. One possibility is to have the rerun logic in the C# console application but it feels like there must be a better way.
View 6 Replies
View Related
Feb 27, 2014
I'm working on a project which consists of several ocx loaded by one exe. The platform is WinCE. Now I'm on a process to create a new ocx. I do have a copy of those ocx projects in Win32 platform. These Win32 versions were only used to register ocx in local system and then put those on to application dialog by 'Insert ActiveX'.
Now the problem is those Win32 projects are so outdated, and unable to build. Getting too many linking errors to be solved.
I have build the new ocx and link that with exe manually by editing .rc file and all. But still no luck. New ocx is getting registered in WinCE device but failing to start application.
View 6 Replies
View Related
Oct 2, 2014
I've created a new dialog in my MFC dialog based application. the new dialog contains 5 control buttons. The following happens and I don't understand why?
1. click on buttonX. (result ok, OnBnClicked message is sent)
2. click on on any place of the application, but not on the dialog.(removing focus from dialog)
3. click again on buttonX (FAILED, OnBnClicked message is NOT sent). but if instead I click on any other button in the dialog (result ok, OnBnClicked message is sent).
And when I do:
1. ...
2. ...
3. click on the dialog area just to set focus on the dialog again
4. click again on buttonX. (result ok, OnBnClicked message is sent)
**I need to do step 3 only if I want to click again on the buttonX! why?? I think it related to SetFocus() but I m not sure how.
I've tried different style like, tool windows, overlapped, popup. it happens in all the cases.
Code:
class CToolsDlg : public CBDialog {
DECLARE_DYNAMIC(CToolsDlg)
public:
CToolsDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CToolsDlg();
CToolTipCtrl m_ToolsTips;
[Code] .....
View 6 Replies
View Related
Feb 14, 2013
I am using visual studio 2012 and i pass three command line arguments as 10 20 30 and when i m compile the program get error.....
Code:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
main(int n,char **p) {
int sum=0,i;
if(n>=2)
[Code] .....
View 2 Replies
View Related
Apr 14, 2012
In my program I open two files and write data into each, and close them. this is done in a while loop.
int main() {
while() {
myFile = fopen("file1.txt","w");
myFile2 = fopen("file2.txt","w");
// write data into files using fprintf() in a for loop
fclose(myFile);
fclose(myFile2);
}
}
However, after some iterations the fopen() for myFile2 fails.
Debug assertion failed!
Program....
File ......srcfprintf.c
Line 55
Expression (str != NULL)
I have not been ableto locate the bug in the code that is causing the failure.
View 7 Replies
View Related
Aug 1, 2013
I am trying to open a file from local Path by the follwing code
CString csRegExtractFileRemote;
CFileException ef;
CFileStatuscfsStatus;
CFile cfSAP;
csRegExtractFileRemote = "c:SWRemoteFilesample.txt";
[Code] ....
Compilation is success full ,but i am observing that some junk value is there in the path variable. After Reaching If statement cursor went to final return statement ...
View 2 Replies
View Related
Nov 12, 2013
I intent to use this mechanism for rename the file because the file name consists Unicode characters . I would like to know why the return value of "MoveFileExW" is false for file name consists 'space','hyphen' etc.(sometimes even without a Unicode character).for accepting 'space','hyphen' what type of conversion I would use [I.e.: Does the root cause of failure is due to CP_UTF8 type use].
Code:
//! inputPath & final_inputPath consist source and destination file name and are std::string
//! Both are in same directory F: est_files
std::wstring unicode_input_original;
int unicode_input_length_original = 0
[Code] ....
View 4 Replies
View Related
Feb 28, 2012
I am trying to use constructor within constructor in the same class. Is that possible. I have tried something and it shows me a error message:
error: type "mainClass" is not a direct base of "glavna"
This is the program I tried:
Code:
class mainClass {
private:
int x,y;
Code] ......
View 6 Replies
View Related
Jan 1, 2013
Is this example correct? This example from a book
Constructor of the Base Class
Person::Person(char* n="", char* nat="U.S.A", int s=1)
{
name = n;
nationality = nat;
sex = s;
}
Constructor of the Derived Class (inherited from the base class)
Student(char* n, int s=0, char* i=""):
Person(n, s)
Why the initialized list of the base class constructor doesn't match the initialized list of the derived class constructor? I know this book is a little bit old, I'm not sure if this wrong in VC++ 2010?
View 5 Replies
View Related
Jun 17, 2014
deal with a failed input stream and type checking input?
I use:
cout << "
Enter a menu option: ";
while(!(cin >> menuGameMode))
{
cin.clear();
while (cin.get() != '
')
continue;
cout << "Enter a menu option: ";
}
Is this the "Best" way to do it?
EDIT: We're assuming input is expecting an int.
View 9 Replies
View Related
Mar 19, 2015
to initialize this object? Why C++ FAQ says no? Here is my code,
Code:
class A
{
public:
A(int x, char c);
A(int x);
[code] ....
I don't have any trouble to call the constructor A(int x, char c) from another constructor A(int x).
View 10 Replies
View Related
Mar 11, 2013
is it possible to get object name in the constructor? I would like to initialize an object of circle class without any arguments and put some pretty lines in constructor to get and save as table of chars the name of creating object. Is it possible? I work with MSVS2012.
View 4 Replies
View Related
Oct 12, 2014
First I wrote a Binary-tree class to draw a binary tree on the window. The nodes were small circles. Then I become wanted to change the shape of the nodes from circles to triangles by another class, Binary-tree-derived which is derived from Binary-tree class. I wrote the below code to do the job but I get two errors about constructors. First, code:
/* The binary-tree class, one of the topics that has been said in Programming Principles and Practice using C++ book by Biarne Stroustrup.
This code is written by R Abbasi (s.rabbasi@yahoo.com) */
#include <Simple_window.h>
[Code].....
Errors are:
Error12error C2512: 'Binary_tree' : no appropriate default constructor availablec:userscsdocumentsvisual studio 2012projects est_1 est_1 est_1.cpp91
13IntelliSense: no default constructor exists for class "Binary_tree"c:UsersCSDocumentsVisual Studio 2012Projects est_1 est_1 est_1.cpp91
View 4 Replies
View Related