I am looking as a new file format specification and the specification says the file can be either xml based or a zip file containing an xml file and other files.
The file extension is the same in both cases. What ways could I test the file to decide if it needs decompressing or just reading?
...
I haven't used C very much in the last few years. When I read this question today I came across some C syntax which I wasn't familiar with.
Apparently in C99 the following syntax is valid:
void foo(int n) {
int values[n]; //Declare a variable length array
}
This seems like a pretty useful feature, does anyone now if there was eve...
Our company wants to transform our current user interface to a web client. We are considering to use Microsoft's Silverlight for this, but it will need to communicate with our legacy C++ server application (native C++, not C++/CLI). I am wondering whether it would be feasible to write such an IPC library by hand, our otherwise whether th...
Hello,
I am running Visual Studio 2005 on Windows XP. It crashes without any error, log or trace when I try to load the solution for our product that contains 362 projects. I don't think the size of solution (362) is a problem, because it works on my colleagues computers. There is no entry of this in Event Viewer.
Any help to locate ro...
I am a newbie and i would like to give artistic effects to the images such as photocopy , blur ,glow edge, mosaic bubble ,pencil sketch ,marker , glass effect,paint brush,glow diffused effect programatically?
I want to implement it and any input is appreciated.
The following link depicts what i want to do exactly...
http://picasaweb.go...
I'm currently working on a project in which I'd like to define a generic 'collection' interface that may be implemented in different ways. The collection interface should specify that the collection has methods that return iterators by value. Using classes that wrap pointers I came up with the following (greatly simplified):
Collection....
hi
what does this error message mean :
error C2662: 'addDoctor' : cannot convert 'this' pointer from 'const class Clinic' to 'class Clinic &'
I'm not using const though
sorry,but this is my first time posting experience
Clinic.h
class Clinic{
public:
Clinic();
int addDoctor(Doctor*);
private:
Doctor doctors[10]...
Hi guys I'm using the SKELETON_JAR variable on my c++ code in one header. However I want to allow the user to define the place of the jar in the compile time easily. I think the easiest way to do that is to put this define in makefile is that so?
#define SKELETON_JAR "./Util.jar"
??
...
Core of the problem: I receive "(0x80070002) The system cannot find the file specified" for roughly 8 to 9 seconds before it can open it successfully.
In a nutshell, we have two com components. Component A calls into Component B and asks for a UNC filename to write to - the filename returned doesn't exist yet, but the path does - it th...
I want to open a text file into some text editor say notepad programmatically in c/c++.
Also i want to see real time updation of text into that text file while opening in a editor.
Please suggest.
...
I am implementing a client/server application where video streaming occurs between two computers (in one direction). I would like to have the server publish an SDP file when it starts streaming. The client would then be able to download this SDP file and use it to get the stream. In order to implement this it seems I need to include a RT...
// --------------------------------------------------------------------
UPDATE: I messed up. I left a call directly to openfeint in my AppDelegate->onApplicationWillResignActive which was causing the compiler C++ error.
My Appologies, the singleton does work should anyone be thinking of trying the same thing. Just be sure to include t...
I need to call a method that expects a function pointer, but what I really want to pass to it is a functor. Here's an example of what I'm trying to do:
#include <iostream>
#include "boost/function.hpp"
typedef int (*myAdder)(int);
int adderFunction(int y) { return(2 + y); }
class adderClass {
public:
adderClass(int x) : _x(x) ...
#include <iostream>
using namespace std;
struct Node
{
char item;
Node *next;
};
void inputChar ( Node * );
void printList (Node *);
char c;
int main()
{
Node *head;
head = NULL;
c = getchar();
if ( c != '.' )
{
head = new Node;
head->item = c;
inputChar(head);
}
printList(head);
...
union members may not have destructors or constructors. So I can't template the following class Foo on my own MyClass if MyClass has a constructor:
template<class T>
struct Foo {
T val;
Foo(T val_) : val(val_) {}
size_t hash() const {
union {T f; size_t s;} u = { val };
return u.s;
}
};
struct MyClass {
bool a;
doubl...
Ok so let's say we have a linked list of characters with a head pointer. How can I create a loop to enter a string of characters into the linked list? My problem is when I think of head and head->next and head->next->next . . . it only seems natural to use a recursive function to set the characters at each node.
...
I have for example, a Lua table/object:
bannana
And this Lua table has a function inside it called chew, that takes a parameter
bannana.chew(5)
I have also used SWIG, and have for example a class CPerson:
class CPerson {
public:
// ....
void Eat();
// ....
};
I can obtain an instance of this object fr...
How to get main window handle from process id?
I want to bring this window to the front.
It works well in "Process Explorer".
...
I have just come accross Google's Protocol buffers. It seems to be the solution for a C++ backend application I am writing. Problem is I cant seem to find anything regarding vector types. The documentation mentions repeated_types, but I cant seem to find anything.
Supposing I have these set of classes:
class UnifiedBinaryHeader
{
publi...
Hello, I have tried to use this code in VS2008 (and may have included too much context in the sample...):
class Base
{
public:
void Prepare() {
Init();
CreateSelectStatement();
// then open a recordset
}
void GetNext() { /* retrieve next record */ }
private:
virtual void Init() = 0;
virtu...