I switched from Visual Studio to Code::Blocks yesterday, and just had some strange compiler error messages.
I included windows.h and i can use all the API calls just fine, such as creating window classes and creating windows / buttons and stuff. But when I tried to send some keypresses with SendInput(), I got error messages on these two...
Hi,
I am trying to wrap up some data from an array of BYTES into a VARIANT but I can't seem to free the data:
When I run this code...
SAFEARRAY * NewSArray;
SAFEARRAYBOUND aDim[1]; // a one dimensional array
aDim[0].lLbound = 0; //Sets the index to start from 0
//Sets the number of elements (bytes) that will go into the SAFEARRAY
aD...
Hello,
I have an executable that I need to run some tests on in C++ - and the testing is going to take place on all of Windows, Linux and Mac OSes.
I was hoping for input on:
How would I interface with the previously built executable from my code? Is there some kind of command functionality that I can use? Also, since I think the c...
Hi, I currently migrating from 32-bit to 64-bit am encountering a "LNK1223: invalid or corrupt file: file contains invalid .pdata contributions" when attempting to build a 64-bit managed C++ dll that links to an unmanaged C++ .lib file that I also built.
So far, I have found that this error should only occur while building for RISC mach...
Hello.
How do you 'de-serialize' a derived class from serialized data? Or maybe I should say, is there a better way to 'de-serialize' data into derived classes?
For example, suppose you had a pure virtual base class (B) that is inherited by three other classes, X, Y and Z. Moreover, we have a method, serialize(), that will translate X:...
I have code that looks like this:
extern "C" __declspec(dllexport) myInterface(int id, void** pFunction)
{
...
}
I need to make the void** pFunction argument point to a function so that the caller can use this function via the pFunction pointer. This function gets called through a DLL, I don't want to do it this way but for a lot ...
I'm in the planning stage of a relatively large (10k+ lines) project with several classes (30+) and several levels of class inheritance (5+).
What is the best (or most conventional) way to lay out my project in terms of file and folder structure?
Should I have one file per class? Should I have one folder per inheritance branch?
Should...
I have an implementation for printing out enum values in c++
If I put all the code in a .h file, everything works nicely. If I separate out the function implementation into .cpp files, I get a linker error.
Here is my main file
#include <iostream>
#include <vector>
#include "Day.h"
using namespace std;
int main(){
initializeDayN...
I'm making a vector drawing application. I use this algorithm to generate outlines.
This algorthm works well, except it does not close the outline as seen here:
I'm not sure what I should do to ensure that it always closes the outline. I tried inserting the last vertex at position[0] in the std::vector but this did not help.
DOUBLEPO...
Hey,
I'm trying to experiment with 2D physics engines in C++. So far, it seems the most popular is Box2D. Unfortunately, Box2D is a rigid body physics engine and that's not really going to help me with what I want to try.
I want to be able to define a shape which has a number of vertices joined by springs, such that when this shape col...
I am trying to retrieve some values from the registry.
Here is the full path:
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes]
"ThemeChangesMousePointers"=0x00000001 (1)
And here is my code:
HKEY hKey;
DWORD dwDisp = REG_DWORD;
DWORD dwType;
DWORD dwSize = sizeof(DWORD);
DWORD dwValue = 0;
DWORD dwReturn;
char buffe...
I know this is pretty basic but I've kind of been guessing up to this point.
Foo is just an object with private inheritance from the string class which is why I cast it. Using examples from Primer C++ (Prata's)
So if I have a function like:
istream & operator>>(istream & is, Foo & f)
{
is >> (string &)f;
return is;
}
int ...
This "simple" issue seems to be fraught with side issues.
eg. Does the new process open multiple windows; Does it have a splash screen?
Is there a simple way? (I'm starting a new instance of Notepad++)
...
std::tstring tstrNotepad_exe = tstrProgramFiles + _T("\\Notepad++\\notepad++.exe");
SHELLEXECUTEINFO SEI={0};
sei.cbSize ...
I use the following algorithm to generate polygon outlines:
void OGLSHAPE::GenerateLinePoly(std::vector<DOUBLEPOINT> &input, int width)
{
OutlineVec.clear();
if(input.size() < 2)
{
return;
}
if(connected)
{
input.push_back(input[0]);
input.push_back(input[1]);
}
float w = width...
I wasn't completely sure how to phrase what I wanted to ask in the title so I'll try to clarify it better in what follows.
For C++ software library developers, what abstract interfaces do you find yourselves rewriting often between projects/jobs? For instance, I would imagine that it is fairly common practice for different projects to ...
I ran across some very interesting code that makes me wonder about what bool is. I've always considered it to be a primitive type, like int or char or long. But today, I saw something that looked like this:
void boolPtrTest()
{
bool thisBool = true;
boolPtrHere(thisBool);
printf("thisBool is %s\n", thisBool ? "true" : "fal...
template<class T>
void huffman(MinHeap<TreeNode<T>*> heap, int n)
{
for(int i=0;i<n-1;i++)
{
TreeNode<T> *first = heap.pop();
TreeNode<T> *second = heap.pop();
TreeNode<T> *bt = new BinaryTreeNode<T>(first, second, first.data, second.data);
heap.push(bt);
}
}
In my Funda...
There are plenty of guides out there which help you mimic VS2008's "Custom Build Step" in VS2010 with MSBuild. However, I'd like my build to be smarter and make use of MSBuild. I've written a little MSBuild task which invokes the ANTLR parser generator. That build task works flawlessly when I run it in a simple test MSBuild file. However...
Lets say for example I have the following 2 vectors:
*B
*A
The vector I would want would be C
*C *B
*A
What I'm trying to do is generate square outlines. I use 2d slurp: where v0 would be A and v2 would be B. Right now I use sslerp2D to make round edges but I also want regular square edges hence why I want to...
I found this tutorial about ffmpeg the thing i do not get is how to encode video.
can any one, please provide a tutorial.. with explanations for that? (not that i dont get this official one but i'd love to see more comments)
...