If this is for logging onto services that you do not control (meaning, you need compatibility with existing systems), the only way to store the information in a somewhat secure fashion is to use a...
Type: Posts; User: tjb
If this is for logging onto services that you do not control (meaning, you need compatibility with existing systems), the only way to store the information in a somewhat secure fashion is to use a...
I'm not an expert on C++/CLI, but I would imagine that the way you would do it is similar to the way you would convert a .NET string to a byte array. System::Text::ASCIIEncoding::GetBytes may be a...
boost::shared_ptr has a copy constructor and operator= that are template members and is designed to allow copying a shared_ptr<T> to a shared_ptr<U>, where T* is static_cast'able to U*. The...
Here's a quick comparison of the different ways of scaling the output of rand()
#include <stdio.h>
#include <stdlib.h>
int main()
{
If you're using the % modulus operator to range your random numbers from rand, then this would be the issue. Why?
Suppose that the distribution from rand() is completely uniform from 0 to...
I think it might work better to have a bidirectional protocol. In that case, it would happen something like:
>>> send quit command.
<<< receive quit acknowledgment.
Wait 5 seconds.
>>> send...
Well, you could possibly get around not having the SDK by manually defining these. Most GUID's are defined in libuuid.a in MinGW, but since those headers aren't from the mingw win32api, they...
I downloaded FreeCommander to play with it, and I noticed that there were several hidden top-level windows associated with it. I don't know if you're using Visual Studio, but there's a program that...
You can find currently defined symbols in the kernel by reading /proc/kallsyms. You might be able to match up the two (the contents of the objdump output) with a little perl or the shell.
Shouldn't that be:
Microsoft::Win32::RegistryKey^ ChecksubKey = Microsoft::Win32::Registry::ClassesRoot->OpenSubKey("This\\That");
I don't program in C++/CLI, so I could be wrong, but it seems...
Do you mean that you want it to do something asynchronously? In the background? I notice that you have a for(;;) in your do_stuff function. In that case, multithreading would be the easiest way to...
WM_CLOSE should work for most situations. It is the equivalent of clicking on the close button (clicking the close button sends the WM_CLOSE message to the window). You should only send WM_CLOSE to...
Another approach could be to implement a linked list, providing an unmanaged interface to manipulate and query the list, and to add each item found in the tree to the list.
Yet another approach...
Try initializing pStart. That it's working when it's a stack variable... I think you're just getting lucky.
You're calling CreateWindowW, not CreateWindowA, so your class name parameter should be L"MyClass" (note the L prefix), not "MyClass". Also, although it may not be an issue depending on exactly how...
Is C++/CLI an option?
If the loop bodies are small, then a goto may be appropriate...
for(int x = 0; x < w; x++) {
for(int y = 0; y < h; y++) {
if(something(x, y)) goto end;
}
}
end:;
The concepts make compiler errors friendlier, but any call to a nonexistent method will cause the compile to fail. I suppose one way of creating a better message (with pre c++0x compilers) could be...
I usually create an abstract class of sorts, and each thread that I create inherits from that class. Since a thread is implemented via a subclass, having to pass parameters directly to the thread...
Error_code Stack::top(Stack_entry &item) const
/*Pre: None
Post: If the Stack is not empty, the top of the Stack is returned
in item. If the Stack is empty an Error_code of underflow is
...
% is the modulus operator. It gives one the remainder of the division of the two operands. So 5 divides 5 with a remainder of 0, as it does 10, 15, 20, and so on.
Exactly. In the brackets...
Well, there are probably several ways to accomplish such, though none nearly as convenient as what you're trying to do.
By the way, you don't even need such a method for what you're trying to...
Sorting pointers, as in, taking in a set of values, placing them in an array, having an array of pointers that point to them, and instead of sorting the original array, sorting the array of pointers...
That's what I meant by "it works". I was unable to get the program to print out anything other than zero for the number of reads in progress from the write thread (under Cygwin though).
I haven't been able to find the issue with this code. It works fine for me (though under Cygwin).
Here's a version that uses one semaphore (I think it's a little bit easier to analyze):
...