CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Richard.J

Page 1 of 47 1 2 3 4

Search: Search took 0.50 seconds.

  1. Replies
    22
    Views
    684

    Re: __cplusplus number

    An entry like this should work in a .props file:
    <ItemDefinitionGroup>
    <ClCompile>
    <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
    </ClCompile>
    ...
  2. Replies
    4
    Views
    1,148

    Re: Catching OS exceptions

    The second link in 2kaud's post #2 seems to imply that /EHa might be what you are looking for. I don't have experience with this, either.
  3. Replies
    3
    Views
    563

    Re: :: operator new()

    https://en.cppreference.com/w/cpp/memory/new/operator_new
    section "Class-specific overloads":
    "If defined, these allocation functions are called by new-expressions to allocate memory for single...
  4. Replies
    4
    Views
    947

    Re: Strange problem with Windows Sockets

    Not sure what inet_addr makes with leading zeros, but maybe that is a problem? As Victor's example shows, ping takes leading zeros as indication of a number in octal format.
  5. Re: Strange '_JustMyCode_Default' error with VS2019

    We are using hippomock for our unit testing, and we had to set this property to "yes" on a Windows Server 2016 or our Windows API mocks weren't called. No-one figured out why.
  6. Thread: libiconv

    by Richard.J
    Replies
    6
    Views
    1,363

    Re: libiconv

    Does this help?
    http://www.gnu.org/software/libiconv
  7. Replies
    8
    Views
    2,993

    Re: map name does not name a type error

    Most likely, you cannot add elements to the map outside any function, i.e. in the global scope.
    However, something like this should work:


    map<string, unsigned int> electron_lookup{
    {"C",...
  8. Re: How to iterate over a vector of many stucts

    If you want to stick to the iterator approach:


    for (BriteNodeInfoList::iterator it = m_briteNodeInfoList.begin(), endIt = m_briteNodeInfoList.End(); it != endIt; ++it)
    {
    os << it->nodeId...
  9. Replies
    11
    Views
    2,673

    Re: How smart is the compiler?

    I don't think that any of the proposed solutions are really readable.
    What about the use of exceptions? If any of the operations throw an exception in the case of an error, the calling function...
  10. Replies
    1
    Views
    3,793

    Re: boost thread pool execution

    Not sure about the thread pool functionality, but I assume your main() functions returns before any of the threads had a chance to execute.
  11. Replies
    2
    Views
    2,545

    Re: Need help with undefined reference

    You have forward declared and are using a function binarySearch with 3 parameters, but the definition of the method in your code has 5 parameters. Thus the error message.
  12. Re: Allocating and copying memory in one go...

    John, did you consider realloc?
  13. Re: Forcing a socket to die so it can be reopened

    After creating the socket, use setsockopt with SO_REUSEADDR


    int enable = 1;
    setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int));
  14. Replies
    12
    Views
    1,724

    Re: File Extension ".S"

    Does this link help?
    https://msdn.microsoft.com/de-de/library/afzk3475.aspx
  15. Thread: find_if

    by Richard.J
    Replies
    2
    Views
    2,725

    Re: find_if

    The find_if algorithm iterates over the elements of the container. In your case, the container is map<TDummyKey,TDummy>, and each element in the container is a pair<const TDummyKey, TDummy>.
    Your...
  16. Re: Socket Programming -- Sending image and received notice.

    I assume your server is not listening on port 50007, since you #define'd SERVER_PORT htons(50007).
    You can verify this by using TcpView (or netstat) and check what port your server is listening on....
  17. Re: How to create a function for storing object in map?

    A common index to be used in different kinds of maps seems odd to me. In addition, your Create method must take a M& to work correctly (like in laserlight's example).
    Apart from that, I am not sure...
  18. Re: How to create a function for storing object in map?

    All you need is the correct definition of your Create method


    void Create(std::map& map, const Account& object) const

    This assumes that Create does not modify the object passed into it and...
  19. Re: C Question: I want to convert an int to string of size n and pad with 0's.

    Look up for the '*' in the format string, like


    sprintf(str, "%0*d", 8, i);

    (not tested, though). This should make you able to replace the hard-coded 8 by a variable.
  20. Replies
    7
    Views
    3,359

    Re: Linker error with pure virtual function.

    The linker expects both classes to be defined in the namespace 'serial'. From the code you posted, it's not clear if you really defined the classes in this namespace.
  21. Replies
    2
    Views
    743

    Re: problem implementing 'type erasure'

    Well, I know a bit about virtual destructors. What I don't understand is how a class that wraps an iterator influences the destruction of the map. How are these things related?
  22. Replies
    2
    Views
    743

    problem implementing 'type erasure'

    I am playing around with 'type erasure' (see these links: https://akrzemi1.wordpress.com/2013/11/18/type-erasure-part-i/, http://www.artima.com/cppsource/type_erasure2.html).
    For this purpose, I...
  23. Re: Finding the nth prime number in fibonacci sequence

    The first thing I can spot is that both of your for-loops only end when the loop variable overflows, i.e. primecount is alsways <= 8 until it wraps from -2147483648 to 2147483647 and vice versa for...
  24. Replies
    5
    Views
    856

    Re: Destructor for a pointer in class

    Well, if you just use the pointer to store a reference to the 'parent' class, you must not delete it. Otherwise, in the CreateSessInfo destructor you would delete your object containing the...
  25. Replies
    5
    Views
    856

    Re: Destructor for a pointer in class

    You don't show where pClassInstance1 and pClassInstance2 are created (using new).
    If they are created inside CClass/DedBearerInfo, then you have to delete them in the destructor. You might be better...
Results 1 to 25 of 1153
Page 1 of 47 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)