Hi All,
A function that returns a local object is considered undefined. But why does it seem that returning a shared_ptr is ok? Even the boost examples have this:
shared_ptr<X> createX()
{
shared_ptr<X> px(new X_impl);
return px;
}
I have never run into a case where this does not work...
Hi All,
I have a tool that uses PostMessage to automatically click buttons to cancel certain dialogs that pop up on the desktop.
So the tool runs in a loop looking for windows with a certain window text and then clicks a certain button.
It works fine on all dialogs that I have "registered" with...
Hi All,
Does anyone know the proper way to install a Perl module on Linux that loads several shared libraries? For standard libs that comes with Perl, the .so files are in the ${PERL_HOME}/i386-linux-thread-multi/auto directory. Is this where my libs should go also? I do not want to depend on...
Hi All,
Is there any way to catch the exit code from someone calling exit(status) and check the value before the program terminates?
Just for an idea, the code I'm thinking of is something like this:
void exithandler()
{
DWORD exitCode = 0...
Hi All,
Has anyone ever set a global hook with SetWindowsHookEx and tried to "listen" for windows getting focus with any success? I have installed the following callback function for the WH_CBT function type. The hook is installed fine with no errors, but the only code I am getting inside the...
Hi All,
Using JVMTI, is there any way to get access to an object instance, see it's properties, call it's methods, etc. It looks like all the iterate callback functions just give information like, tags, object size, etc., but there seems to be no way to gain access to the object instance...
Hi All,
Can someone kindly tell me what is the proper way to initialize a static member list in C++? I have the following code:
#include <iostream>
#include <vector>
using namespace std;
class Foo
{
public:
Foo();
virtual ~Foo();
static vector<int> ilist;
static void...
Hi All,
I have a .dll that has been built with VS 2003 that has been running for some time now. We have upgraded to 2005 and now all of a sudden there seems to be this dependency on the MFC localization libraries. Where does this dependency come from and how do I get rid of it? The code and...
Hi All,
I have a question regarding creating a dll and static linking against a dependent .LIB. In what cases does the dll need to be compiled and re-linked for it to function correctly during runtime?
1) If the .LIB has been re-compiled and NOTHING has been changed?
2) If the .LIB has been...
Hi All,
Is it possible to create an XPath expression that can return ALL nodes within a document that has an attribute X with a value of Y?
thanks,
Barry
Hi,
Is there an equivalent C++ function to the System.currentTimeMillis() method in Java? I need the time to be recorded in the exact same format and precision.
thank you very much,
Barry
Hello,
In the Java world, when using an Iterator over a container you have to cast the object to it's appropriate type, like this:
ArrayList list = new ArrayList(); //Note this does not use generics from Java 1.5
list.add("Hi");
list.add("Bye");
Iterator it = list.iterator();
while...
Hi,
I know in VC7 there is a Command() function in CFtpConnection that can be used to send commands to the FTP server. Is there any way to easily send commands in VC6? The Command() function does not exist in VC6.
many thanks,
Barry
Hi,
In the DLGITEMTEMPLATE section of Win32 API, there is a list of common controls with a hex value and meaning.
Value Meaning
0x0080 Button
0x0081 Edit
0x0082 Static
0x0083 List box
0x0084 Scroll bar
0x0085 Combo box
When I run this piece of code:
WNDCLASSEX wcx;
ATOM atom;
wcx.cbSize =...
Hi,
In the DLGITEMTEMPLATE section of Win32 API, there is a list of common controls with a hex value and meaning.
Value Meaning
0x0080 Button
0x0081 Edit
0x0082 Static
0x0083 List box
0x0084 Scroll bar
0x0085 Combo box
When I run this piece of code:
WNDCLASSEX wcx;
ATOM atom...
Hello,
I see tons of posts about Class::Struct module but unfortunately none of them help me. I have a series of different instances of structs which are stored in a list. I want to be able to modify an element of a list that is in the struct that is stored in the list. Follow that? I am...
Hello All,
Is it possible to call a private function ( I don't think access modifier matters ) from a message handler function. In particular, I am using OnContextMenu and within this function I want to call another member function to split up some of the logic. But my program crashes every...
Hi All,
I have a function in a dll which returns a const CString. When called from within the dll, it works fine. But, when I call this function from outside the dll, the function returns garbage. And when the dtor is automatically called (when the CString goes out of scope) I get an...
Hi,
I was just wanting to get some feedback from anyone who has used MSXML (any version). The MSDN docs are not really good, but I did find a book on Amazon that may be very useful. If anyone has experience using this COM object from C++, that would be very helpful as that is the language I...
Hi,
I have a crash in my program in user32.dll. I use a function from the Win32 API. I want to know if there is a way to view the source code for this dll using MS VS6 or 7. I traced back to my function call and all pointers look good (obviously not that good), but to really see what is going...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.