Hi!
I am using WaitForSingleObject from (kernel32.dll) in my program.
It is working fine on 32bit Windows XP, but when I use it on 64bit WindowsXP, it is not working.
The problem is that it doesn't wait for the process and control moves forward.
Does anyone have any idea on why?
Is there any replacement for that method in WinXP 6...
I am trying to debug c++ code using Eclipse Galileo on my MacBook Pro running Leopard. It's my first time trying this. I have a complicated c++ program I'd like to debug, but to test things out, I just tried to debug and step through the following:
#include <iostream>
using namespace std;
int main()
{
int x = 0;
cout << x << endl;
...
There was an article i found long ago (i cant find it ATM) which states reasons why the new keyword in C++ is bad. I cant remember all of the reasons but the two i remember most is you must match new with delete, new[] with delete[] and you cannot use #define with new as you could with malloc.
I am designing a language so i like to ask ...
So I'm making something in openGL using SDL. I'm about to take a long flight, and I can't seem to get the project to work on my laptop. I've used SDL on my laptop before, so I'm left thinking it is openGL's fault. The laptop is on win xp pro, and has an intel 945 graphics "card." I've tried updating the drivers, but to no avail. The imag...
I already spent whole day to trouble shoot this problem, but no luck yet. In my project, I set the Use of ATL property to Static Link to ATL on the General property page and set the Runtime Library property to Multi-threaded (/MT) on the Code Generation property page (C/C++ folder). However DependencyWalker still shows Atl71.dll dependen...
I am using letter_regcog example from OpenCV, it used dataset from UCI which have structure like this:
Attribute Information:
1. lettr capital letter (26 values from A to Z)
2. x-box horizontal position of box (integer)
3. y-box vertical position of box (integer)
4. width width of box (integer)
5. high heigh...
In the example code
void foo()
{
static Bar b;
...
}
compiled with GCC is it guaranteed that b will be created and initialized in a thread-safe manner ?
In gcc's man page, found the -fno-threadsafe-statics command line option:
Do not emit the extra code to use the
routines specified in the C++ ABI for
thread-safe initiali...
I have run in to this problem of converting a C++/CLI pointer to a native C++ pointer. Heres the background:
I'm writing a windows forms application using C++/CLI. The application makes call into a number of COM Interfaces. When creating an instance (inside of a C++/CLR class) of a object through the COM interface, i pass in (void**)(&pr...
Hi,
I am trying to get showstate of a window.
I know that I can maximize, minimize, or close a window by ShowWindow API in c# or c++. How do I get ShowState of a window?
...
Consider the following two statements:
namespace foo = bar;
and
namespace foo {
using namespace bar;
}
Are those two statements equivalent, or are there some subtle differences I'm not aware of?
(Please note that this is not a question about coding style - I'm just interested in C++ parsing).
...
Hi,
I'm working on some C++ code and I've run into a question which has been nagging me for a while... Assuming I'm compiling with GCC on a Linux host for an ELF target, where are global static constructors and destructors called?
I've heard there's a function _init in crtbegin.o, and a function _fini in crtend.o. Are these called by c...
Of course, warning must be treated, but why is VC++ C4150 (deletion of pointer to incomplete type) only a warning?
...
Inline functions are just a request to compilers that insert the complete body of the inline function in every place in the code where that function is used.
But how the compiler decides whether it should insert it or not? Which algorithm/mechanism it uses to decide?
Thanks,
Naveen
...
UPDATE: I managed to re-work my code from scratch, and here is what I came up with. It works, but the only problem is speed. Is there any way that I can speed up my current set up using better memory management? If so, what would be the best approach?
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
void pri...
A sort of follow up/related question to this.
I'm trying to get a grip on a large code base that has hundreds and hundreds of classes and a large inheritance hierarchy. I want to be able to see the "main veins" of the inheritance hierarchy at a glance - not all the "peripheral" classes that only do some very specific / specialized thin...
Environment : Visual Studio 2008 , wxWidgets 2.8.10 , Vista 64
Code
header.h
#include <wx/wx.h>
class CSend
{
CSend(wxString& name = "");
~CSend();
};
main.cpp
#include "header.h"
void main()
{
CSend dlg(wxString("Hi"));
}
When I compile this program I get the following error
error C2440: 'default argument' : cann...
Using Qt, I'm attempting to read the contents of the stdin stream in a non-blocking fashion. I'm using the QSocketNotifier to alert me when the socket has recieved some new data. The setup for the notifier looks like this:
QSocketNotifier *pNot = new QSocketNotifier(STDIN_FILENO, QSocketNotifier::Read, this);
connect(pNot, SIGNAL(activa...
When I start debugging my IE7 BHO, I often have a strange case where IE 'hangs' and doesn't load its homepage for at least 3min (and probably never). IE itself is responsive (menus, min/max, close etc.) but even attempting to navigate also gives infinite load times.
This happens in debug mode via VS2008, but not in release mode when the...
I have a simple struct :
struct MyType
{
std::string name;
std::string description;
}
and I'm putting it in a shared memory :
managed_shared_memory sharedMemory(open_or_create, "name", 65535);
MyType* pType = sharedMemory.construct<MyType>("myType")();
// ... setting pType members ...
If the two applications communicating w...
We're a small dev team working with some GLSL that may be too large for older graphics cards to compile. We want to display a sensible error message to the user (rather than just dump the info log or output a generic 'this shader didn't work' type of message) when this happens based on the type of error.
The question is, ATI and nVidia...