I have a file that looks like this:
namespace myName
{
typedef HRESULT (*PFN_HANDLE)(myName::myStruct);
class MyClass{
//...
public:
BOOL RegisterCallback (PFN_HANDLE foo);
//...
};
struct myStruct{
//...
};
}
But I am getting a compile error 'myStruct' is not a member of 'myName'. Can anyone tell me what is go...
Do you know of a precise and concise online C++ syntax reference?
Please provide the link...
...
I am looking for a free memory debugger for Windows, suited for debugging C++ applications built with VC, with similiar functionality to Insure++ or Purify.
Any recomendations?
GUI is a plus
Integration with VS is a bigger plus
...
I'm the kind of dork who enjoys reading source code in his spare time. I'm also the kind of dork who has an iPhone. What is the best way to read and browse code on such a device?
My initial thought is to use something like LXR to generate hyperlinked pages, and upload them to my personal server, but I am interested in better/easier ways...
There's nothing fancy going on in this program, but I get garbage output. Here are the header files I'm including, in case that's relevant.
#include <cstdlib>
#include <iostream>
#include <windows.h>
#include <vector>
#include <string>
#include <sstream>
And I'm using Visual Studio 2008 on Windows XP.
Note that if I print the strin...
When declaring primitives does it matter if I use the assignment operator or copy constructor?
Which one gives the optimal performance, or do most compilers today compile these two statements to the same machine code?
int i = 1;
int j( 1 );
...
Typically for my templated classes, I include declarations in a .hpp file and templated implementation code in a .t.hpp file. I explicitly instantiate the class in a .cpp file:
template class MyClass< AnotherClass >;
whose object code gets put in a library.
The problem is that if I try to print the object with operator<<, which is de...
Hi,
While running, my program often stops because of a SIGTRAP. I know, that a SIGTRAP is happening when the compiler finds a breakpoint in the program. But i don't have any breakpoint in my code. (To be sure about it, before the execution, i cleared all the breakpoints..).
I'm using Code::Blocks..
Thanks !
...
In Visual Studio I generated a plain old Win32 application and stripped all the resources and generated code so that my application consists of this:
#include "stdafx.h"
#include "IcoTest.h"
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int ...
I'm trying to create Jump list on windows 7 for my application using Delphi.
I found this c++ code, but I'm not sure how to translate it to Delphi, any help?
void CreateJumpList()
{
ICustomDestinationList *pcdl;
HRESULT hr = CoCreateInstance
(CLSID_DestinationList, ...
From Schaums C++ text
Removal of goto- says use a flag
code segment:
const int N2 = 5;
int i, j, k;
for (i = 0; i < N2; i++)
{ for (j = 0; j < N2; j++)
{ for (k = 0; k < N2; k++)
if (i + j + k > N2)
goto esc;
else
cout << i + j + k << " ";
cout << "* ";
}
esc: cout << "." << e...
Does anyone know where I can get an digital copy of the C++ standard for download? My google-fu does not appear to be strong enough.
...
Last question for today all...I will get back with tomorrow..I have a lot to follow up on...
I am looking in Reilly Java text- talking about counter controlled loop patterns..(does not matter what language..)
The author for counter controlled loops (for, while, etc) and with nesting loops...uses the != for test...Now I realize != is us...
I have an object that requires a slightly different construction wether it's instance is staticly or dynamically allocated.
The object should only have a single default constructor. So having two constructors, one for each case, and having the user explicitly select the proper constructor is out of the question.
Is there any proper way ...
I'm currently working on a project that does a lot of HTTP requests for data that it needs. It works by writing all the data into a buffer, then returning that buffer to the caller. It seems that waiting for the entire file to download data that can essentially streamed is a bad idea.
Question 1: Is there already a library / public code...
Hi,
I'm sure this is a really simple question. The following code shows what I'm trying to do:
class MemberClass {
public:
MemberClass(int abc){ }
};
class MyClass {
public:
MemberClass m_class;
MyClass(int xyz) {
if(xyz == 42)
m_class = MemberClass(12);
else
m_class = MemberClass(32...
I have a class like
class K {
static int a;
static int b;
}
I would like to create a shared library (dll) containing this class K. In a cpp file compliled in the library I call
int K::a = 0;
int K::b = 0;
to instantiate the static variables. The dll does compile without errors, but when I use the library, I get the unresolved e...
Let's say I have a CString variable carrying the string "Bob Evans". I want to copy from position 4 until the end of the original CString to a new CString, but I am having trouble finding semantics examples for this:
CString original("Bob Evans");
// Below is what I'm trying to do
// CString newStr = original.copy(4, original.GetLength(...
I thought this question would have been asked before, but I couldn't find it here...
I've used SWIG to create a JNI wrapper around a C++ class. All works great except that Java never seems to call the class's finalize(), so, in turn, my class's destructor never gets called. The class's destructor does some final file I/O, so unfortunate...
Visual studio is giving the error PRJ0019: A tool returned an error code from "Copying DLL...". The console window includes the output: 'CopyDLL.cmd' is not recognized as an internal or external command.
Here is some background as to why I don't know about the tool which is copying. Someone left the company a year ago and forgot to chec...