I created a very simple GUI that has a push button and a "Graphics View" widget from Display Widgets. On pushing the button I want a line to be drawn across the "Graphics View" widget. I have changed the name of the "Graphics View" widget to gv by right-clicking the widget in design view and then selecting change objectName. I am not abl...
I haven't done work in C/C++ for a little bit and was just wondering if any one can help me with porting this .Net C# code into C++ using Boost library (Boost.Asio)
So I have one function:
private const int bufferSize = 8192;
/// <summary>
/// The entry point of the application.
/// </summary>
/// <param name="args">The input argumen...
Would it be possible in C++ to create a custom allocator that works simply like this:
{
// Limit memory to 1024 KB
ScopedMemoryPool memoryPool(1024 * 1024);
// From here on all heap allocations ('new', 'malloc', ...) take memory from the pool.
// If the pool is depleted these calls result in an exception being thrown.
...
Hi all,
I have a Windows service that is written in C++ using VS2008. I now want to debug that service remotely on my Windows Server 2008R2. But when I start the service I get an application error saying:
Faulting application name: MyService.exe, version: 1.99.96.0, time stamp: 0x4c87cf49
Faulting module name: MSVCR90.dll, version:...
Looking at MSDN documentaion for GetTokenInformation() and the Getting the Logon SID example, GetTokenInformation() needs to be called twice. The first call is to get the buffer size.
So, buffer size of what? Just say I use TokenUser as its second parameter, I see that the dwReturnLength returned by first call is not the size of TOKEN_U...
Hi,
I want to create a crop function in an existing engine. This is what I already have:
bool Bitmap::Crop(RECT cropArea)
{
BITMAP bm;
GetObject(m_Handle, sizeof(bm), &bm);
HDC hSrc = CreateCompatibleDC(NULL);
SelectObject(hSrc, m_Handle);
HDC hNew = CreateCompatibleDC(NULL);
HBITMAP hBmp = CreateCompatibleBitmap(hNew, bm.bmWidth, bm...
I was under the impression that the Cocos2D game framework was just for the iPhone. Now I see that they have a separate project supporting OS/X, Linux, and Windows.
It isn't immediately obvious from their web site what languages are options for developing with the framework on these various platforms.
There is an installation requirem...
The documentation for CFindFile states that
Nonzero if there are more files; zero
if the file found is the last one in
the directory or if an error occurred.
To get extended error information,
call the Win32 function GetLastError.
If the file found is the last file in
the directory, or if no matching files
can be found,...
**I've gotten a few suggestions to make my function pure generic, which would work, but I'd prefer limiting the function to only accept Base and its children.
Having trouble making a function that can accept arguments of a variadic template class base type, while the function will actually be called with classes that derive from Base. ...
In here is declaration of deallocate mem. of allocator class. My question is what for is second argument in this declaration? If this function calls operator delete(_Ptr) this argument is unused so what's for is it there?
Thanks.
Excerpt from MSDN:
Frees a specified number of objects from storage beginning at a specified position.
voi...
I wrote a piece of code and used map and vector but it shows me something I can't get. I'll be thankful if someone help me in this way and correct my code or give me some hints.
The code is:
// For each node in N, calculate the reachability, i.e., the
// number of nodes in N2 which are not yet covered by at
// least o...
Hi, Im trying to do a screen-flashing application, that flashes the screen according to the music(which will be frequencies, such as healing frequencies, etc...).
I already made the player and know how will I make the screen flash, but I need to make the screen flash super fast according to the music, for example if the music speeds up, ...
I asked a question earlier today about singletons, and I'm having some difficulties understanding some errors I encountered. I have the following code:
Timing.h
class Timing {
public:
static Timing *GetInstance();
private:
Timing();
static Timing *_singleInstance;
};
Timing.cpp
#include "Timing.h"
static Timing *Timi...
I'm developing a screencasting utility in C++.
It basically captures desktop frames and creates an AVI file. The algorithm is as follows:
Create a thread: this->m_hThread=CreateThread(NULL,0,thScreenCapture,this,0,NULL);
Capture desktop in thScreenCapture n times per second (like 5 fps).
obj->Capture();
In Capture(), append the bitm...
I was asked this during an interview and apparently it's an easy question but it wasn't and still isn't obvious to me.
Given a string, count all the words in it. Doesn't matter if they are repeated. Just the total count like in a text files word count. Words are anything separated by a space and punctuation doesn't matter, as long as it...
Hello!
As far as I understand, there is no serialization (boost::serialization, actually) support for boost::any placeholder.
Does someone know if there is a way to serialize a custom boost::any entity?
The problem here is obvious: boost::any uses template-based placeholders to store objects and typeid to check if boost::any_cast is a...
First of all, I'd like to point out that I have no experience using Mono.NET, so bear with me if the questions are silly.
I'm working on an application that is written in native C++ code and works in Windows (VS2008) and Linux/Mac (gcc). There is a library that I am looking to integrate with, which is currently compiled in MS.NET (versi...
im learning to make things to other windows like resize the ie or any type of window. the only problem i don't know how i can get or give messages to other windows.
so like i pressed a key in ie i would like to get that message to my program too!
any idea
...
Possible Duplicate:
Why are C character literals ints instead of chars?
Why when using C does sizeof('x') return 4 but sizeof('x') in C++ returns 1?
C++ normally strives to be nothing more than a superset of C so why do the two results diverge?
Edit
Just some further clarification. This seems like a deliberate move on the p...
i wanna make a program runs in the background and shows an icon in tray bar.
I'm using win32. What api should i use? Do you know any good tutorials?
...