Search:

Type: Posts; User: tjb

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    4,877

    If this is for logging onto services that you do...

    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...
  2. Replies
    5
    Views
    2,795

    I'm not an expert on C++/CLI, but I would imagine...

    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...
  3. boost::shared_ptr has a copy constructor and...

    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...
  4. Replies
    8
    Views
    2,258

    Here's a quick comparison of the different ways...

    Here's a quick comparison of the different ways of scaling the output of rand()




    #include <stdio.h>
    #include <stdlib.h>

    int main()
    {
  5. Replies
    8
    Views
    2,258

    If you're using the % modulus operator to range...

    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...
  6. Replies
    7
    Views
    1,915

    I think it might work better to have a...

    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...
  7. Well, you could possibly get around not having...

    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...
  8. I downloaded FreeCommander to play with it, and I...

    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...
  9. Replies
    6
    Views
    8,140

    You can find currently defined symbols in the...

    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.
  10. Replies
    1
    Views
    2,648

    Shouldn't that be: ...

    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...
  11. Thread: Window menu Probem

    by tjb
    Replies
    5
    Views
    1,500

    Do you mean that you want it to do something...

    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...
  12. WM_CLOSE should work for most situations. It is...

    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...
  13. Replies
    6
    Views
    1,641

    Another approach could be to implement a linked...

    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...
  14. Replies
    4
    Views
    1,063

    Try initializing pStart. That it's working when...

    Try initializing pStart. That it's working when it's a stack variable... I think you're just getting lucky.
  15. Replies
    3
    Views
    3,236

    You're calling CreateWindowW, not CreateWindowA,...

    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...
  16. Replies
    2
    Views
    8,361

    Is C++/CLI an option?

    Is C++/CLI an option?
  17. Replies
    11
    Views
    21,939

    If the loop bodies are small, then a goto may be...

    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:;
  18. Replies
    6
    Views
    1,465

    The concepts make compiler errors friendlier, but...

    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...
  19. Replies
    6
    Views
    27,315

    I usually create an abstract class of sorts, and...

    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...
  20. Replies
    8
    Views
    1,998

    Error_code Stack::top(Stack_entry &item) const...

    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
    ...
  21. Thread: compare question

    by tjb
    Replies
    4
    Views
    1,027

    % is the modulus operator. It gives one the...

    % 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...
  22. Thread: compare question

    by tjb
    Replies
    4
    Views
    1,027

    Well, there are probably several ways to...

    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...
  23. Thread: Sort pointers

    by tjb
    Replies
    6
    Views
    1,319

    Sorting pointers, as in, taking in a set of...

    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...
  24. Replies
    3
    Views
    61,631

    That's what I meant by "it works". I was unable...

    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).
  25. Replies
    3
    Views
    61,631

    I haven't been able to find the issue with this...

    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):


    ...
Results 1 to 25 of 31
Page 1 of 2 1 2