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

Search:

Type: Posts; User: TubularX

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Re: the outer loops breaks earlier tha expected

    Well, for example, there's a risk that "unit" is created when r == 0. As a consequence, "low" will be given the value 0. Then you assign "r = low-2" and "two.push_back(LN[r][c])" might be called with...
  2. Replies
    11
    Views
    537

    Re: Review Component Based Architecture API

    "Not really. Modern C++ implementations reduce the overhead of using exceptions to a few percent (say, 3%) and thatís compared to no error handling. Writing code with error-return codes and tests is...
  3. Replies
    11
    Views
    537

    Re: Review Component Based Architecture API

    Ah, you're right! With emplace you can pass the parameters like that. I overlooked perfect forwarding.
  4. Replies
    11
    Views
    537

    Re: Review Component Based Architecture API

    The variable cmp is passed as an rvalue, because components contains unique_ptr. cmp is also a unique_ptr.

    I know that std::move simply performs a cast. My point is, unique_ptr's move constructor...
  5. Replies
    11
    Views
    537

    Re: Review Component Based Architecture API

    I browsed the code quickly. I find this code dangerous:

    auto res = components.emplace(cmp->gUid, std::move(cmp));

    The order of parameter evaluation is undefined in C++. It means that cmp can...
  6. Replies
    1
    Views
    248

    Re: Creating graphical apps in C++

    Yes, I would recommend C++. It can be done with Visual Studio.

    Start here:
    https://www.visualstudio.com/explore/cplusplus-mdd-vs.aspx
  7. Replies
    9
    Views
    707

    Re: User defined literals

    It needs to be unsigned, because there are no negative literals (user defined or not) in C++. You need to make it work with operator-().
  8. Replies
    9
    Views
    707

    Re: User defined literals

    OK, so the conversion (num += 273.15) has really nothing to do with your test? Then just leave that out to make it cleaner.



    struct kelvin
    {
    kelvin( long double t ) : temp(t) {}

    ...
  9. Replies
    9
    Views
    707

    Re: User defined literals

    Like Superbonzo said, you can create celsius and kelvin types instead of the temp type. It's more efficient without the if statements.

    However, it seems a bit strange to subtract celsius and...
  10. Replies
    4
    Views
    543

    Re: Problem with deletion of Singleton.

    If you just follow the CppCoreGuidelines, you will less likely cause invalid heap.

    https://github.com/isocpp/CppCoreGuidelines

    In this case, if you use std::unique_ptr, you don't need to...
  11. Replies
    1
    Views
    313

    Re: Doing Unit Testing

    When you say "change the program", do you mean change the code, or just the data?

    The purpose of automated tests should be to validate different use cases in an isolated environment. Each test...
  12. Re: HHmmss.fff - HHmmss.fff - how to achive time difference (duration)

    Hi,

    Take a look at the chrono library:

    http://en.cppreference.com/w/cpp/chrono/c/time
  13. Replies
    1
    Views
    298

    Re: Asynchronous call

    Hi,

    According to MSDN, the SHFileOperation function is thread safe (except for relative paths).

    So no need to wait. You can create a separate thread that makes the call, while the main thread...
  14. Replies
    0
    Views
    181

    Taskbar visibility

    Hello,

    I have an application (A) which can host a MFC application (B) inside. A creates the B process, finds the window handle of B, calls SetParent to make B a child window and MoveWindow to...
  15. Replies
    2
    Views
    329

    Re: Safe conversion?

    Thanks!!
  16. Replies
    2
    Views
    329

    Safe conversion?

    I've seen some code where a subclass with a single method was created just to be able to access a protected method:



    class A
    {
    ...

    protected:
    virtual void func();
  17. Re: atlsimpstr.h access violation error

    It seems like you've missed the left parenthesis when casting CMainDlg. But other than that, it looks like it should work...

    "atlsimpstr.h" indicates that a string is used somewhere. Did you...
  18. Replies
    10
    Views
    1,194

    Re: UTF-8 Conversion

    Exactly, and it sounds easy. Maybe I'm missing something obvious here, but I'm stuck regarding the data types.

    My source is of type CStringW (UTF-16). When converting/decoding back and forth...
  19. Replies
    10
    Views
    1,194

    Re: UTF-8 Conversion

    Thanks for your reply!

    Yes, I'm talking about command line arguments/parameters. Both programs are compiled with unicode (/D "_UNICODE" /D "UNICODE" /Zc:wchar_t).

    If I pass unicode strings...
  20. Replies
    10
    Views
    1,194

    Re: UTF-8 Conversion

    I'm not trying to insist on anything, but my dilemma is that CreateProcessW only accepts wide string.

    CreateProcessA on the other hand does accept a char type string. With that function I can send...
  21. Replies
    10
    Views
    1,194

    Re: UTF-8 Conversion

    Thanks Codeplug, I didn't realized until now that the CString constructor converts it to UTF-16.

    But now I don't even understand how it works in the English edition, that I can send text with...
  22. Replies
    10
    Views
    1,194

    UTF-8 Conversion

    I'm transferring a unicode string from one program to another with UTF-8 encoding.

    Program that is sending:



    // Convert path
    std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8_converter;...
  23. Thread: unusual event

    by TubularX
    Replies
    1
    Views
    419

    Re: unusual event

    Hi,

    It could be that your system is infected. Some malware will show a fake "windows command processor" window.
    ...
  24. Replies
    1
    Views
    532

    Pan gesture problem

    Hello,

    I'm struggling with the pan gesture in a desktop application for my Surface Pro 2.

    I simply want to pan (or "swipe" if you prefer) with two fingers, but it doesn't behave like I want it...
  25. Replies
    8
    Views
    1,600

    Re: Size from CImageList

    Excellent! Thank you!!
Results 1 to 25 of 107
Page 1 of 5 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a Codeguru.com survey!


HTML5 Development Center