Skip to content

C / C++ / MFC

C, Visual C++ and MFC discussions

This category can be followed from the open social web via the handle c-c-mfc@forum.codeproject.com

111.5k Topics 465.7k Posts
  • I can't figure out why my program is not running

    2
    0 Votes
    2 Posts
    0 Views
    enhzflepE
    0. Please edit your question and wrap your code in the appropriate tags. 1. "Not running" isn't very descriptive. Are you failing to hit the enter key after typing the name of the program ina console window, are you only building the program but not running it from an IDE, or perhaps, you're running the program and it produces unexpected output.. 2. The program runs just fine. 3. This is the output I get when running from the console. (I assume you understand what argv[4] refers to. Hint: it's not a 4 character long input. argv[0] would hold "001-deleteMePlease" "001-deleteMePlease.exe") D:\code\001-deleteMePlease\bin\Release>001-deleteMePlease.exe 1 2 3 2000 Name: William Strickland Is Leap Year 2000 is a leap year "When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
  • Dump file creation

    help tutorial
    5
    0 Votes
    5 Posts
    0 Views
    H
    Hi, Thanks for your reply.
  • Can we Update Animation in .X File using DirectX3D

    help question announcement
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • c program

    tutorial question
    5
    0 Votes
    5 Posts
    0 Views
    S
    For MS VisualStudio, this should work: int main() { #pragma message ("Hello World!") } It will generate the message "Hello World at compile time, even if the ';' key is broken on your keyboard. see http://msdn.microsoft.com/en-us/library/x7dkzch2%28v=vs.100%29.aspx[^] On a sidenote, you can write C++ programs without the use of many central characters by using digraphs and trigraphs[^]. However, ';' is ot one of the characters you can circumscribe that way, and you can't express any command that will be executed at runtime without it. GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
  • ShellExecute and focus lose

    question
    8
    0 Votes
    8 Posts
    0 Views
    S
    Hi, I found out accidentally, that using the SetWindowPos to the MainFrm window inside the OnCreateClient it solves the problem. It seems that setting the attribute that does not change the Z-Order of the main window keeps it always in the top. SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_FRAMECHANGED); What do you think ? Regards, sdancer75
  • C code : read infomation of USB

    question
    3
    0 Votes
    3 Posts
    0 Views
    V
    Take a look at libusb Windows port: https://sourceforge.net/projects/libusb-win32/[^] or the original libusb https://sourceforge.net/projects/libusb/[^] The library allows for communication with an USB device from an user-space application. No kernel programming required.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Customized virtual drive

    csharp visual-studio help tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    L
    You would need to write a new device driver that would provide such functionality. See http://msdn.microsoft.com/library/windows/hardware/ff557573[^].
  • 0 Votes
    11 Posts
    1 Views
    V
    You can use a struct or a class with nested vector of same type structs: #include <vector> #include <string> #include <iostream> struct TreeNode { std::string payload; std::vector<TreeNode> children; TreeNode(const std::string &p): payload(p) {} TreeNode() {} // it's a must if we are to store nodes in a vector }; void walk_tree(TreeNode &node, int indent = 0) { std::cout << std::string(indent * 4, ' ') << node.payload << std::endl; for (size_t i = 0; i < node.children.size(); ++i) walk_tree(node.children[i], indent + 1); } int main() { TreeNode a("home"); a.children.push_back(TreeNode("peter")); a.children.push_back(TreeNode("jane")); a.children[0].children.push_back(TreeNode("game.exe")); a.children[1].children.push_back(TreeNode("homework.txt")); walk_tree(a); return 0; }
  • 0 Votes
    6 Posts
    0 Views
    S
    In C++11 you should be able to use an initializer list just as you did in your local variable example. See http://stackoverflow.com/questions/161790/initialize-a-const-array-in-a-class-initializer-in-c[^] That said, of course your compiler needs to support it before you can use that syntax. GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
  • 0 Votes
    2 Posts
    0 Views
    L
    See http://technet.microsoft.com/en-us/library/cc728431(v=ws.10).aspx[^].
  • Missing DirectShow BaseClasses in Windows8.1 sdk Kit

    help
    2
    0 Votes
    2 Posts
    0 Views
    U
    Hello, DirectShow on Widows 8 and up are deprecated, you can continue to use source from SDK 7.1, but pay attention, for example, DirectX are not hardware accelerated, for new project you must use use Microsoft Windows Media Foundation new from win7 Ciao Carlo
  • Occluded Objects

    c++ data-structures help tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    CPalliniC
    I would Google for "3d object intersection algorithm"[^]. THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite
  • 0 Votes
    8 Posts
    0 Views
    CPalliniC
    Have a look at this: "Recursive Functions"[^]. THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite
  • Program for decrypting graphic files in C.

    help tutorial
    11
    0 Votes
    11 Posts
    0 Views
    Richard Andrew x64R
    That would not be a simple change. You'd have to rewrite the whole thing. The difficult we do right away... ...the impossible takes slightly longer.
  • Study materials for C++/MFC

    c++ learning help
    24
    0 Votes
    24 Posts
    0 Views
    P
    plz fwd to my mail pavan1146@gmail.com
  • 0 Votes
    3 Posts
    0 Views
    U
    PowerPoint to EMF Converter can be used to convert PowerPoint to EMF in batch. It lest you convert your MS Office PowerPoint documents to EMF, Postscript, EPS, TIFF, JPG, PNG, etc. files in batch. You can able to convert office documents to PDF files in the system where there is no MS Office installed with the help of this converter. PPT to Image Conversion: http://www.softwaredownloadcentre.com/software/ppt-emf-converter.php
  • Task Manager Application List With its Name

    tutorial
    2
    0 Votes
    2 Posts
    0 Views
    J
    Maybe this [^] will help. "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
  • 0 Votes
    17 Posts
    0 Views
    P
    And VAX/DEC/HP C of course.
  • Suggestion on C++

    help c++ css sysadmin hosting
    5
    0 Votes
    5 Posts
    0 Views
    J
    Member 10813090 wrote: where size of my code should be less and communication should be fast and reliable. And why is what you are currently doing a problem? Is there a measured bottleneck that you have determined is caused by your code?