I'm thinking of creating an application that can use Firefox as a download manager. Is there any way to control Firefox (add downloads, start/stop downloads, etc) from an external program in C/C++?
If that is not possible, then perhaps an extension that can do that? If an extension is the only way, then how do I communicate with the ext...
hello,
i've just started learning winapis and c++ programming ..
i was thinking about starting a personal project (to enhance my coding, and to help me understand the winapis better)..
and i've decided to program a "cmd" files renamer, that basically takes :
1)a path
2)a keyword
3)the desiered formate
4)versioned or not (or numbere...
So I have this 2d dynamic array which content I want to free when I am done with it. However I keep running into a heap corruption after the destructor. The code works fine (of course with memory leaks) if I comment out the destructor. (Visual Studio 2005)
FrameData::FrameData(int width, int height)
{
width_ = width;
height_ = h...
I want to assign a copy of a boost::multi_array. How can I do this. The object where I want to assign it to has been initialized with the default constructors.
This code does not work, because the dimensions and size are not the same
class Field {
boost::multi_array<char, 2> m_f;
void set_f(boost::multi_array<short, 2> &f) {
m...
Is there a straight forward way to do it?
I'm stuck here:
#include <iostream>
#include <vector>
#include <cstdlib>
using std::size_t;
using std::vector;
int main()
{
vector<vector<int> > Matrix;
//Create the 2x2 matrix.
size_t rows = 2;
size_t cols = 2;
// 1: set the number of rows.
Matrix.resize(rows);
for(size_t...
I have been told be a couple of tools that the following code is leaking memory, but we can't for the life of us see where:
HRESULT CDatabaseValues::GetCStringField(ADODB::_RecordsetPtr& aRecordset, CString& strFieldValue,
const char* strFieldName, const bool& bNullAllowed)
{
HRESULT hr = E_FAIL;
try
{
CO...
Hi,
I have implemented a file selector with a combobox. I want to write the selected filename to a log. The problem is that when I select a file from the original directory it goes well but when I choose a file from another directory it won't work. Can anybody help with this? Here is the code for the file selector, it is inside a dialog...
I recently got thinking about alignment... It's something that we don't ordinarily have to consider, but I've realized that some processors require objects to be aligned along 4-byte boundaries. What exactly does this mean, and which specific systems have alignment requirements?
Suppose I have an arbitrary pointer:
unsigned char* ptr...
So the idea is to sort a large STRUCTURE using an element of that structure, for arguments sake Zip Code.
To keep it simple lets pretend that there are two arrays, one integer containing the zip codes and two, a larger structure (3k Bytes) array.
Sorting the integer array is suitably fast with Quick Sort, but tagging the Structure arr...
I'm using the newest Qt 4.5 and I'm creating my GUI with Qt Creator. My tab widget looks fine in the Creator, with all icons displayed. However, when I compile it and run it, there are no icons, but the tabs are wider than they are which indicates something, obviously. I tried both .png and .ico formats, none work. The size of icons is 1...
What is the win32 function to check whether a shutdown is initiated or not?
EDIT: I need to check that inside a windows service (COM). How to do that?
...
As you might know, Microsoft recently deployed a security update for Visual Studio: KB971090.
Among other things, this updated the Visual C Runtime DLL from version 8.0.50727.762 to 8.0.50727.4053.
So after this update, everything I compile that uses the runtime dynamically linked, gets their dependencies updated to the new runtime.
O...
I need to check if a process with a given HANDLE is still runnning, I tried to do it using the following code however it always returns at the second return false, even if the process is running.
bool isProcessRunning(HANDLE process)
{
if(process == INVALID_HANDLE_VALUE)return false;
DWORD exitCode;
if(GetExitCodeProcess(pr...
When i use bison & flex with vc6, i got got below errors
lex.yy.c(395) : error C2146: syntax error : missing ';' before identifier 'YY_PROTO'
lex.yy.c(395) : fatal error C1004: unexpected end of file found
what would be the cause for this??
please help.
Copied from Comment:
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" in...
In both Microsoft VC2005 and g++ compilers, the following results in an error:
On win32 VC2005: *sizeof(wchar_t) is 2*
wchar_t *foo = 0;
static_cast<unsigned short *>(foo);
Results in
error C2440: 'static_cast' : cannot convert from 'wchar_t *' to 'unsigned short *' ...
On Mac OS X or Linux g++: *sizeof(wchar_t) is 4*
wchar_t *fo...
What is the difference between the dot (.) operator and -> in C++?
...
How to measure amount of time given by a mutex to the OS? The main goal is to detect a mutex, that blocks threads for largest amount of time.
PS: I tried oprofile. It reports 30% of time spent inside vmlinux/.poll_idle. This is unexpected, because the app is designed to take 100% of its core. Therefore, I'm suspecting, that the time is ...
Hello,
I have an error in compiling a project.
I'm trying to link to a library I have on windows, using visual studio.
When trying to create the obkect (with new), I get the following error:
Error 2 error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (??1?$basi...
As you might be aware an update to visual studio 2005 was auto updated on most machines last week. This update included a new version of the visual c runtime library. As a result any binaries built after the update also require a new redistributable installed on client systems.
See http://support.microsoft.com/kb/971090/
And here is ...
I have a MFC MDI application that I've recently ported from VS2003 to VS2008, and at the same time moved from Stingray Objective Studio 2006 v2 to v10.1. On the previous versions of my application, if I had more than one view open, the Window menu would be populated by an enumerated list of available views, e.g. 1 MyViewA, 2 MyViewB etc...