Skip to content

ATL / WTL / STL

Discussions on ATL, WTL and STL programming

This category can be followed from the open social web via the handle atl-wtl-stl@forum.codeproject.com

3.1k Topics 9.9k Posts
  • Issue with CHTMLEditView in CDHTMLDialog

    help html design
    4
    0 Votes
    4 Posts
    5 Views
    L
    Member 11018967 wrote: it does not edit the text it becomes freeze.. This still does not tell us anything useful. If you want someone to help you then provide a proper detailed description of what your code is doing and where the error(s) occur.
  • is DLL appropriate

    csharp c++ visual-studio com tools
    5
    0 Votes
    5 Posts
    5 Views
    A
    When choosing to go to a DLL, think whether you (or someone else) will be using these methods in another application, or whether you'd like an expandable interface via DLL based plug-ins. A common example of DLL usage would be in implementing audio codecs (since any exe that plays audio can/would use it). Additionally, functionality can be expanded/removed from applications via DLLs. Plug-ins can be implemented using DLLs with a standard interface. The application can look for any DLLs with the standard plug-in interface and load what's available.
  • using friend

    c++ question csharp visual-studio com
    8
    0 Votes
    8 Posts
    19 Views
    T
    friend can be used to give another class access to the protected and private members of the class that specified friend. If C_Messages want to access the protected and private members of the class C_Configuration then C_Configuration specified C_Messages as friend. If you aggregate the class C_Messages so that is has a C_Configuration, you can only access the public members of C_Configuration in C_Messages. But with the friend specifier you can also access the protected and private members. Sample code: class C2; class C1 { public: int public_var; protected: int protected_var; private: int private_var; friend class C2; }; class C2 { public: class C1 member; void set_private_var (int v) { member.private_var = v; } void set_protected_var (int v) { member.protected_var = v; } }; void Test() { C2 obj; obj.member.public\_var = 100; // ok // ERROR: can't access protected and private member // obj.member.protected\_var = 100; // obj.member.private\_var = 200; obj.set\_protected\_var(100); // ok obj.set\_private\_var(200); // ok } Another solution is working with an intermediate class which specifies the friend. In this case you get only access to public and protected members of the base class. Sample code: class C1 { public: int public_var; protected: int protected_var; private: int private_var; }; class C1B : public C1 { friend C2; } class C2 { public: class C1B member; void set_protected_var (int v) { member.protected_var = v; } }; void Test() { C2 obj; obj.member.public\_var = 100; // ok // ERROR: can't access protected and private member // obj.member.protected\_var = 100; // obj.member.private\_var = 200; obj.set\_protected\_var(100); // ok }
  • using friend

    csharp c++ visual-studio com workspace
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • 0 Votes
    2 Posts
    5 Views
    L
    Google for "C# obfuscation". It is not totally unbreakable but it's about the best you can do. Also please use the correct forum in future.
  • Time of reading text file

    adobe performance question
    9
    0 Votes
    9 Posts
    24 Views
    A
    The first thing you've got to do is work out whether it's I/O bound or whether it's the data processing that's slowing things down. You might find that CFile isn't particularly well tuned for reading from flash and not buffering enough. If it turns out that it's the I/O that's causing the problem find the lowest level function you can call and see what the raw I/O speed of your device is for a range of buffer sizes and then implement something that hits the sweet spot in terms of buffer size. It's a shame you're using MFC classes and not standard library ones as it's a lot easier to replace the underlying buffering and I/O mechanism, but such is life! Another thing might be to try reading more data in your while loop (say 512 characters at a time) and manually parcelling out the data rather than letting CFile::Read do it. If it turns out that the I/O is fast enough then have a look at what you're doing with the data. If you've got a lot of string handling you might find loads of temporaries flying about (especially if you're using VC++ 2008 and earlier) and there's loads of hidden memory manipulation that's slowing things down. In that case look at reducing the number of temporaries you need by reusing objects and expoiting things like NRVO. Anyway, the main thing though is to find out where the bottle neck is then do something about it.
  • Desktop application development techniques

    question csharp c++ wpf
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Optimized Solution for prime numbers..

    c++
    6
    0 Votes
    6 Posts
    16 Views
    B
    "Optimized" is not the correct category here. It is simply wrong. 25%6=1, but 25 is not prime.
  • your items formula will be supported via potent

    com
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • 0 Votes
    1 Posts
    1 Views
    No one has replied
  • get IP address from Net Address Control (Resolved)

    c++ visual-studio com sysadmin
    7
    0 Votes
    7 Posts
    9 Views
    B
    Quote: If it's an MFC dialog then that is effectively how it is run. When I drop a control onto a dialog, there has never been a need to call DoModal for that control. I tried dropping the Net Address Control onto the dialog and it did not work out well. EDIT After spending a couple of hours on this I managed to get the "IP Address Control" to display in the dialog tool box. Its under the Dialog Editor section of the toolbox. Now that I can drop that on to the dialog, my extended question about manually creating the dialog is no longer needed. (That would be the long reply that I am deleting and replacing with this.) Now that the dialog is there, adding a variable and getting the address is no trouble. So thank you for your patience. Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com
  • serial port access and communication using c

    help tutorial
    6
    0 Votes
    6 Posts
    12 Views
    O
    Fair enough. I think it's likely OP posted in the wrong group, as neither A, W, or S TL are C libraries.
  • 0 Votes
    3 Posts
    7 Views
    B
    I had not noticed that, but will take the time to look for it now. It will probably help to incorporate those into my searches. Thank you for taking the time to post that. Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com
  • control ID not found, Resolved

    csharp c++ help php visual-studio
    7
    0 Votes
    7 Posts
    9 Views
    L
    bkelly13 wrote: A right click on that control solicits a dialog I get it now, you were talking about the MFC Class Wizard being used when you develop the application; a long time since I used MFC. bkelly13 wrote: Now I realize, or think I do, that my code was trying to reach inside that edit box ... Yes, you got it. Glad you got things working.
  • 0 Votes
    13 Posts
    15 Views
    J
    _SECURE_SCL was enabled in COM amounting to 4 byte increase in size. Removing that solved the issue. Kings
  • Pointer to a function parameter

    help
    8
    0 Votes
    8 Posts
    23 Views
    L
    See http://publications.gbdirect.co.uk/c_book/chapter5/arrays_and_address_of.html[^] for a good explanation of this issue.
  • friend declaration causes undeclared identifier

    c++ help csharp visual-studio com
    2
    0 Votes
    2 Posts
    6 Views
    S
    It needs a forward declaration of void_C_Configuration_Manager class. Do as follows. class void_C_Configuration_Manager; Do it in the header.
  • 0 Votes
    3 Posts
    9 Views
    S
    Have you tried Project properties->Configuration properties->Char set->Unicode
  • Why calling sort() crashes?

    graphics help question
    3
    0 Votes
    3 Posts
    5 Views
    T
    I think that equality don't work in sort. Why swap elements if they are equal?
  • Trigger dialog method from non-windows app

    c++ csharp database visual-studio com
    6
    0 Votes
    6 Posts
    17 Views
    Richard Andrew x64R
    1. Yes, export a function from the utility 2. About the crashing when passing a pointer to your log class: Where did it crash? Can you pinpoint that? It might have something to do with the TCP utility using a different heap from the main exe. The difficult we do right away... ...the impossible takes slightly longer.