Hi, anyone knows why this does not work when I try to include a library with the following declarations:
namespace wincabase
{
const char* SOMESTRING = "xx";
}
While this is perfectly fine:
namespace wincabase
{
const int X = 30;
}
I get a "multiple definitions" error with gcc for the first case when I link the lib. Thanks!
...
Is it possible to call an api exposed in COM exe server from NSIS script?
I am not able to find any documentation for that. If anyone knows , please reply.
...
Hi
i want to compile a c++ program using .NET2.0 compiler.
so i navigate to c:\windows\Microsoft.Netframework\2.0.57\ and uses csc compiler to compile.
It shows lot of errors.
But it compiles csharp file. But in visual studio it compiles. so i think that in visual studio c++ copiler installed i think so.
filename test.cpp
using name...
Hi,
I am engaged in developing a C++ mobile phone application on the Symbian platforms. One of the requirement is it has to work on all the Symbian phones right from 2nd edition phones to 5th edition phones. Now across editions there are differences in the Symbian SDKs. I have to use preprocessor directives to conditionally compile code...
HI
i write a code like
filename test.cpp
#include<stdio.h>
void main()
{
printf("Hello");
}
}
I have .Net Framework 2.0 installed in my computer. Compiling using MSBuild.exe
when i try to compile this from command line and navigated to .NET frameworl 2.0 folder using msbuild.exe it shows warning and error that VCBuild.exe not ...
I have a function:
HANDLE snapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
...
result=Process32First(snapshot,&pe);
while(result) {
if(!_stricmp(process_name,pe.szExeFile)) {
processes.push_back(pe.th32ProcessID);
}
result=Process32Next(snapshot,&pe);
}
for(dword_vector::iterator i=processes.begin(); i!=processes.e...
Confusing title, hopefully some code will clarify:
struct MyNestedType {
void func();
};
struct MyType {
MyNestedType* nested;
}
std::vector<MyType> vec;
// ... populate vec
// I want something approximating this line, but that doesn't use made-up C++!
std::for_each(vec.begin(), vec.end(), std::mem_fun_ref(&MyType::nested->f...
I occasionally have classes with private static data members. I'm currently debating if I should replace these with static variables in an unnamed namespace in the implementation file. Other that not being able to use these variables in inline methods, are there any other drawbacks? The advantage that I see is that is hides them compl...
Hi.
I'm currently in the process of writing a steganography application with QT. I am trying to hide my message bits in the least significant bit of the blue colour of the pixel
From debugging I can tell that this section is working as it should. However after hiding my bits in the message I then save the image and then reopen it. Thi...
I recently came across a great data structures book,"Data Structures Using C" (c) 1991, at a local Library book sale for only $2. As the book's title implies, the book covers data structures using the C programming language.
I got the book knowing it would be out-dated but would probably contain lots of advanced C topics that I wouldn't...
What are some alternatives to the Microsoft security enhanced functions such as strncpy_s or _itoa_s? Although developing in MS environment the goal is to write code that could be ported easily to other platforms.
...
Hi,
I'm writing a program in C++ and for some reason I'm getting a segmentation error at the following line:
char* param= new char[200];
I've tried different variations and even tried putting before it
int* param= new int;//for no reason
and the same error occurs. What might I have done to cause this problem?
What could possibly ...
I'm supporting a legacy app written in MFC/C++. The database for the app is in SQL Server 2000. We bolted on some new functionality recently and found that when we change the SQL Provider from SQLOLEDB.1 to SQLNCLI.1 some code that is trying to retrieve data from a table via a stored procedure fails.
The table in question is pretty st...
I'm picking up some experimental code I was messing with in the Windows 7 Beta now that I've installed the RC.
Basically, I'm trying to get IAudioSessionManager2 & IAudioSessionNotification working together to inform my little app of every new audio session created.
Punchline code in AudioListener ( : public IAudioSessionNotification):...
I'm building an application that needs to compile on both Windows and Linux. The application is written in C, almost everything works except the MinGW compiler refuses this
typedef struct somestruct{
...snip...
enum {NODE, REAL} type;
};
somestruct* something;
switch (something->type){
case NODE:
...stuff...;
break;
case ...
There must be something obvious I don't realize about C++ with this one.
load(string & filename){
string command;
char delimiter = '/';
size_t delimiterPos = filename.rfind(delimiter);
string directory = string(filename.c_str(),delimiterPos);
command = "import path ";
//want to add directory to end of command
string temp = co...
How do I convert a CString to const char* in my Unicode MFC application?
...
Below are two common issues resulting in undefined behavior due to the sequence point rules:
a[i] = i++; //has a read and write between sequence points
i = i++; //2 writes between sequence points
What are other things you have encountered with respect to sequence points?
It is really difficult to find out these issues when the comp...
I'm trying to learn OpenGL and improve my C++ skills by going through the Nehe guides, but all of the examples are for Windows and I'm currently on Linux. I don't really have any idea how to get things to work under Linux, and the code on the site that has been ported for Linux has way more code in it that's not explained (so far, the o...
I have just found out that when I search a map like :
std::map<std::string, int> aMap;
the keys I search start to be part of the map. In the case above the values are stored as zeros. In case of pointers it stores the values as 0 valued pointers
I am doing the search with the [] operator, like in :
int a = aMap["some key"];
Ca...