I'm looking for an ORM that will allow me to write a C# user interface and a C++ service. Both need to access data from the same database. Ideally I want C# and C++ classes to be generated from the database schema that I can then program against.
The database will probably be SQLServer, but that hasn't been decided yet.
Note: I'm doing...
If a call to fread() returns 0 and ferror() indicates an error (vs. EOF), is it OK to retry the read or is it better to close and reopen the file?
I can't start over entirely -- the input file has been partially processed in a way that can't be undone (say I'm writing out a chunk at a time to a socket and, due to existing protocol, have...
Hi,
how can I create std::ostream and std::istream objects to point to a piece of memory I allocated and manage (I don't want the stream to free my memory).
I was looking at using rdbuf()->pubsetbuf() to modify one of the other streams - say sstringstream. However I think streambuf used by stringstream will free the buffer afterwards?
...
Hello,
I wrote a dll in VS2008 that I use in my C# application,but my users don't like the fact they need both .NET framework and VC++ Runtime.
Is there a way I could avoid the 'must-have' VC++ Runtime in my C++ dll?
...
I'm trying to add a new entry into Internet Explorer's right-click context menu. I understand that this can be achieved by creating an HTML file containing JavaScript, and then linking to this from a location in the registry. I have also read that you can also add the HTML to a resource file and compile it into a DLL (see the Microsoft...
Consider this program:
#include <iostream>
#include <string>
#include <sstream>
#include <cassert>
int main()
{
std::istringstream stream( "-1" );
unsigned short n = 0;
stream >> n;
assert( stream.fail() && n == 0 );
std::cout << "can't convert -1 to unsigned short" << std::endl;
return 0;
}
I tried this on gc...
How can I use C++ to control CPU fan speed in Windows Vista Ultimate?
I would like to use ACPI.
...
Hi
I`m writing a web spider and want to use boost regex library instead of crafting some complicated parsing functions.
I took a look at this example:
#include <string>
#include <map>
#include <boost/regex.hpp>
// purpose:
// takes the contents of a file in the form of a string
// and searches for all the C++ class definitions, ...
I've been having some trouble with vs2008 SP1 running in debug mode when I try to disable checked iterators. The following program reproduces the problem (a crash in the string destructor):
#define _HAS_ITERATOR_DEBUGGING 0
#include <sstream>
int do_stuff(std::string const& text)
{
std::string::const_iterator i(text.end());
r...
I came across this kind of code once in a while - I suspect the creator is/was afraid that table delete would iterate over the table and "cost performance" (which imho will not be done either way)... is there any real benefit one might get/consider/imagine from not using the the table delete here?
myClass** table = new myClass* [size];
...
I want to invoke the following C++ function (exported by a DLL) from C#:
void createVm(
const jace::VmLoader& loader,
const jace::OptionList& options,
bool ignoreUnrecognized = true );
I've found documentation for marshaling primitives from C++ to C# but I'm not sure how to handle reference-types or non-pritmive types such as...
Hi everyone. I imported sqlite3.c sqlite3.h into my project - and I'm having trouble compiling it.
Errors:
1>c:\...\storage_manager.h(7) : error C2079: 'storage_manager::db' uses undefined struct 'sqlite3'
1>storage_manager.cpp
1>c:\...\storage_manager.h(7) : error C2079: 'storage_manager::db' uses undefined struct 'sqlite3...
I've read that there is some compiler optimization when using #pragma once which can result in faster compilation. I recognize that is non-standard, and thus could pose a cross-platform compatibility issue.
Is this something that is supported by most modern compilers on non-windows platforms (gcc)?
I want to avoid platform compilation...
I would like to perform and atomic read of 64b aligned 64b data on x86 platform (Pentium or above guaranteed).
Is there a way to do this? (And no, I do not want to use a critical section or a mutex for this, I want this to be lock-free).
...
Hi .
I googled for a Tree Visualization Framework or something like that in C++ .
And i wondered that i didn't find anything like that.
Are There any (good) Framework to draw a Tree (or other Data Structures) ?
It should be in C++.
...
I'm using a rather complex QList in a derivation of QAbstractTableModel to store data:
class MyTableModel : public QAbstractTableModel {
Q_OBJECT
QList<QHash<int, QHash<int, QVariant> *> *> m_data;
/*...*/
};
MyTableModel::~TMusicTableModel() {
/* Should I deallocate QList items? */
}
MyTableModel::setData(int r...
I've noticed that chinese mobile phones became very popular, perhaps because of their very reasonable price and many modern features (touch screens, advanced multimedia, double sim cards etc).
I'm wondering if there's any way to develop custom solutions for this handsets as independent developer? How to obtain a toolkit and documentati...
Hello all,
Am trying to move an antique C++ code base from gcc 3.2 to gcc 4.1, as I have run into a few issues. Of all the issues, the following is left me clueless (I guess I spent too much time with Java or I might have forgotten the basics of C++ :-P ).
I have a template class
template < class T > class XVector < T >
{
...
te...
I have a QTreeWidget that I insert items in, and the user can select a column to sort it. As the items are being inserted, they just get appended to the end instead of having the sort being done automatically. If I click the header to switch between ascending/descending it will sort the current items.
I figured I could call sortItems() ...
Hi All,
I am looking for the way to calculate the one-way delay in a packet-switched network. I do not want to use NTP or PTP (Network Time Protocol, Precision Time Protocol).
Consider the scenario:
Host-1 Sends the packet to Host-2. Both Hosts have different Clock rates and the hosts are located in different countries.
Packet may be...