I have a small C++ application which I imported Objective-C classes. It works as Objective-C++ files, .mm, but any C++ file that includes a header which may end up including some Objective-C header must be renamed to a .mm extension for the proper GCC drivers.
Is there a way to write either a purely C++ wrapper for Objective-C classes ...
Hello,
I have a static library that I am building in C++. I have separated it into many header and source files. I am wondering if it's better to include all of the headers that a client of the library might need in one header file that they in turn can include in their source code or just have them include only the headers they need? ...
Hi, I am thinking to write a simple wrapper class for socket in C++. I wonder if there is a need to have concrete class specific to I/O type, such as TcpSyncSocket and TcpAsyncSocket. Thus I would like to know how often do you guys find yourself in need to have mixture of both kind I/O operations on single socket. While I do not have ext...
Does C++ code gets converted to C before compilation ?
...
Is there anything equivalent to #pragma once for Codegear RAD Studio 2009?
I am using the precompiled header wizard and I would like to know if it is still necessary to use include guards when including header files?
...
I'm trying to use 7-Zip to zip up a file via the system() function in C++ on a windows XP machine.
I tried:
(formatted to be what system() would have received)
"C:\Program Files\7-Zip\7z.exe" a -tzip "bleh.zip" "addedFile.txt"
which spat the error
'C:\Program' is not recognized as an internal or external command,
operable program or ...
When I run an executable that I built, I get the following error:
The system cannot execute the specified program
My immediate thought was that it was a dependency problem with one of the VC8.0 re-distributable DLLs (msvcr80d.dll et al.). We have had a few problems with patched versions of these DLLs affecting our programs.
When I...
I am using code from this site:
http://www.spacesimulator.net/tut4_3dsloader.html
It works in their example project but when I placed the code into a class for easier and more modular use, the texture fails to appear on the object.
I've double checked to make sure the texture ID is correct by debugging them side by side.
On my project ...
In general, if you have a class that inherits from a Thread class, and you want instances of that class to automatically deallocate after they are finished running, is it okay to delete this?
Specific Example:
In my application I have a Timer class with one static method called schedule. Users call it like so:
Timer::schedule((void*)o...
I have implemented multithreaded shared library in C++ (For Linux and Windows). I would like to add logging mechanism inside the library itself. The caller of the library is not aware of that. The log file would be same so i am wondering how could i design the thread safe logging if multiple process is using my library and trying to open...
I found the windows style WS_EX_TOOLWINDOW but this changes the title bar. Is there a way to not have the tasktray icon but keep the normal window titlebar?
...
Some code first:
class CInner {
public:
CInner( const CInner& another ) { //impl here }
private:
// some member variables
}
class COuter {
public:
COuter( const CInner& inner ) : inner( inner ) {}
private:
CInner inner;
}
Yes, in COuter::COuter( const CInner& ) the parameter has the same name as the member variable.
...
If there is no function overloading, the function name serves as the address of the function code, and when a function is being called, its address is easy to find using its name. However with function overloading, how exactly can the program find the correct function address? Is there a hidden table similar to virtual tables that stores...
I want to archive my database of mysql. Kindly give me some guide lines how I can make it possible, I am using mysql c library for insertion and selection etc. I dont know how to use dump command.
...
I'm trying to learn ncurses, and I'm reading the terrific guide here, but the example at user pointers does not compile. I get this error when I try to compile.
menu.cpp: In function 'int main()':
menu.cpp:44: error: invalid conversion from 'void (*)(char*)' to 'void*'
menu.cpp:44: error: initializing argument 2 of 'int set_item_use...
Link to source code of Loki Pimpl header.
I am not able to find any documentation on how to use the same, can any one explain how to use.
And what does the following function in the header do.
PimplOwner
ImplOf
PimplOf
RimplOf
...
I am new to templates in c++.
i was trying some small programs.
CPP [80]> cat 000001.cpp 000001.hpp
#include <iostream>
#include <string>
#include "000001.hpp"
int main()
{
int i = 42;
std::cout << "max(7,i): " << ::max(7,i) << std::endl;
double f1 = 3.4;
double f2 = -6.7;
std::cout << "max(f1,f2): " << ::max...
I've got about 2/3 years C++ experience but I've spent most of my career doing Java. I'm about to go for an interview for a C++ programming role and I've been thinking about the best way to brush up my C++ to make sure I don't get caught out by any awkward questions. What would you recommend?
...
Dear all,
I have some basic C++ design/syntax questions and would appreciate your reply.
I have N number of regions
Each region needs to store information about an object "element"
i.e. I want to achieve something like this:
region[i].elements = list of all the elements for region i.
Question 1:
Does the following syntax (...
I have the following parameter being bound for calling a SQL procedure:
TCHAR str[41];
SQLINTEGER cb;
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT_OUTPUT, SQL_C_TCHAR, SQL_C_TCHAR, 40, 0, str, 0, &cb);
When I loop through str after calling the query I can see the result is there, but it's not quite right:
std::stringstream ss;
ss<<"{";...