Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

lastgen

@lastgen
About
Posts
48
Topics
17
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem with winsock2.0
    L lastgen

    Thanks for the help, but I've figured it out, and the answer simply foolish :wtf:. I wasn't closing the connection correctly, hence the lack of buffer flushing As for the repeat message, it wasn't repeating. The message was being stored in a buffer with a static pointer, and because I neglected to check the data size returned from recv I was assuming the data pointed to was the latest message, but recv was in fact returning 0.

    When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC help data-structures question

  • Problem with winsock2.0
    L lastgen

    I'm having a couple of little problems with a listening socket connection. I've worked with winsock before but that was a long time ago. Essentially this is the procedure. App-A is the sender, App-B is the receiver. App-B is running constantly listening for a connection. App-A(which is not always running) connects to App-B when required and sends a message, and closes the connection afterwards. The problem I'm having is this. if App-A executes too quickly, App-B gets an WSAECONNRESET error on calling "recv" I can get around this by slowing App-A down with for loops/sleep commands and other such hacks, but would prefer not to do this. The other problem I get is if App-A abnormally terminates, App-B sits in a loop constantly receiving the last message sent by App-A. This isn't a large concern as I'm deliberately causing App-A to fail as a stress test which is unlikely to occur. I'm guessing either App-A needs to wait and ensure the message has been received before closing down, or App-B needs to queue messages somehow. Any tips?

    When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC help data-structures question

  • Direct3D image scramples when the screensaver comes up
    L lastgen

    I have noticed in application I'm working on that if the screensaver comes up at any time, it seems to destroy the direct3D rendering. By destroy, I mean all the windows containing a rendered image are filled with multicoloured gibberish. The only way to restore the rendering seems to be to shut the application down and restart it. I'm guessing it may be something to do with the render device losing it's handle or something. Has anybody encountered anything like this before?

    When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC question

  • Bug when restoring state of docked windows
    L lastgen

    I have but seeing as it's a 2 y/o article noone has replied. Or maybe it's because I smell too badly and they don't want to reply for fear of catching something?

    When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC help tutorial csharp c++ visual-studio

  • Bug when restoring state of docked windows
    L lastgen

    related article - http://www.codeproject.com/wtl/wtldockingwindows.asp?df=100&forumid=3244&select=1705076&msg=1705076[^] QUOTE - Flying tabs are not restored properly And68rei 7:16 21 Oct '04 I played with MDIExSample.exe and discovered one troublesome bug. 1) take one of flying windows and move it outside of main window (e.g. <<1>>) 2) take another one (<<<2>>>) and attach it to first window (<<1>>), so they form tab control in separate window. 3) close the application 4) start it again. After restoring of windows' locations those 2 windows are lying one under another and don't form tab control anymore... So, restoring works fine if tab control with some windows lies inside main window, and not if outside. I have encountered the same problem in something that I am working on. I have looked at/compiled(in VS 2003.net) the source code in this article and can confirm that this docking bug occurs in this example. I'm not sure what zerozerofancy is talking about, as with my copy of stdafx.h there is no reference to sstate.h nor dwstate.h and the code in dbstate.h seems to already be "CDockWndMgrEx mgrDockWnds(m_hWnd)" Anybody know what the cause is and how to fix it?

    When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC help tutorial csharp c++ visual-studio

  • COleVariant, Unicode and truncated strings
    L lastgen

    Thanks for the suggestions. I managed to fix(hack) it. I was already using safe arrays as the task I'm performing must communicate with older COM and OLE objects. The problem seemed to be an error in one of the OLE cpp files in the MSVS directory. It seemed to call a standard strlen function regardless of the input type so I've changed the code to check for unicode and call wcslen if needed. When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC help question

  • COleVariant, Unicode and truncated strings
    L lastgen

    I'm working on an app that needs to work with both ascii and unicode, but I seem to have run into a rather frustrating problem. It seems that for some reason, whenever I pass a unicode string to COleVariant.SetString(), the bstrVal only contains the unicode string up to the first NULL character in the string(regardless of the VARTYPE parameter). Hence most of the unicode strings are prematurely truncated. If I remember my unicode correctly it requires a double NULL to indicate the end of a unicode string does it not? Anybody know of why this may be and how I can fix it? When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC help question

  • Quaternion rotation
    L lastgen

    I know this isn't really a C++ question, but Quaternions are commonly used by many C++ coders so I'll ask this here... I am trying to rotate object A by the reverse of object B's orientation, where I know the orientations of each in quaternion form. I can do this by converting the quaternion B to a matrix and multiplying A by the inverse of Matrix B, but this seems like a waste or processing power. What other methods can I use to reverse the rotation of a Quaternion? Would negative scaling work? When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC question c++

  • Anyone know of a good commercial debugger?
    L lastgen

    I believe Numega Boundschecker does something similar. I used it once upon a time to find some memory leaks and it seemed to work ok, but that was about 7 years ago now. I think boundschecker's still around though in a new form. When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC debugging tools help question lounge

  • Enabling double click message handling in GLUT based windows
    L lastgen

    I have found a problem with most of the applications we are working on, namely that the windows double click messages are never received. The reason for this is that the windows are openGL based and the CS_DBLCLKS style is not being set by glut. I can get around this by adding the flag to the file glut_init.c, but this a 3rd party file so I'd prefer not to modify it. Does anyone know of a way I can pass or set default windows style flags to glut without modifying the GLUT source code? When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC graphics game-dev help question

  • Memory leak coming from COleSafeArray object
    L lastgen

    OK I've worked it out. It seems you cannot set the data via the constructor or it will cause a leak, don't ask me why, it just does. Otherwise it works fine. The fix is to replace the faulty line with these two COleSafeArray cellArray; cellArray.Attach(usedCells.get_Value()); I have also noticed with this fussing today that if a value is assigned to any form of variant based objects in C++ it will leak unless you call Clear() after every assignment. One of the many reasons why I despise variants. When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC help data-structures testing beta-testing performance

  • Memory leak coming from COleSafeArray object
    L lastgen

    I must be missing something in the cleanup, but here is a cut version of the code that causes the leak. // ... an Excel file has been loaded already into oSheet CExcelRange usedCells = oSheet.get_UsedRange(); // Copy used cells to array - It is this line of code that causes the leak /****************************************************/ COleSafeArray cellArray(usedCells.get_Value()); /****************************************************/ usedCells.Clear(); usedCells.ReleaseDispatch(); VariantClear(cellArray); cellArray.Clear(); cellArray.Detach(); // ...close down excel etc etc I have deliberately cut down my code for testing so it essentially does nothing but load the file. There is no code between "COleSafeArray cellArray(usedCells.get_Value());" and "usedCells.Clear();" to help narrow down the leak. If I comment out the line "COleSafeArray cellArray(usedCells.get_Value());" (and oviously the associated cleanup so it will compile) I have no leak, but if it calls this line I get an immediate loss of ~4-5 times the file size which equates to about 30 meg per file. If I run this multiple times it continues to drop, so I don't think it is a windows caching problem. Anybody know what I'm missing? When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC help data-structures testing beta-testing performance

  • MFC tree control list generation
    L lastgen

    Thanks heaps. When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC question c++ data-structures

  • MFC tree control list generation
    L lastgen

    I am improving an application that is taking forever to load, primarily because each time it loads it initialises a full tree of nearly 100000 items, even though there are only 5 or so keys viewable from the root path. Does the MFC tree control have any sort of support for reading only what is needed, or do I need to hook the open scope(whatever they may be called) functions and code it manually? When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC question c++ data-structures

  • debug assertion failed
    L lastgen

    An assertion has failed. Check the parameters you are passing to the function. Sorry about the vague answer but with the information you give I don't think it can be narrowed down much further. Give us more details/source code if you want us to give you a more detailed response. eg where are sd_l, np_seed, np_seed1, isign defined, and what types are they? What values do they have? What is the exact assertion? The assertions are there for debugging usually to tell you that something you you sent the function is invalid. When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC c++ debugging help

  • Remote debugging setup for VS 2003 on XP
    L lastgen

    I need to set up remote debugging for a C++ project I am working on as a couple of users are getting a crash on particular machines that can't be replicated on any of our programming team PC's. All the computers are running windows XP(Pro I think - Does it matter?) and we have a high speed network connection to their PC's. From what I have been able to gather, I need to use these files MDM.exe msvcmon.exe msvcr71.dll natdbgtlnet.dll natdbgdm.dll dbghelp.dll but the rest of the information seems rather vague. Apparently I need to "install" these files, which by install I gather they mean dump in a common directory. Then I need to run MDM.exe on the client and I should be able to launch from VS on my machine while running the process on the client??? Has anybody here done this before who could give me some pointers? Should I be able to do all the things I can do debugging locally? When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC c++ visual-studio sysadmin collaboration json

  • game
    L lastgen

    I don't mean to sound rude, but this is the 3rd time you have posted this question, but you have never explained anything. All your posts(sadly not just in this topic) seem to be the equivalent of "My program doesn't work, why not?" To which others ask "What is your program, how is it written, what are you trying to do?" To which you start a new thread and again post "My program doesn't work, why not?" You will never get a valid answer if nobody knows what the hell you are on about! If you want somebody to post the code to your assignments on the web you have to try a little harder than that.:zzz: When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC question c++ game-dev

  • interview questions
    L lastgen

    For those who don't know, Yes it can! You would use this if you wanted to prevent anybody creating this object with a call to "new". Therefore the object itself must control it's own creation and deletion. Another question if you are in the gaming industry may be something like: What is a quaternion, why is it different from Euler and what are the advantages/disadvantages of both? When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC c++ com career

  • Why do I extract two different mp3 song durations?
    L lastgen

    I'm not at all familiar with the programs/components you are referring to, but I'd be guessing that the mp3 is VBR (variable bit rate). I know in the past some programs have read times wrong because they have been code for a fixed rate. When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC help question

  • A very big problem
    L lastgen

    Assuming you are running windows you can do something like enumerate all the windows and search for a caption or similar. This isn't the best solution, but is about all you can do if you don't have full control of whatever is spawning/closing the window(unless you want to apply some hooks :-D). In order to enumerate the windows you can take a couple of approaches: If you know what process owns the window, you can call EnumProcessWindows(), otherwise you will need to call EnumWindows() and check for child windows with EnumChildWindows(). I'm a little short on time at the moment so sorry I can't give a good example, perhaps later tonight. Anyway I hope this helps a little. When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!

    C / C++ / MFC help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups