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
  • Additional Include Directories

    c++ csharp visual-studio help question
    14
    0 Votes
    14 Posts
    16 Views
    H
    Garth J Lancaster wrote: c) In VS2008, open your project, Under 'Additional Include Directories', include ${COMMON_CODE} (I think you need a space between this and the other directories iirc) The include directories should be a semicolon-separated list. The directories themselves may (or may not) contain spaces. In the bigger picture, I endorse this way of specifying directories. If I understand the original problem properly, OP used a full filespec for an include directory. Visual Studio likes to keep track of file and directory locations relative to the location of the project file (or solution file, depending on things). If you get a solution/project working in one location (which points to an absolute file/folder location) and then copy the solution/project to another location, the 'relative' file/folder pointers will be wrong. Garth's solution should fix that part of the problem. -- Harvey
  • member char array is bad pointer

    c++ csharp visual-studio data-structures debugging
    12
    0 Votes
    12 Posts
    11 Views
    A
    Only time I've had to do it was when I didn't have the source to a third-party dll. You should be able to have the rest of the application be debug and your third-party dlls be release mode with no issues (obviously you can't debug the inner working of those dlls but they're still loaded and working). With that said though... it's probably better practice to run the whole thing in debug or release (a lot can go wrong with the mixed assemblies).
  • rookie need help with STL

    c++ help question game-dev docker
    3
    0 Votes
    3 Posts
    4 Views
    R
    In the above scenario u can use vector which would maintain the count of questions.Second thing if u want to provide some uniqueness to the question I think u should take a timestamp as variable in your question class which is updated when u create a question and will be overwritten if u modify that question. Thus ur count and uniqueness will remain intact.
  • 0 Votes
    3 Posts
    3 Views
    F
    hm this doesnt help me... can you please just answer the question if you know it thanks Frank
  • locals not valid in debugger

    c++ debugging help csharp visual-studio
    5
    0 Votes
    5 Posts
    5 Views
    L
    bkelly13 wrote: I realized the project was set to build the realease version. Yeah, we've all done that once or twice. The thing with the Release build is that variables can get optimized away that will always show up in the Debug build. BTW I don't think that rebooting would have made any difference to the situation.
  • 0 Votes
    2 Posts
    2 Views
    L
    khaliloenit wrote: there is no version 64 for driver for mdb files That is true, so I'm afraid you have to keep it as 32 bit.
  • add sys dsn failed on windows 7 64

    c++ database sysadmin help tutorial
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • SQL Server Compact Edition

    c++ database question csharp sql-server
    4
    0 Votes
    4 Posts
    8 Views
    L
    I assume then that you are talking about the file with the same name as the solution. This is created and used by Visual Studio that contains information about the solution and it's references.
  • ATL and exceptions

    c++ question
    5
    0 Votes
    5 Posts
    3 Views
    A
    Having originally started with C, I too prefer returning an error code to be cleaner than catching exceptions, but I'm sure others see exceptions as the true C++ method for handling errors.
  • unicode and non-unicode

    c++ help csharp visual-studio question
    9
    0 Votes
    9 Posts
    3 Views
    A
    Review all the macros available to help with unicode/non-unicode compilations from MFC: What are TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR (etc.)?[^] If you don't want to use MFC, you can always make your own macros to do the same thing... they're all relatively straight forward.
  • 0 Votes
    4 Posts
    5 Views
    J
    after a long time seeing you here <>:thumbsup: Jibesh V P
  • TCP/IP CAsyncSocket and pointers to same

    question workspace csharp c++ visual-studio
    2
    0 Votes
    2 Posts
    4 Views
    B
    After writing the OP I outlined the process with all the steps then began to implement. I have started using a common directory for re-usable code. In order for the Manager to call a method in its creator it must know the name of the owner's class. To do that I added a forward declaration in the Manager. However, this means that when the class is re-used, and the owner has a different name, the Manager must be changed. There is another indicator this is a bad practice. After the forward declaration in the dot H file, the dot CPP file needs to reference the dot H file of the owner. The common code resides in another directory and it cannot find the central code of the main project unless it is specifically spelled out. Then, if the project is moved or re-name, the common code must change. There may be a way to do this automatically using directive and path names within Visual Studio. But I now think that even if that can be done it would be miss-guided. Conclusion: A utility class can call "down" the heiarchy to objects it creates, but should not call up to its owner. While the concept of it calling up may make the owner code neater, it represents an inversion of authority. (Regardless of how the methods are name, a call up in an inversion.) Problems remain: The main application uses pointers into the lower level objects to accomplish its tasks. How does it become aware that the lower level needs to exit, or maybe even has already exited. Controlled exits: When the TCP sending function detects that the client has closed the connection it does not exit right away. It waits until the upper level code calls the method to send the data. Then the lower level returns an error code stating that the data has not been sent and that the object is exiting. Uncontrolled exits: I generally do not like exceptions, but this appears to be a time when an exception is warranted. When the lower level must terminate unexpectedly, then an exception could work its way back to the upper level and the exception handler can NULL the pointer. Thanks for your time
  • 0 Votes
    1 Posts
    1 Views
    No one has replied
  • Why does this fail - CFile / SeekToEnd?

    question discussion
    13
    0 Votes
    13 Posts
    15 Views
    C
    This is just too funny. sigh, in a sad sort of funny.... So, I have managed to muddle along as there simply is no time to re-write this app. Yet. I can get it to run in the debugger under Windows 7, so that's what I've been doing. Fast forward three months. New laptop, new Windows 7 install (should be basically the same, but who really knows?), new VM, etc. Guess what's running now? :mad: Thumps along just fine. I know the bug is still there, I'm not that dellusional. Charlie Gilley You're going to tell me what I want to know, or I'm going to beat you to death in your own house. "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
  • sqlconfigdatasource fails on 64 bit from 64 application

    help json
    4
    0 Votes
    4 Posts
    3 Views
    L
    khaliloenit wrote: when i run my code the API above fails. Well, as I said, we cannot see your screen so we have no idea what may be happening. One of these days I'm going to think of a really clever signature.
  • books: activeX and com,

    com c++ docker json announcement
    2
    0 Votes
    2 Posts
    5 Views
    J
    You mentioned Inside COM by Dale Rogerson which remember using so I had a glance at my bookshelves. I know Inside COM taught me the underlying principles of interfaces and COM without resorting to ATL or MFC. Professional COM Applications with ATL (Wrox, 1999) was quite good on Active X, and does have a section 'Building an ActiveX Calendar Control' which explains a lot. However something like this, whilst being the same era as Inside COM, refers to VC6 and ATL3, not the most up to date now. I did also buy ActiveX Controls Inside Out (Microsoft Press, 1997) and see it on my shelf but this is un-thumbed so I obviously didn't use it a lot, but its more wider ranging than the ATL book mentioning MFC and Visual Basic controls (VBXs). I don't want to sell mine but hope this might help.
  • Problem with embedded ATL component

    help c++ java com hardware
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • detect multiple instances of an application

    c++ csharp visual-studio question
    4
    0 Votes
    4 Posts
    4 Views
    H
    If you want to be able to count instance hits, have a look at the shared memory option here.[^] This article also shows some other techniques which I think fix some of the problems described in Joe Newcomer's article first referenced above. I have used the shared memory technique to inhibit multiple instances of a program as well as manage some common data in a program where I allow multiple instances. [I have a lot of respect for the technical output of both of these authors.] -- Harvey
  • 0 Votes
    1 Posts
    2 Views
    No one has replied
  • TCP blocking -vs- CAsyncSocket -vs- Win32 API

    c++ visual-studio help question csharp
    11
    0 Votes
    11 Posts
    0 Views
    P
    Thank you! Pretty much all areas of programming can become tricky if you cross the line. :-) I've always considered myself a generalist programmer and I'm definitely not a network expert. I've just had the luck to work on some specialized networking apps.