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
  • 0 Votes
    9 Posts
    0 Views
    L
    Yes any dialog or window can be created from templates. The window one usually catches even seasoned programmers out. If you look at the template call CreateDialogIndirectParam the DLGPROC is optional. What you do is pass in the window handler and use setwindowlong to put it onto the modeless dialog which just happens to have all the style flags of a window. Once it has the handler attached you can just insert it into any APP window or even the desktop because it's a normal window and so you fake CreateDialogIndirectParam returning a fail. Did you notice it's up to you to call DestroyWindow and that is why they don't do it automatically. Sometimes it's useful to lie to the API :-) Yes its a template you can launch multiple copies as it only gets read and all global alloc memory is thread safe. It can't write or move anything as you usually only allocate just enough space to hold the resource. I assume that all still holds true for MFC. Officially the GlobalAlloc etc is now "old" but they have not got around to giving us replacement template system. Most windows programmers are familiar with LoadResource and loading bitmap/icons/menus etc because they are going to draw them on screen alot but using the system for dialogs and windows usually escapes them because they don't need the response of a window like in your example. In vino veritas
  • 《programming game AI by example》

    game-dev sysadmin tutorial question learning
    3
    0 Votes
    3 Posts
    0 Views
    B
    thank you very much,it's really a great help. there is a lot of work to do
  • Cards.dll

    tutorial
    5
    0 Votes
    5 Posts
    0 Views
    L
    Yes, I am well aware of that, but it's the only one I know.
  • Interprocess communication in C without pipes or disk

    question discussion
    7
    0 Votes
    7 Posts
    0 Views
    C
    Brilliant. Thank you. cheers Chris Maunder
  • http://naturalhealthstore.info/grow-extreme-max/

    asp-net tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • questions plz solve throught c or c++

    c++ css
    4
    0 Votes
    4 Posts
    0 Views
    P
    We do not do your HomeWork. HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them. Any failure of you will help your teacher spot your weaknesses and set remedial actions. Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning. So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help. As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better. When you just ask for the solution, it is like trying to learn to drive a car by having someone else training. Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem. The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^] That's not the same thing as "have a quick google and give up if I can't find exactly the right code". Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein
  • 0 Votes
    8 Posts
    0 Views
    J
    Such is only useful with modeless dialogs. Modal dialogs will block so that there is usually no need to have a pointer. However: // With class member CSomeDialog *m_pSomeDlg if (NULL == m_pSomeDlg) { m_pSomeDlg = new CSomeDialog(this); } When doing so m_pSomeDlg must be initialised with NULL in the constructor and deleted in the destructor.
  • Compiler generated code

    4
    0 Votes
    4 Posts
    0 Views
    J
    leon de boer wrote: you must have your warnings turn way down because really it should give a warning. Or ignoring them. Either way a bad idea.
  • which one would be better?

    question design game-dev sysadmin help
    4
    0 Votes
    4 Posts
    0 Views
    B
    Jochen Arndt,leon de boer thank you very much,it's really a great help. Now I know how to do it.
  • which one would be better?

    design sysadmin help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Access Driver in Embedded Standard OS

    help c++ hardware question
    15
    0 Votes
    15 Posts
    0 Views
    L
    Munchies_Matt wrote: I have see all kinds of crap with this version, it takes a lot of detective work to figure out quite how MSFT broke it. Care to elaborate? Microsoft did not distribute prebuilt embedded OS images for that version. The embedded OS is built by you or someone in your organization using the 'Target Designer' which allows you to select from many thousands of packages. If anything is broken... blame the guy who builds the OS image within your organization. The license back then was very restrictive... requiring each organization to list the licensed users by name. I've built hundreds and hundreds of embedded OS images with the old XP and 2009 Target Designer... I believe the licensing is less restrictive these days... but I don't work in this area anymore so don't keep up with it. Best Wishes, -David Delaune
  • Problem in precedence of operators.

    help question
    6
    0 Votes
    6 Posts
    0 Views
    J
    Maybe the OP was manually calculating it?
  • what is pla.h ?

    question
    4
    0 Votes
    4 Posts
    0 Views
    F
    I checked it before I ask this question.... anyways thank you for the answer... I already got the answer from stackoverflow but my question got block... so I wonder how this forum will react
  • «calls-flood» service

    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    6 Posts
    0 Views
    M
    "Any way to reset the warnings so that it won't retrigger the same warnings ?"
  • Simple question about templates

    question database wpf
    5
    0 Votes
    5 Posts
    0 Views
    L
    Thanks, that is the conclusion I came to, and I resolved the issue with a slightly different implementation. I was really just trying to learn a bit more about templates, and wondered if there was any provision for automatically converting constant strings between ASCII and Unicode. It's obviously something to be aware of, and avoid.
  • Help with .lib for STD::COUT

    help c++ tutorial question announcement
    7
    0 Votes
    7 Posts
    0 Views
    L
    Hi, The unresolved symbol std::_Lockit appears to be from the Microsoft implementation of checked iterators[^] in our STL implementation. So this implies that you are #including the Microsoft STL headers and trying to link with the Intel Standard C++ Library[^]. Fix your broken #include and library paths. Best Wishes, -David Delaune
  • How to run a java script(json) from my vc++ code?

    xml question c++ java wcf
    8
    0 Votes
    8 Posts
    0 Views
    P
    Yes..I created this web service...by VS->New Web->Added Web service->vb Web Method... Do you have any suggestion for my project..? :) Pankaj
  • Manipulating of .txt file

    c++ com help question learning
    9
    0 Votes
    9 Posts
    0 Views
    A
    This is a script to do this in ruby : #!env ruby def parse(text) text.split(',').map do |item| key, value = item.split(':') [key.to_i, value.to_f] end.to_h end input_data = File.read(ARGV[0]).gsub("\r", "") id = nil entries = {} input_data.split("\n").each do |line| columns = line.split("|") id = columns[0].to_i if columns.size == 3 entries[id] ||= {} if columns.size == 3 || columns.size == 1 entries[id].merge! parse(columns.last) elsif columns.size != 0 puts "? #{line}" end end entries.sort_by { |k,v| k }.each do |key, weights| puts puts puts "# neuron #{key}" puts "source\tweight" weights.sort_by { |k, v| k }.each do |source, weight| puts "#{source}\t#{weight.to_s.gsub('.',',')}" end end Thanks for help !!!
  • Disecting a PE File

    question architecture help
    15
    0 Votes
    15 Posts
    0 Views
    L
    If you send me a direct message via the Email link below I can send you the file.