|
Hi All,
Is it possible to change width of a combo box at run time ?
ex:
I have data like
One
two
Thirteen
ThousandFourty
in the combo box.
whenever user select a string from above, combo box should be resized with the length of selected string.
Thanks..
Sheshidar P
|
|
|
|
|
Can you use of MoveWindow ?
|
|
|
|
|
|
I have a CTreeCtrl object in my dialog, this control is initialized as follows:
m_imgList.Create(16, 16, ILC_COLOR32, 1, 4);
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
m_imgList.Add(&bitmap, RGB(0, 0, 0));
bitmap.DeleteObject();
bitmap.LoadBitmap(IDB_BITMAP2);
m_nFolderImgNdx = m_imgList.Add(&bitmap, RGB(0, 0, 0));
bitmap.DeleteObject();
m_wndTree.SetImageList(&m_imgList, TVSIL_STATE);
hNewItem = m_wndTree.InsertItem(
TVIF_IMAGE | TVIF_PARAM | TVIF_STATE | TVIF_TEXT,
_T(""), 1, -1, nState,
TVIS_EXPANDED | TVIS_STATEIMAGEMASK,
(LPARAM)pData, hItem, TVI_LAST);
Later in the code I update each item of the tree control - text and image.
m_wndTree.SetItemImage(hItem, 0, -1);
However the tree control item does not update its image icon. It always display's its 1st image even I set the 0th image during the update. Any idea what is the problem ?
Thanks,
Abyss
|
|
|
|
|
Hello ALL,
I have an NTFS Compressed Disk named "J:\" & there is only one file in that disk, say "Sample.txt"
I can see the sample.txt's RAW data using WinHex in compressed form.
The Compressed's data size is 512 Bytes ( I see that in the properties of that file )
OPERATIONS STEPS:
=================
Now I open that compressed drive using LZOpenFile() function, like
// Open the compressed drive
OFSTRUCT lInputStruct;
int lSrcHandle = LZOpenFile("\\.\\J:", &lInputStruct, OF_READ); //compressed drive
// I know that the compress data of Sample.txt file starts from 3858432 location
// So I seek to that position by
long seek = LZSeek(lSrcHandle,3858432,0);
// Then I read the contents
// LZRead automatically decompress the data
unsigned char chBuffer[1024] // this buffer should be bigger
INT ret = LZRead( lSrcHandle, (LPSTR)chBuffer, 512 );
// I open another file to write the decompressed data
HANDLE lNorFile = CreateFile("I:\\sample_dec.txt", GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
CREATE_ALWAYS, NULL, NULL ); // normal file
// chBuffer holds the decompressed data
WriteFile(lNorFile , chBuffer, ret, &lBytesWrite, NULL );
// Close all the open handle
LZClose(lSrcHandle);
CloseHandle( lNorFile );
RESULT:
======
The data into I:\sample_dec.txt is similar as compressed data.
So it means the data is not decompressed.
QUESTION:
========
1. How I exactly get the Raw data of a Compressed NTFS file ?
1. How I decompress the RAW Compressed NTFS data ?
Please help me if someone can...
Thanks in Advanced
-Same
|
|
|
|
|
Can I change the default position of OK button when calling AfxMessageBox() function, by default it is on center.
Thanks,
Mushq
|
|
|
|
|
I think the only way is to create your own Dialog and place your button anywhere you want.
AfxMessageBox does not allow you to change the coordinates of buttons.
|
|
|
|
|
|
Hi,
I want to remove or disable Minimize and Maximize box from SDI Frame...
Please anybody help me....
usha
|
|
|
|
|
Hi,
The CWnd::OnCreate() method is used to create a window and it is usually meant to do this using its default configured features. Therefore, anything you want to display on the frame when the application displays, you can do so when creating the application. Therefore, the frame is typically used to create and display the toolbar(s), dialog bar(s), and status bar.
After the frame has been created, if you want to modified something on it, you can do so after it has been created but before it is displayed to the user. To do this, you can use the PreCreateWindow() method of the CWnd class.
Its syntax is:
virtual void PreCreateWindow(CREATESTRUCT& cs);
This method takes a reference to CREATESTRUCT class, modifies and returns it with the new characteristics. For example, you can use this method to remove the Minimize and the Maximize system buttons on the title bar as follows:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX);
return CFrameWnd::PreCreateWindow(cs);
}
Hope this help you..!
Good Luck..
|
|
|
|
|
Hi Jagdish,
The codes did not working..any other solutions???
regards,
usha
|
|
|
|
|
Hi Usha,
The solution i gave you must be working, might be there you are doing some mistake in implementing this technique.
Do u getting any error message..?
Please put this code at approprite place, & with proper arguments.
& sorry, i looked for other solution but failed to found..!
Better Luck this Time..
|
|
|
|
|
Do edit your CMainFrame::PreCreateWindow function not the one which is inside your view class and the statement will work...
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.style &= ~(WS_MAXIMIZEBOX);
return TRUE;
}
|
|
|
|
|
hi programmos,
in my application, i am trying to edit the boot.ini file.
so heres what i tried so far,
i created a new file named "boot.new" with all the required changes, then used MoveFileEx() to replace existing "boot.ini" with the "boot.new", but MoveFileEx returns with error.
So i tried to edit the boot.ini file directly. but if i try open boot.ini in write mode, it now fails to open the file in the write mode.
i also thought of using "bootcfg" command line utility, but then unfortunately windows xp home edition does not include this utility.
i was wondering if theres a way to edit the boot.ini file from visual c++ (programatically), in other words IM STUCK and it really SUCKS to be where im right now.
please help.
regards
~sameer (googling...)
|
|
|
|
|
It would be easier to form a response if you posted the results of the call to GetLastError().[^]
With that being said I will attempt to make a non-educated guess at what the problem could be. Perhaps the file is read-only in which case the following code may help.
DWORD dwResult = GetFileAttributes(szFullPath);
if(INVALID_FILE_ATTRIBUTES != dwResult)
{
TRACE1(_T("Overwriting file: %s\n"),szFullPath);
if(dwResult & FILE_ATTRIBUTE_READONLY)
{
BOOL bSuccess = SetFileAttributes(szFullPath,dwResult & ~FILE_ATTRIBUTE_READONLY);
}
}
|
|
|
|
|
You are having all these problems because boot.ini is readonly file!
-Saurabh
modified on Saturday, June 21, 2008 5:05 AM
|
|
|
|
|
Thanks a bunch...
it indeed was a problem with the file permissions.
i totally did not think in that direction (dumb).
im in a better place now..
thanks a lot again
regards
~sameer
|
|
|
|
|
You are welcome.
-Saurabh
|
|
|
|
|
dear all
i am confused how to get previous function data? for example:
void CAutoDetHumanDlg::OnSmoothImg(){imagedata=processedimage}
void CAutoDetHumanDlg::OnCalculateFeatures(){here i need processedimage data}
how can i obtain it from first function?
thanks a lot.
sorry, i am newbie
gentleguy
|
|
|
|
|
Make it a member of your class. This way, it will be accessible from within any of your class member function.
|
|
|
|
|
thanks for your suggestion. now i have done the first function what i mentioned in former post, now i would like to use first function data in second function, how to get it?thanks a lot
gentleguy
|
|
|
|
|
If the data belongs to the CAutoDetHumanDlg class, it is accessible by any of its members. Just use it.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
yes, you can see all belong to CAutoDetHumanDlg class, but how to get it? i don't know? sorry, thanks
gentleguy
|
|
|
|
|
gentleguy wrote: but how to get it?
Both OnSmoothImg() and OnCalculateFeatures() access the data in the same way.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Do you read and try to understand the answers that are given to you ?
|
|
|
|