Click here to Skip to main content
15,885,366 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
leon de boer4-Oct-19 3:52
leon de boer4-Oct-19 3:52 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
arnold_w4-Oct-19 5:44
arnold_w4-Oct-19 5:44 
AnswerRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
arnold_w3-Oct-19 7:37
arnold_w3-Oct-19 7:37 
QuestionError C2059 C2143 Pin
_Flaviu2-Oct-19 7:59
_Flaviu2-Oct-19 7:59 
AnswerRe: Error C2059 C2143 Pin
David Crow2-Oct-19 9:22
David Crow2-Oct-19 9:22 
AnswerRe: Error C2059 C2143 Pin
CPallini2-Oct-19 9:52
mveCPallini2-Oct-19 9:52 
AnswerRe: Error C2059 C2143 Pin
Richard MacCutchan2-Oct-19 21:45
mveRichard MacCutchan2-Oct-19 21:45 
QuestionDisplays the image in Picture Control. Pin
Member 126614642-Oct-19 7:07
Member 126614642-Oct-19 7:07 
I just started to study this theme, so strongly do not swear.
Tell me why this code works.
HBITMAP startBitmap = (HBITMAP)LoadImage(NULL, "D:\\159.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
m_PictureControl.SetBitmap(startBitmap);

And this does not work.
HANDLE FileR = CreateFile("D:\\159.bmp", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 
	DWORD size_file = GetFileSize(FileR, 0);
	HBITMAP startBitmap = (HBITMAP)malloc(size_file);
	DWORD dwReadW;
	ReadFile(FileR, startBitmap, size_file, &dwReadW, NULL);
	m_PictureControl.SetBitmap(startBitmap);

As I assume the buffer is necessary as it is to prepare before an image displayed on the screen. But unfortunately I do not understand how to do it.

modified 2-Oct-19 14:04pm.

AnswerRe: Displays the image in Picture Control. Pin
Gerry Schmitz2-Oct-19 7:19
mveGerry Schmitz2-Oct-19 7:19 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614642-Oct-19 7:41
Member 126614642-Oct-19 7:41 
QuestionRe: Displays the image in Picture Control. Pin
David Crow2-Oct-19 9:19
David Crow2-Oct-19 9:19 
AnswerRe: Displays the image in Picture Control. Pin
Victor Nijegorodov2-Oct-19 9:41
Victor Nijegorodov2-Oct-19 9:41 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614642-Oct-19 10:37
Member 126614642-Oct-19 10:37 
GeneralRe: Displays the image in Picture Control. Pin
Victor Nijegorodov2-Oct-19 10:49
Victor Nijegorodov2-Oct-19 10:49 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614642-Oct-19 11:04
Member 126614642-Oct-19 11:04 
GeneralRe: Displays the image in Picture Control. Pin
Victor Nijegorodov2-Oct-19 19:46
Victor Nijegorodov2-Oct-19 19:46 
AnswerRe: Displays the image in Picture Control. Pin
Richard MacCutchan2-Oct-19 21:49
mveRichard MacCutchan2-Oct-19 21:49 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614643-Oct-19 6:15
Member 126614643-Oct-19 6:15 
GeneralRe: Displays the image in Picture Control. Pin
Richard MacCutchan3-Oct-19 6:18
mveRichard MacCutchan3-Oct-19 6:18 
AnswerRe: Displays the image in Picture Control. Pin
Member 126614647-Oct-19 11:34
Member 126614647-Oct-19 11:34 
Questionsigned value is out of range for enum constant Pin
_Flaviu2-Oct-19 7:04
_Flaviu2-Oct-19 7:04 
AnswerRe: signed value is out of range for enum constant Pin
Gerry Schmitz2-Oct-19 7:15
mveGerry Schmitz2-Oct-19 7:15 
GeneralRe: signed value is out of range for enum constant Pin
_Flaviu2-Oct-19 7:43
_Flaviu2-Oct-19 7:43 
AnswerRe: signed value is out of range for enum constant Pin
Daniel Pfeffer2-Oct-19 20:11
professionalDaniel Pfeffer2-Oct-19 20:11 
AnswerRe: signed value is out of range for enum constant Pin
CPallini2-Oct-19 23:36
mveCPallini2-Oct-19 23:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.