Skip to content
Code Project
CODE PROJECT For Those Who Code

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
  • MS Word Automation - I get so far - now what?

    help c++ algorithms testing tools
    3
    0 Votes
    3 Posts
    0 Views
    D
    I've always done it like: _Application app; Documents docs; _Document doc; if (app.CreateDispatch("Word.Application") == TRUE) { docs = app.GetDocuments(); doc = docs.Open(COleVariant(strFileName), ...); // do something with the document docs.Close(vtFalse, vtOptional, vtOptional); app.Quit(vtOptional, vtOptional, vtOptional); } Not sure if that helps you or not. "One man's wage rise is another man's price increase." - Harold Wilson "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Use PlaySound api caused memory loading?

    question graphics json performance help
    2
    0 Votes
    2 Posts
    1 Views
    Richard Andrew x64R
    I would assume that data structures are initialized to play the sound, and then the data structures are kept for the next sound to play. The difficult we do right away... ...the impossible takes slightly longer.
  • List And iterator

    question database tutorial learning
    3
    0 Votes
    3 Posts
    0 Views
    D
    Please see #4 here. "One man's wage rise is another man's price increase." - Harold Wilson "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
  • use c++ to drive cmd window and get responses

    question csharp c++ visual-studio
    5
    0 Votes
    5 Posts
    0 Views
    H
    To be exact, DOS is a operation system, and command line in windows is just a application, we call it console. You can use GetStdHandle to get the standard output in a running GUI application, or use CreateProcess to spawn a process and redirect it's output to do the same thing.
  • Which among following statements c/c++ code is faster?

    c++ performance question
    11
    0 Votes
    11 Posts
    2 Views
    H
    I agree with you! In general, two cases are identical!
  • CDHtmlDialog: Changing HTML File Dynamically

    question c++ javascript html css
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    5 Posts
    0 Views
    M
    I like the idea of building a web based VM, shouldn't take him more than a few years dint you think? ;) "The whole idea that carbon dioxide is the main cause of the recent global warming is based on a guess that was proved false by empirical evidence during the 1990s." climate-models-go-cold
  • How to use ReadFile API Read HID Device synchronous

    question json help tutorial
    3
    0 Votes
    3 Posts
    2 Views
    H
    I can't understand your question well. Firstly, you read the file synchronous, so if no fails happens, it will be blocked here if no data income. I think so, happy to communicate with you !
  • C++ - code executed upon definite program termination

    c++
    11
    0 Votes
    11 Posts
    1 Views
    H
    Let met think. If you don't think it is complex, hook is a good solution for this. You can hook the ExitProcess API in win32 by inline, IAT or something you can do. Because a process exits in windows through invoke the ExitProcess by itself, so after CRT lib destructs all the objects, it will invoke ExitProcess, at that time, the control flow will give you a chance to execute your code. If you don't know how to complete it, I can give a piece of code that i wrote before. Nice to make friends with you ! My email, Henzox.7@gmail.com
  • Powerpoint Application in vc++

    c++ help
    2
    0 Votes
    2 Posts
    0 Views
    K
    I am also in search of the same... :D
  • SetWindowText Blinking problem

    help
    7
    0 Votes
    7 Posts
    0 Views
    E
    Thank you, I think this is what I need.
  • 0 Votes
    11 Posts
    0 Views
    H
    Yeah, I can't agree with you any more ! Sometimes, i should delay a short time precisely, I think free loop is useful. just like wait some uart data in real OS. May I get your email, i just want to contact with you frequently! :)
  • Operator overload question

    help question
    7
    0 Votes
    7 Posts
    0 Views
    CPalliniC
    You have to change the method signature. It is safe to add a C-like string to a MyString object and then return a reference to the latter: MyString & operator+(MyString & iMyStr, const char * str); Veni, vidi, vici.
  • 0 Votes
    4 Posts
    0 Views
    L
    Hi, trinh.nguyen wrote: But I still wonder this: If there is no "=" operator defined for that class, what will be implemented for "=" operator? Binary copy? If you do not write an assignment operator for your class the compiler will generate a default assignment operator that performs a memberwise copy[^] of base classes and members. Have a look at section 12.8 paragraph 15: www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3690.pdf[^] Best Wishes, -David Delaune
  • #imports for MS Office2013

    question announcement
    6
    0 Votes
    6 Posts
    12 Views
    S
    Hello Bryan Thanks for sharing the link as well. I commented the import statement, and it worked fine. I have checked the functionality of the classes though. Thanks Sujay My Blog
  • Software USB write blocker for linux

    c++ windows-admin linux help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to change tab event of property sheet

    debugging tutorial
    4
    0 Votes
    4 Posts
    0 Views
    L
    Hi, You should be getting a CPropertyPage::OnKillActive [^]call when you tab to the next page. If this is not working... then the way to debug this would be checking the CWnd::OnNotify[^] handler and make sure your WM_NOTIFY is not consuming the PSN_KILLACTIVE notification code[^]. Best Wishes, -David Delaune
  • solar irradiance c++ program

    c++ help
    4
    0 Votes
    4 Posts
    1 Views
    L
    Its very simple, from an IT perspective. Your hardware, whatever it is that measures radiation, plugs into your serial/USB port, your app opens that, and takes readings on a periodic basis, collates them, and averages them. The problem is how you distinguish solar radiation at the surface from back radiation from GH gasses. (assuming you will be measuring at the surface and not TOA).
  • GetWindowRect(),GetClientRect() question

    question
    2
    0 Votes
    2 Posts
    0 Views
    L
    Hi, It's all relative, my dear Watson. econy wrote: ScreenToClient(&rect) gets which point? ScreenToClient will convert a screet RECT (your 'spoint') coordinates to be relative to client RECT (your 'cpoint'). In your example the top and left will be negative coordinates relative to the client top/left. Window Coordinate System[^] Best Wishes, -David Delaune