|
Because you are still doing it wrong. Creating Windows applications that correctly display bitmaps, textboxes, listboxes etc., is standard and works all round the world. If you want multiple controls in a single Window then you must place them alongside, not on top of, each other. The best way to do that is to use a Dialog which is designed for exactly that purpose.
|
|
|
|
|
PotatoSoup wrote: ...and place buttons and listboxes, etc. on that window... Are you adding these controls at runtime?
"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
|
|
|
|
|
He is doing it runtime, go to his first post you can see he is inserting the ListBox into the main window, that code will be in the WM_CREATE of a window or WM_INITDIALOG of a dialog.
I assumed in his rather crazy round about way what he was asking is to paint the ListBox to a memory DC rather than the screen DC.
He seems to be calling HDC "buffers" see his names ===> HDC_of_FRONT_BUFFER
Anyhow that is easy you just use the WM_PRINTCLIENT message which you subclass onto a class and handle it.
WM_PRINTCLIENT message (Winuser.h) - Win32 apps | Microsoft Docs[^]
You use that mainly for printing a screen capturing of a window or remote terminal programs where you need to send the screen data.
So I gave him an example that does that, but he either doesn't understand or he is doing something really strange.
In vino veritas
|
|
|
|
|
I'm glad you understood it. I was just rolling rocks to see what crawled out.
"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
|
|
|
|
|
I`m trying to build a barebones MFC app. I`m used to C# Forms, but I`m having a tough time in MFC though.
I`m creating a new MFC app in the New Project dialog and in the Wizard I pick Dialog based app as app type. However after creation I can`t open the resource (in the resource view) to fill it with controls.
|
|
|
|
|
I have not used MFC for years, and I would not recommend it for any new projects. As to the problem, it is difficult to guess what the issue is without more details.
|
|
|
|
|
it`s a totally fresh project, no edits after pressing the `Finish` button in the create app wizard/dialog. I`m expecting to be able to add new controls from ToolBox but obviously something is missing...
|
|
|
|
|
I do not think MFC apps make use of the Toolbox. If you double-click the resource file (projectname.rc) in Solution Explorer, it should open the Resource Editor where you can add the various controls to your dialog.
|
|
|
|
|
fearless_ wrote: ... after creation I can
t open the resource (in the resource view) to fill it with controls.</blockquote><br />
Define "can t open the resource".
If you open the resource View then what do you see in it?
|
|
|
|
|
fearless_ wrote: ... after creation I can`t open the resource (in the resource view) to fill it with controls.
Define "can`t open the resource".
If you open the resource View then what do you see in it?
|
|
|
|
|
I don`t see the resource. I probably just need a mere WinMain.
modified 6-Apr-20 9:59am.
|
|
|
|
|
fearless_ wrote: I don`t see the resource. I already told you where to find it, or you can just use the View menu item to open the Resource View.
|
|
|
|
|
Sorry my wording is wrong, I can`t see the designer.
|
|
|
|
|
What designer are you referring to?
|
|
|
|
|
the screen area where the dialogs are assembled.
|
|
|
|
|
In have explained twice already, open the resource view, either from the View menu, or use Ctrl+Shift+E.
|
|
|
|
|
I got it, but only after you closing and opening the project again. Sorry for making ripples over nothing.
|
|
|
|
|
I need help in dealing with a picture control. How do you access/change the picture control data (within a click button event) ?
|
|
|
|
|
The recommended MFC way is to create a control member variable (of the type CStatic or any derived from CStatic class) for this picture control. Then you will be able use all the methods of this class.
|
|
|
|
|
I want to use a plain (basic) Win32 approach with an exposed WinMain. It`s not a rich Win App, I only need a button or two, a textbox and a listbox (besides the picture box)
modified 9-Apr-20 5:29am.
|
|
|
|
|
fearless_ wrote: I want to use a plain Win32 approach with an exposed WinMain. It`s not a rich Win App, ... |
Then why is your subject "basic MFC app"?
|
|
|
|
|
I made my mind. MFC is too much of a hassle. It crossed my mind to make a new thread, but I thought it would be better to keep rolling with this one.
|
|
|
|
|
|
|
#include <iostream>
#include <conio.h>
using namespace std;
float addition (float &a, float &b){
float sum = a + b;
b+=b;
return sum;}
float int{
float x, y, c, d;{
cout<<"Masukan nilai x : ";
cin>>x;
cout<<"Masukan nilai y : ";
cin>>y;
c = 6;
d = 4;
cout << "Nilai x sebelum memanggil fungsi addition = " << c << endl;
cout << "Nilai y sebelum memanggil fungsi addition = " << d << endl;
cout << "------------------------------------------- " <<endl;
cout<<addition(c,d);
="" cout<<="" "nilai="" setelah="" memanggil="" fungsi="" addition"="" <<endl;
="" cout<<"nilai="" penjumlahannya="" adalah="" :"="" <<endl;
getch();}<pre="">
|
|
|
|