| |

VerySource

 Forgot password?
 Register
Search
View: 1031|Reply: 9

Newcomer's question, everyone helps to see.

[Copy link]

3

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-1-16 17:40:01
| Show all posts |Read mode
The number is declared as
void CDib :: LoadFile (const char * dibFileName);
CStrig finame;
Questions are as follows

CDib c;
CFileDialog dlg (true, "*. Bmp", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "256 bmp Files (* .bmp) | * .bmp ||", NULL);
if (IDOK == dlg.DoModal ())
filename.Format ("% s", dlg.GetPathName ());
c.LoadFile (filename);
can be completed
What is the structure of CStrig?

If you use one sentence
c.LoadFile ("c:\XX.bmp");
The file cannot be loaded
Why is that?


Why can't the bmp file generated with the brush be used?

CFile dibFile (m_fileName, CFile :: modeRead);
What does this sentence mean

filename.Format ("% s", dlg.GetPathName ());
What does this sentence mean


CFileDialog dlg (true, "*. Bmp", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "256 bmp Files (* .bmp) | * .bmp ||", NULL);
What does this sentence mean

file.WriteHuge ((LPSTR) m_pDemH, DemHeader.iDemX * DemHeader.iDemY * sizeof (int));
What does this mean, what is the difference between file.WriteHuge and file.Write?

What is the difference between HDC, CDC, HWND?

How to display the split window frame is to have a main view and a sub view, like in cs, the sub view can provide some other information.

In order to get started quickly, these questions may be asked a little white, but I still hope that the heroes answer carefully. I'm afraid I can't understand.
Reply

Use magic Report

1

Threads

27

Posts

24.00

Credits

Newbie

Rank: 1

Credits
24.00

 China

Post time: 2020-1-21 10:09:01
| Show all posts
attention
Reply

Use magic Report

0

Threads

59

Posts

43.00

Credits

Newbie

Rank: 1

Credits
43.00

 Lithuania

Post time: 2020-1-24 03:27:01
| Show all posts
c.LoadFile ("c:\XX.bmp");
To:
c.LoadFile ("c:\\XX.bmp");

CFile dibFile (m_fileName, CFile :: modeRead);
This sentence is to construct a CFile object and read the mode, but do not open the file

-----------------
Dizzy ~ You don't seem to understand every sentence, do you?
Reply

Use magic Report

0

Threads

18

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-1-24 10:36:02
| Show all posts
Agree upstairs
Reply

Use magic Report

0

Threads

57

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-24 11:27:02
| Show all posts
I feel that LZ's C ++ hurried over and then ran directly to MFC, and I don't know what MSDN is
Reply

Use magic Report

0

Threads

9

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-24 20:36:02
| Show all posts
If you use one sentence
c.LoadFile ("c:\XX.bmp");
The file cannot be loaded
Why is that? ============== c.LoadFile ("c:\\XX.bmp");



Why can't the bmp file generated with the brush be used? =========== Why not? Can you copy it from memory and save it as a bitmap?

CFile dibFile (m_fileName, CFile :: modeRead);
What does this sentence mean ========== This sentence is to construct a CFile object and read mode, but do not open the file


filename.Format ("% s", dlg.GetPathName ());
What does this sentence mean ===== Save the file path as a cstring format variable


CFileDialog dlg (true, "*. Bmp", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "256 bmp Files (* .bmp) | * .bmp ||", NULL);
What does this sentence mean ======= Open file dialog

file.WriteHuge ((LPSTR) m_pDemH, DemHeader.iDemX * DemHeader.iDemY * sizeof (int));
What does this mean, what is the difference between file.WriteHuge and file.Write?
======= From MSDN Very detailed
Writes data from a buffer to the file associated with the CFile object. WriteHuge throws an exception in response to several conditions, including the disk-full condition.

This function differs from Write in that more than 64K–1 bytes of data can be written by WriteHuge. This function can be used by any object derived from CFile.

Note WriteHuge is provided only for backward compatibility. WriteHuge and Write have the same semantics under Win32.


What is the difference between HDC, CDC, HWND? ==== respectively device environment handle device environment class window handle

How to display the split window frame is to have a main view and a sub view, like in cs, the sub view can provide some other information. === This estimate is a bit harder, you can use opengl's viewport, or vc a transparent floating window ~
Reply

Use magic Report

3

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-2-6 21:15:01
| Show all posts
In fact, I know the approximate meaning of these functions, but the meaning of the parameters is not clear, I hope to explain.
Reply

Use magic Report

0

Threads

59

Posts

43.00

Credits

Newbie

Rank: 1

Credits
43.00

 China

Post time: 2020-2-7 11:00:01
| Show all posts
See MSDN
Reply

Use magic Report

0

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-2-7 18:00:02
| Show all posts
Post msdn ^-^
CFileDialog :: CFileDialog
CFileDialog (BOOL bOpenFileDialog, LPCTSTR lpszDefExt = NULL, LPCTSTR lpszFileName = NULL, DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter = NULL, CWnd * pParentWnd = NULL);

Parameters

bOpenFileDialog

Set to TRUE to construct a File Open dialog box or FALSE to construct a File Save As dialog box.

lpszDefExt

The default filename extension. If the user does not include an extension in the Filename edit box, the extension specified by lpszDefExt is automatically appended to the filename. If this parameter is NULL, no file extension is appended.

lpszFileName

The initial filename that appears in the filename edit box. If NULL, no filename initially appears.

dwFlags

A combination of one or more flags that allow you to customize the dialog box. For a description of these flags, see the OPENFILENAME structure in the Win32 SDK documentation. If you modify the m_ofn.Flags structure member, use a bitwise-OR operator in your changes to keep the default behavior intact.

lpszFilter

A series of string pairs that specify filters you can apply to the file. If you specify file filters, only selected files will appear in the Files list box. See the Remarks section for more information on how to work with file filters.

pParentWnd

A pointer to the file dialog-box object ’s parent or owner window.

Remarks

Call this function to construct a standard Windows file dialog box-object. Either a File Open or File Save As dialog box is constructed, depending on the value of bOpenFileDialog.

To allow the user to select multiple files, set the OFN_ALLOWMULTISELECT flag before calling DoModal. You need to supply your own filename buffer to accommodate the returned list of multiple filenames. Do this by replacing m_ofn.lpstrFile with a pointer to a buffer you have allocated , after constructing the CFileDialog, but before calling DoModal. Additionally, you must set m_ofn.nMaxFile with the number of characters in the buffer pointed to by m_ofn.lpstrFile.

To allow the user to resize an Explorer-style dialog box using either the mouse or keyboard, set the OFN_ENABLESIZING flag. Setting this flag is necessary only if you provide a hook procedure or custom template. The flag works only with an Explorer-style dialog box; old-style dialog boxes do not permit resizing.

The lpszFilter parameter is used to determine the type of filename a file must have to be displayed in the file list box. The first string in the string pair describes the filter; the second string indicates the file extension to use. Multiple extensions may be specified using ';' as the delimiter. The string ends with two '|' characters, followed by a NULL character. You can also use a CString object for this parameter.

For example, Microsoft Excel permits users to open files with extensions .XLC (chart) or .XLS (worksheet), among others. The filter for Excel could be written as:

static char BASED_CODE szFilter [] = "Chart Files (* .xlc) | * .xlc | Worksheet Files (* .xls) | * .xls | Data Files (* .xlc; *. xls) | * .xlc; *. xls | All Files (*. *) | *. * || ";
Reply

Use magic Report

0

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-2-7 18:30:01
| Show all posts
CFile :: WriteHuge
void WriteHuge (const void * lpBuf, DWORD dwCount);
throw (CFileException);

Parameters

lpBuf

A pointer to the user-supplied buffer that contains the data to be written to the file.

dwCount

The number of bytes to be transferred from the buffer. For text-mode files, carriage return--linefeed pairs are counted as single characters.

Remarks

Writes data from a buffer to the file associated with the CFile object. WriteHuge throws an exception in response to several conditions, including the disk-full condition.

This function differs from Write in that more than 64K–1 bytes of data can be written by WriteHuge. This function can be used by any object derived from CFile.

Note WriteHuge is provided only for backward compatibility. WriteHuge and Write have the same semantics under Win32.

I wo n’t post it too ^-^
Look for it by yourself ^-^
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list