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
T

TragicComic

@TragicComic
About
Posts
10
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • PathFileExists() and GetFileAttributes() both hang when a network path doesn't exist.
    T TragicComic

    I'm trying to verify that a path exists by using either PathFileExists() or GetFileAttributes(), but when a network path like \\SWAP01\slave02\mydirectory doesn't exist because the system isn't on, both functions hang. In fact, they hang pretty seriously, so much so that I can't kill the process from the debugger OR the task manager. My only option appears to be to log off from the system and log back in. Any thoughts on how I might better deal with this hang?

    C / C++ / MFC sysadmin debugging question discussion

  • WPF, Expression Blend and C++
    T TragicComic

    I just went to the Microsoft "Heroes Happen Here" launch event and I'm really excited about WPF. However, all of my work is currently in C++ and at least for the next year or so will likely stay there. I've been looking at some of the tutorials about hosting WPF content in a Win32 app, and this seems like kind of a no brainer, but the tutorials never get past the "here's how you do it procedurally". I would very much like to be able to author forms and dialogs in Expression Blend and then load them from my C++ Win32 app. Does anyone have any good tutorials, or have straight forward code snip-its for doing this? Is this even a reasonable thing to try to do? Thanks in advance... Adam

    WPF csharp c++ wpf hosting question

  • Using winsock, how can I tell if a system is listening for a connection on a port before I call connect?
    T TragicComic

    I've got an application that runs on several computers which handles simultaneous video capture (to be clear, each system runs it's own copy of the capture software). I've got another application that runs on another computer and is used to control capture software that is running on the other systems. Currently, the capture software uses the winsock call "listen" to listen for incoming connections on a specific port. When I want to connect to the capture systems from the control system, I use the winsock call "connect" to make the connection. Currently, I cycle through a list of possible capture machines and attempt to connect to each one, however, the capture systems may or may not be running the capture software. Because connect doesn't allow me to specify a timeout, this connection process can take an extremely long time if even a single capture system is powered down or isn't running the software. So my question is: Is there a way to check to see if a system is listening for a connection before I call connect? Or, is there a better way to handle establishing connections between my machines. Thanks, Adam Kraver

    C / C++ / MFC question

  • Doubles change behavior in CreateThread process, why?
    T TragicComic

    Found it! :D So, one of the details that I left out was that I am using DirectX for GPGPU math processing as well as for displaying 3d objects. It turns out that if you create a D3DDevice without the behavior flag D3DCREATE_FPU_PRESERVE, the following happens: Without this flag, Direct3D defaults to setting the FPU to single-precision round-to-nearest mode. Using this flag with the FPU in double-precision mode will reduce Direct3D performance. Don't you just love how moments after you post about a problem, your thinking changes just enough to allow you to find the culprit? Thanks for forum, Adam

    C / C++ / MFC visual-studio algorithms help question

  • Doubles change behavior in CreateThread process, why?
    T TragicComic

    Hello, I'm having a problem with my double precision variables right now, and I'm hoping someone out there will be able to give me a hint as to what's going on. The details are going to be a little sketchy simply because of the size and complexity of the application. I have a function that tests to see if the double precision code is behaving properly. This function looks something like this. void TestMath() { double kappa = -2.5316332141755993e-008; double cx; cx = (double)1.0 / (double)kappa; if (cx != -39500192.000000000){ BREAK("MATH IS WORKING"); } } When this function is called from the main body of my application, it never hits the break. However, if the function is called from a thread I have spawned using CreateThread(), the break does get hit. The value for cx should be -39500192.776766039, but it's being set to -39500192.000000000 And if I add the line double cx2 = 1.0 / -2.5316332141755993e-008; cx2 always equals -39500192.776766039 regardless of where I'm making the call. Using the IDE and checking the value for kappa indicates that it's value is correctly being stored. And again, if the function is called from a spawned thread, cx is evaluated to be -39500192.776766039 To create the thread, I'm simply calling handle = CreateThread( NULL, 0,(LPTHREAD_START_ROUTINE)threadProcess, parameter, 0, NULL); And the function declaration for the thread looks like this. DWORD WINAPI threadProcess(void *param) Does anyone have any suggestions as to what could be causing this behavior? Thanks, Adam

    C / C++ / MFC visual-studio algorithms help question

  • Optimizing hard drive write performance
    T TragicComic

    Before using CreateFile and WriteFile, I had done that, but unfortunately, the performance of fwrite couldn't keep up with my transfer needs (it runs about 1/2 to 1/4 the speed of WriteFile when using unbuffered writes, even when there is no other real load on the CPU).

    C / C++ / MFC performance com

  • Optimizing hard drive write performance
    T TragicComic

    James, thanks for the hint! So far, using CreateFile and WriteFile with NO_BUFFERING, I'm getting the performance I was expecting (and so far, the performance that it looks like I need). Of course, I'm testing this in a small test app, so I'm not sure what the final results will be in the capture app, but the results are quite promising.

    C / C++ / MFC performance com

  • Optimizing hard drive write performance
    T TragicComic

    I'm working on an application that captures uncompressed video from 2 high resolution (1024x768) video cameras at 30 fps. In order to stream to the hard drive without dropping frames, I need to maintain an average transfer rate of ~47 megabytes per second. The drives I am using are rated to be able to handled a sustained write of 75 megabytes per second all the way to the end. However, simply writing data with fwrite and timing the performance, I am coming no where near the necessary level of performance. If anyone out there has any experience with high performance file writing, I'd love to get some tips/pointers on ways to increase write speed. Adam Kraver www.captivemotion.com

    C / C++ / MFC performance com

  • How can I ensure that a drive is spinning and ready to write data?
    T TragicComic

    Hello, I am working on an application that streams uncompressed data from high resolution video cameras directly to a hard drive. The amount of data that I am writing is very high, and if I start to write while the drive is idle, I lose a significant number of initial video frames. Does anyone know a simple way using c++ (on Windows XP) to keep a drive ready to go? My first thought is to open a file, write some bits, close it and delete it every so often, but I worry that it might just sit in the hard drive buffer without spinning up the drive (and if the data doesn't sit in the HD buffer, it seems like a bit of overkill anyway). And I guess I also have a follow up question, is it possible to check the drive to see if it is idle, or if it is spun up? I've looked in the windows SDK, but the disk managment functions in the Platform SDK are a little light. Thanks for the help, Adam

    C / C++ / MFC question c++ help

  • Custom icon size in system tray?
    T TragicComic

    Is it possible to have a custom icon size in the system tray? I would like to be able to overlay a timer (hours:minutes) on top of my system tray icon, but due to the default size (16x16), there simply isn't enough room to display the timer in a visually appealing manner. Thanks, Adam

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

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