Click here to Skip to main content
14,391,870 members

C / C++ / MFC

 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
leon de boer4-Oct-19 4:52
Memberleon de boer4-Oct-19 4:52 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
arnold_w4-Oct-19 6:44
Memberarnold_w4-Oct-19 6:44 
AnswerRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
arnold_w3-Oct-19 8:37
Memberarnold_w3-Oct-19 8:37 
QuestionError C2059 C2143 Pin
_Flaviu2-Oct-19 8:59
Member_Flaviu2-Oct-19 8:59 
AnswerRe: Error C2059 C2143 Pin
David Crow2-Oct-19 10:22
MemberDavid Crow2-Oct-19 10:22 
AnswerRe: Error C2059 C2143 Pin
CPallini2-Oct-19 10:52
mveCPallini2-Oct-19 10:52 
AnswerRe: Error C2059 C2143 Pin
Richard MacCutchan2-Oct-19 22:45
mveRichard MacCutchan2-Oct-19 22:45 
QuestionDisplays the image in Picture Control. Pin
Member 126614642-Oct-19 8:07
MemberMember 126614642-Oct-19 8: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 8:19
mveGerry Schmitz2-Oct-19 8:19 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614642-Oct-19 8:41
MemberMember 126614642-Oct-19 8:41 
QuestionRe: Displays the image in Picture Control. Pin
David Crow2-Oct-19 10:19
MemberDavid Crow2-Oct-19 10:19 
AnswerRe: Displays the image in Picture Control. Pin
Victor Nijegorodov2-Oct-19 10:41
MemberVictor Nijegorodov2-Oct-19 10:41 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614642-Oct-19 11:37
MemberMember 126614642-Oct-19 11:37 
GeneralRe: Displays the image in Picture Control. Pin
Victor Nijegorodov2-Oct-19 11:49
MemberVictor Nijegorodov2-Oct-19 11:49 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614642-Oct-19 12:04
MemberMember 126614642-Oct-19 12:04 
GeneralRe: Displays the image in Picture Control. Pin
Victor Nijegorodov2-Oct-19 20:46
MemberVictor Nijegorodov2-Oct-19 20:46 
AnswerRe: Displays the image in Picture Control. Pin
Richard MacCutchan2-Oct-19 22:49
mveRichard MacCutchan2-Oct-19 22:49 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614643-Oct-19 7:15
MemberMember 126614643-Oct-19 7:15 
GeneralRe: Displays the image in Picture Control. Pin
Richard MacCutchan3-Oct-19 7:18
mveRichard MacCutchan3-Oct-19 7:18 
AnswerRe: Displays the image in Picture Control. Pin
Member 126614647-Oct-19 12:34
MemberMember 126614647-Oct-19 12:34 
Questionsigned value is out of range for enum constant Pin
_Flaviu2-Oct-19 8:04
Member_Flaviu2-Oct-19 8:04 
AnswerRe: signed value is out of range for enum constant Pin
Gerry Schmitz2-Oct-19 8:15
mveGerry Schmitz2-Oct-19 8:15 
GeneralRe: signed value is out of range for enum constant Pin
_Flaviu2-Oct-19 8:43
Member_Flaviu2-Oct-19 8:43 
AnswerRe: signed value is out of range for enum constant Pin
Daniel Pfeffer2-Oct-19 21:11
professionalDaniel Pfeffer2-Oct-19 21:11 
AnswerRe: signed value is out of range for enum constant Pin
CPallini3-Oct-19 0:36
mveCPallini3-Oct-19 0: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.