Returning a char array this way is tricky. Either you have to allocate the memory inside the function and free it outside (which is very ugly), or you can pass the pointer as a parameter of the function and manipulate its content. Anyway, it is much better to use the std::string (from the Standard Template Library) for which you don't need to care about memory usage.
Note that both of those can be sketchy if the returning function is allocating memory on the heap and expecting you to handle cleanup (very poor design, but not too uncommon, sadly). Just keep that in mind when dealing with this kind of thing.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
MSDN document says.
Maximum Path Length
In the Windows API, the maximum length for a path is MAX_PATH, which is defined as 260 characters. A path is structured in the following order: drive letter, colon, backslash, components separated by backslashes, and a null-terminating character, for example, the maximum path on the D drive is D:\<256 chars>NUL.
The Unicode versions of several functions permit a maximum path length of approximately 32,000 characters composed of components up to 255 characters in length. To specify that kind of path, use the "\\?\" prefix.
How do we create a file with path name more 260 characters ?.
i want to know that CTTListBox is not in the listbox type as i want to declare a variable of this type.
when i decalare this directly or by changing CListBox type then it gives error
plz tell me how can i use this
Call OnCreateClient in you CMainFrame class and make the changes approprialtely.
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
// TODO: Add your specialized code here and/or call the base class
// create a splitter with 1 row, 2 columns
if (!m_wndSplitter.CreateStatic(this, 1, 2))
TRACE0("Failed to CreateStaticSplitter\n");
// add the second splitter pane - an input view in column 1
if (!m_wndSplitter.CreateView(0, 1,
pContext->m_pNewViewClass, CSize(0, 0), pContext))
TRACE0("Failed to create first pane\n");
// add the first splitter pane - the default view in column 0
if (!m_wndSplitter.CreateView(0, 0,
pContext->m_pNewViewClass, CSize(200, 0), pContext))
TRACE0("Failed to create second pane\n");
// activate the input view
// return CFrameWnd::OnCreateClient(lpcs, pContext);
I am having a problem in my application, what I am doing is:
Calling a function SaveKeys(TCHAR *) within a loop and this function save the specified registry key to a .reg file,
for this using CreateProcess( ) for calling regedit.exe from command line and WaitForSingleObject( ) function.
code looks like this for (int i = 0; i < 10; i++)
// some code here
SaveKeys(cRegistryKey ); // for specified Registry Key
In addition, it seems that the invoked regedit tools cannot work in multi-instance mode. For example, I cannot start more then one regedit application from Windows menu or command line. That's why only some of your calls work.
This probably means that you cannot do multi-threaded export using regedit tool.
Your question might lead to several philosophical discussions, because it is not at all specific. So, it is not easy to try to use proper definitions without a minimum context to focus on. Anyway, I'll try.
A picture is a general term for a visual representation of something. A picture, by this definition, has to contain both aspects: it must be a representation, and it must be visual.
A bitmap, by itself, will not be a picture. It will just be a sequence of bits. It will become a picture when you display it on a screen, or when you print it on a piece of paper, or when you make it visible in any way.
So, generally speaking, a bitmap is a way to store image data, so that it can be represented as a picture (when used by a display device). Note that so do JPEG, TIFF, GIF, PNG, and many more image data storage formats. None of them are pictures until they are displayed.
Most often with computers the term bitmap is used to refer to the storage of picture data without compression. In this form, there is a data unit for each pixel. For example, an RGB bitmap will contain 3 bytes for each pixel. In a 6 mega-pixel image from your digital camera the bitmap would then have 18 MB in size.
The general oposite of using the term bitmap is usually to refer to compressed images. In these formats, a data unit is used to represent a larger number of pixels. For example, a high quality JPEG would typicall have 0.3 bytes per pixel (about 10 times less than bitmaps). By allowing JPEG compression to discard more and more information then you can have as few as 0.06 bytes per pixel (a single byte will generate enough information to draw more than 16 pixels) and you may still recognize the picture it intends to represent. There are also, of course, lossless compression formats.
To back this up here are google's definitions:
define:picture - a visual representation (of an object or scene or person or abstraction) produced on a surface; "they showed us the pictures of their wedding"; "a movie is a series of images projected so rapidly that the eye integrates them"
define:bitmap - The method of storing information that maps an image pixel, bit by bit. There are many bitmapped file formats, .bmp, .pcx, .pict, .pict-2, tiff, .tif, .gif (89a), and so on. Most image files are bit mapped. This type of file gives you the ´jaggies´, when examined closely you can see the line of pixels that create edges. Bitmap images are used by all computers. The desktop or screen information for all Windows machines uses .bmp files, while the Macintosh uses pict files.
If you take these definitions too far you will run into problems. People could argue that you can have a bitmap of all black pixels, representing no light at all, and that that bitmap can never be represented as a picture. The basis for this argument, is that since a picture is defined as a visual representation, then it must contain some light. If it does not show any light then it is not a picture. However, the bitmap can have all its pixels coded as "light absence" (or black) thus, in fact, that bitmap could be said to represent no picture.