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
J

jc0dex

@jc0dex
About
Posts
28
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Is it a lvalue?
    J jc0dex

    Same here. I think we're both correct here. If anyone else reading this knows otherwise please let me know :) Glad I could be a little help Twinsen! Cheers, -- Jay

    C / C++ / MFC help question

  • Is it a lvalue?
    J jc0dex

    Twinsen, I believe this is very likely the case, the implicit conversion may be going on behind the scenes. What compiler are you using? -- Jay

    C / C++ / MFC help question

  • Erasing a vector<vector inside a for-loop
    J jc0dex

    Oh and also what would be the template type of the vector in the first for-loop? A vector > ?

    C / C++ / MFC c++ com graphics help question

  • Erasing a vector<vector inside a for-loop
    J jc0dex

    for(std::vector::iterator listIt = _PacketLists.begin(); listIt != _PacketLists.end(); ++listIt) { PacketList& packetList = *listIt; for(PacketList::iterator packetIt = packetList.begin(); packetIt != packetList.end(); ++packetIt) { Packet& packet = *packetIt; if(packet.seqNumber == seqNum) { packetList.erase(packetIt); return; } } } - What exactly is PacketList representing? I have a vector<_PACKETS> inside another vector called _PacketLists. (_PACKETS is a small struct) That's the critical piece I'm not understanding to this problem. Would it be like vector<_PACKET>&packetlist = *listIt? And then I could use packetlist.begin() to iterate thru the other list? I'm a still little confused tho .. thanks for all the help

    C / C++ / MFC c++ com graphics help question

  • Is it a lvalue?
    J jc0dex

    Twinsen, Hey man .. looks to me like this .. If you call get(1) it returns to you the newly created x object, which you store as a reference (or even simpler "a copy"). When you go to increment the value for i it's completely valid because you initialized nothing to being constant and are simply changing the variable inside the class. Maybe I'm missing something huge, but I didn't see anything besides one of the constructors (which was never called) that takes in a const object. Hope this helps, Jay

    C / C++ / MFC help question

  • Erasing a vector<vector inside a for-loop
    J jc0dex

    Yea my snippet was very vague I apologize. I have a vector _PacketList ... Im not sure how to loop thru the outside _Packetlist, and for each outside _Packetlist loop through all of it's packets. Inside that loop is where I need to check each individual packet's sequence number against the one passed in. I hope this clarifies things because the sample code given doesn't really match what I'm trying to do. And why the attitude :-P

    C / C++ / MFC c++ com graphics help question

  • Erasing a vector<vector inside a for-loop
    J jc0dex

    Hey guys, Alright I've got a simple double for-loop here using the stl's vector. // go thru the vector of Critical Packet lists for(int i=0; i<_PacketLists.size(); i++) { // go thru the specified Critical Packet list for(int j=0; j<_PacketLists[i].size();j++) { if(_PacketLists[i][j].seqNumber == seqNum) { Erase Vector here ...... } } } The vector class has an erase function, but it only takes iterators. Is there any way to get around using iterators?I've tried using them with a vector inside a vector and has proven troublesome to me in the past. Any help would be much appreciated!!! Thanks in advance, Jay www.jdaigner.com jay@jdaigner.com

    C / C++ / MFC c++ com graphics help question

  • Simple Win32 Console App question...
    J jc0dex

    I found that GetAsyncKeyState does exactly what I was needing. Thanks guys!

    C / C++ / MFC sysadmin question announcement

  • Simple Win32 Console App question...
    J jc0dex

    Do I have to be using the CRT libraries for this? I tried including but when I do: if(_kbhit()) {ToggleMode()} It never gets into the true condition hen I press any key on the key board. Any help?

    C / C++ / MFC sysadmin question announcement

  • Change hard-coded variables from Outside
    J jc0dex

    Hello, First off one quick question ... with the simplicity of scripts why go thru all the trouble to change hard coded varibles? A simple text file and a text parser is like magic sometimes :) But as for changing hard coded variables, maybe putting the variable on its own thread and using a mutex would work. Or alternatively you could make one program take key input then use Shell Extensions to run that program inside another program and give it input from the second program. Just a couple of random, probably nonsensical ideas, hope that helps :) Jay

    C / C++ / MFC question tutorial

  • Simple Win32 Console App question...
    J jc0dex

    Hey Guys .. I'm running a Win32 Console UDP Server/Client application. I want to run my server update function inside my main loop while also checking for key input. All I need to check for is if a single key has been pressed. The kicker is I need a way to continue on with the update without pausing for user input. When the user hits 't' for toggle it calls a function that closes the socket and reopens it as a server or client. Here's what I have now, but as I said I need something that doesn't wait for user input. Update() { char toggle; toggle = cin.get() if(toggle == 't') { ToggleMode(); } // get all the packets we can while(ReceiveData()); // Send all the data to the clients SendData(); return true; } Thanks in advance!

    C / C++ / MFC sysadmin question announcement

  • Handle to a MFC dialog box window?
    J jc0dex

    Yea I'm sorry guys I should have been more descriptive. I've figured it out now, but basically all I was trying to do was log messages to an edit box control inside an mfc dialog based app in a CString. Now initially I was trying to do this from inside the server's functions, which I then realized all I needed was to either it global or pass it to each server's functions. Then I couldnt figure out why the strings weren't being added to the log window correctly, then I saw I needed to go inside the Dialog's Timer function where I handle my updating for my server and refresh the window every 60th of a second. All in all it was more of the fact I forgot where I needed to call what, exactly as you said. I'll remember to be more specific next time, but the help was much much appreciate and used! Jay Aigner http://wwww.jdaigner.com

    C / C++ / MFC c++ tutorial question

  • Handle to a MFC dialog box window?
    J jc0dex

    The HWND handle to the MFC dialog box, I think AfxGetMainWnd() will work but for some reason I've been having a bit of trouble trying to implement it in a small UDP voice chat server app.

    C / C++ / MFC c++ tutorial question

  • Handle to a MFC dialog box window?
    J jc0dex

    Awesome except I need the handle to the MFC dialog window! :-)

    C / C++ / MFC c++ tutorial question

  • Handle to a MFC dialog box window?
    J jc0dex

    Hello! I'm working with an MFC dialog based app and am using: SendMessage(GetDlgItem(hDlg, IDC_EDIT_CHATLOG), EM_EXSETSEL, 0, (LPARAM)&ch); But I don't have a way to get the hDlg parameter which is the handle to the window. Anyone know how to get the handle to an mfc dialog box win? thanks in advance, jay

    C / C++ / MFC c++ tutorial question

  • print screen
    J jc0dex

    depends if you're using MFC or not. With a multi-doc MFC app it does print screen for you.

    C / C++ / MFC c++

  • Modifying MFC
    J jc0dex

    Check the headers they say to never edit MFC code.

    C / C++ / MFC c++ question

  • learning to work with SDKs and source code...
    J jc0dex

    Well I've been programming on my own for a couple years, then at Full Sail for game design currently. Lots and lots of reading and testing with Visual Studio is imperitive to working with other peoples projects. Many of them include library files, include files, preprocessor directives, etc. which can be found in your project's properties and in the properties of Visual Studio itself. Just a note, the project's properties and Visual Studios properties are COMPLETELY seperate! Example: If you are required to add a library file to reference certain functions in a project you will have to tell Visual Studio where the library file is AND the project where the library file or you will get linker errors. Another example: I had to write a plug-in for maya using MEL and c++. The Maya C++ API has decent documentation but doesn't tell you all the files you need to include. I was constantly getting linker errors before a friend explained you have to have Maya linked to your program thru Visual Studio AND my project itself. But when it all boils down to it I would love to by a VS book myself because it's a very powerful tool and is almost a necessity to create quick and/or appealing projects. We also have been told at Full Sail that XnA the new compiler from Microsoft is supposed to encapsulate much of these third party libraries and make them easier to implement in your own projects. But that's just words at the moment. Anyways hopefully I helped a little, I consider myself a decent programmer and can create things I never could have imagined, but I read so much my eyes will probably fall out of my head by 30. heh. Good luck, j

    C / C++ / MFC tutorial csharp question lounge learning

  • learning to work with SDKs and source code...
    J jc0dex

    Hah you sound just like me a few years ago ... lots of ambition but no idea where to start. First off, lets get specific. What SDK's are you trying to install and use? Most of them have documentation located in the start menu under the title of your SDK. For example, if you install the DirectX9 SDK, right next to it on the start menu is a "DirectX Documentation for C++" which holds ALMOST every data type and method used by Direct X. Secondly, what compiler are you using? If using Visual Studio, most of the SDK's when installed actually add their info to the Help Index inside of the program. This allows you to search for specific topics, methods, or data types you will need in order to use the language. But you've got the right idea. Being a programmer means you have to read a lot, and sometimes you have to read things that aren't written too well. Reading the documentation will usually help you out exponentially, if you can find them heh. But let me know which compiler you're using and which SDK's you're trying to load up and I'll see if I have any more specific info for ya man. good luck jc0de

    C / C++ / MFC tutorial csharp question lounge learning

  • File Selection
    J jc0dex

    When you setup your OPENFILENAME structure try using the OFN_ALLOWMULTISELECT flag for the DWORD Flags parameter. I think that should help. jc0dex

    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