Hi all,
I have a thread to monitor serial port using select system call, the run function of the thread is as follows:
void <ProtocolClass>::run()
{
int fd = mPort->GetFileDescriptor();
fd_set readfs;
int maxfd=fd+1;
int res;
struct timeval Timeout;
Timeout.tv_usec=0;
Timeout.tv_sec=3;
//BYTE ack_mess...
I've added x64 configuration to my C++ project to compile 64-bit version of my app. Everything looks fine, but compiler gives the following warning:
`cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'`
Is there SSE2 optimization really not available for 64-bit projects?
...
Hi
Can anyone tell me how to create a process in VC++? I need to execute
regasm.exe testdll /tlb:test.tlb /codebase
command in that process.
...
I'm writing a software for hyperbolic partial differential equations in c++. Almost all notations are vector and matrix ones. On top of that, I need the linear algebra solver. And yes, the vector's and matrix's sizes can vary considerably (from say 1000 to sizes that can be solved only by distributed memory computing, eg. clusters or sim...
I like to force a policy of no warnings when I check someone's code. Any warnings that appear have to be explicitly documented as sometimes it's not easy to remove some warnings or might require too many cycles or memory etc.
But there is a down-side to this policy and that is removing warnings in ways that are potentially dangerous, i....
Hi
I've added a new library to my application (multiple projects-DLLs) - SQLite, to perform some in memory caching. There is just one library/project that is affected by this change - Lib1.
A build goes through fine. All libraries are built successfully and no errors are reported, including a couple of Com Objects.
If I try to registe...
Hi, we're considering exposing some C# types to C++ clients via COM. What problems can we expect to hit over the life of the project? E.g. how will versioning be managed?
On versioning, it would seem from reading this that we should decorate our types to be exposed with [ClassInterface(ClassInterfaceType.None)] and use an explicit int...
I am sure this would have been asked before but couldn't find it. Is there any built in (i.e. either using std::wstring's methods or the algorithms) way to case insensitive comparison the two wstring objects?
...
Am I right in assuming that adding/removing elements to an std::map does not effect the other elements (ie cause them to be relocated in memory) and so that the following is safe:
I looked at various sites with info on the container but only found out about the cases where iterators are invalidated, which I already know...
std::map<std...
I'm trying to compile shared library on solaris 2.7 using gcc 3.4.6 and
which is linking to a statically linked c .a and .o files.
Please note that it is using Sun ld from path "/usr/ccs/bin/ld"
At linking time i got a long list of symbols and following error
ld: fatal: relocations remain against allocatable but non-writable sections...
On my .NEt projects I'm used to the tool called ReSharper but my current project is c/c++ and I so miss my loved ReSharper any one know of a tool with at least kinda the same capabilities for c/c++ (Especially refactoring and dead code analysis)
...
As I understand it I can use reverse P/Invoke to call C# from C++. Reverse P/Invoke is simply a case of:
Create you managed (c#) class.
Create a c++/cli (formerly managed c++) class library project. Use this to call the managed c# class (presumably via a reference).
Call the c++/cli code from native c++.
Questions:
Is this correc...
Hello,
I formed class template that represent two dimensional array :
template<class T>
class Array2D {
protected:
public:
T *data;
const unsigned rows, cols, size;
Array2D(unsigned r, unsigned c) : rows(r), cols(c), size(r*c) {
data = new T[size];
}
~Array2D() { delete data; }
void...
Hey Stackoverflow,
I found this function in the header file of an abstract class:
virtual ostream & print( ostream & out ) const;
Can anyone tell me what kind of function this is and how to declare it in a derived class?
From what I can tell, it looks like it returns a reference to an outstream.
If I implement it in my cc file with ...
GCC seems to allow "and" / "or" to be used instead of "&&" / "||" in C++ code; however, as I expected, many compilers (notably MSVC 7) do not support this. The fact that GCC allows this has caused some annoyances for us in that we have different developers working on the same code base on multiple platforms and occasionally, these "error...
I have a Windows Mobile 6 Professional native project that runs ok on Win Mobile devices. Now I need a version that runs on Windows Embedded CE 6.0 RC2. What is the best path for this conversion? Can I just change few project settings / add new platform with configuration manager OR I have to start with new smart device project and impor...
I'm extremely new to c/c++ so I need a push in the right direction. I have this library called BASS which is an audio library which I'm going to use to record with the microphone. I have all the files needed to use it, but I don't know how to install the library. I tried taking the example files and putting them in the same directory as ...
I have this struct:
struct Snapshot
{
double x;
int y ;
};
I want x and y to be 0. Will they be 0 by default or do I have to do:
Snapshot s= {0,0};
What are the other ways to zero out the structure?
...
I want to render font in a way that takes account of the current transforms and similar settings, especially the projection transform and viewport.
I'm thinking that the best way to do that is to have an off screen surface to render the text to, and then render that surface where I really want the text.
However I'm not certain on a num...
I feel like there is an obvious answer to this, but it's been eluding me. I've got some legacy code in C++ here that breaks when it tries to call OpenThread(). I'm running it in Visual C++ 2008 Express Edition. The program first gets the ThreadID of the calling thread, and attempts to open it, like so:
ThreadId threadId = IsThreaded...