|
Simply send a custom message in the derived dialog to the base-class dialog.
~RaGE();
|
|
|
|
|
Hello
How a control can know which other controls are present in the container?
Like a edit control in VB can know if there is a Database control and attach it to it in the property browser.
Means we can communicate between controls using the caontainer. How can it be implemented in MFC ocx control development? can any body suggest some idea to me.
I am a novice in ActiveX control, so soory for any stupidity.
Regards
Anil
|
|
|
|
|
Can we display the items in a list control in the folllowing format:
Name:
"Checkbox control" Text:
Size:
"Checkbox control" Text:
that is i need different styles for different items in the same row. is this possible?
|
|
|
|
|
No, not for the normal MFC lsit control. Check on CP for custom-drawned list controls that handle this.
~RaGE();
|
|
|
|
|
hello all,
can i give XML style comments in VC++.Net. so that i can have in built documentation. Is it possible in VC++.net. If so am i need to set any settings at the time of building the project.
Thanking u in advance.
regards,
Basheer
|
|
|
|
|
I was trying to retrieve the USB's VID(vender IDentifier) with the SetupDi* function, and I was expected to provided with a hexadecimal number like 0X-* to compare against, but actually It was a human readalbe string like say "Samsung". When I look into the registry, I found out under the registry path HK_LOCAL_MACHINE/SYSTEM/CONSTROLSET001/Enum/USB there contains several USB VIDs, but none of them contain human readable string they're just numbers. But when I look down further there's a USBSTOR directory which has the name like "Disk&Ven_FUJITSU&Prod_MHT2030AT&Rev_009B", "FUJITSU" is just what I wanted. Is there any corresponding relation exists between USB and USBSTOR directory, How Can I retrieve the human readable one?
|
|
|
|
|
hey if u have worked on USB
& have sufficient knowledge then can u pls
tell me some links for USB Programing through
VC++ .
I have a small Embedded device form which i need
to get the data throught the USB connection .the
data is then to displayed in specified formates.
Thats it
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
in short I wana muti-language viewer as like listctrl or ms-excel.
I can't find that simple source or site.
can you give me it information?
|
|
|
|
|
What are you hoping for here ? A control that translates for you ? The way to do this is to keep string tables per language, and populate your list control based on the language chosen. There's no point in a control being told a language, and holding the strings for all languages, you'll only ever need to display one, right ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In my point is How can make that TreeList support Muti-Language.
I can't editer see that support muti-language .
japan or china language is broken ms-listctrl.
How can I see not break at once two language.
|
|
|
|
|
You want to see more than one language at once ? That means you need to write your own owner drawn control.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello?
I need the Gaussian random number generator.
If you have source code, share to me pls
Thank you so much
|
|
|
|
|
|
I know using GDI+ can render a antialising string, except this method,
Has anyone make some other methods to do same work that only using GDI?
I want to use the API to realize it:
SystemParametersInfo(SPI_SETFONTSMOOTHING,
TRUE,
0,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
But failed with the work.
I went to Google to serach some methods, I found one:
<a href="http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20417650.html" rel="nofollow">http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20417650.html</a>
But it look like have not context....?
|
|
|
|
|
GDI+ does all sorts of stuff that GDI won't do as easily, that's kind of the point.
experts exchange costs money to read the answers, that's why you can't see them, if that's what you were asking.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes.
Can you tell me about 'How to remove GASP table for rendering antialising string'?I will be appreciate for your helps.;P
|
|
|
|
|
Never heard of a GASP table, and google wasn't much help, either.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i'd recommend "Christian GURUs".
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|
|
|
Hi,
How can I resize a pic (make it smaller) and store it on my hard disc?
I found this code on the web. Now I can load and store every pic, but cannot store it with other size. Who can help me with some codes? Thank you very very much!
BOOL CPicture::Load(CString sFilePathName)
{
BOOL bResult = FALSE;
CFile PictureFile;
CFileException e;
int nSize = 0;
if(m_IPicture != NULL) FreePictureData();
if(PictureFile.Open(sFilePathName, CFile::modeRead | CFile::typeBinary, &e))
{
nSize = PictureFile.GetLength();
BYTE* pBuffer = new BYTE[nSize];
if(PictureFile.Read(pBuffer, nSize) > 0)
{
if(LoadPictureData(pBuffer, nSize)) bResult = TRUE;
}
PictureFile.Close();
delete [] pBuffer;
}
else
{
TCHAR szCause[255];
e.GetErrorMessage(szCause, 255, NULL);
HWND hWnd = AfxGetApp()->GetMainWnd()->m_hWnd;
MessageBoxEx(hWnd, szCause, ERROR_TITLE, MB_OK | MB_ICONSTOP, LANG_ENGLISH);
bResult = FALSE;
}
m_Weight = nSize;
if(m_IPicture != NULL)
{
m_IPicture->get_Height(&m_Height);
m_IPicture->get_Width(&m_Width);
m_Height = MulDiv(m_Height, 96, HIMETRIC_INCH);
m_Width = MulDiv(m_Height, 96, HIMETRIC_INCH);
}
else
{
m_Height = 0;
m_Width = 0;
bResult = FALSE;
}
return(bResult);
}
BOOL CPicture::SaveAsBitmap(CString sFilePathName)
{
BOOL bResult = FALSE;
ILockBytes *Buffer = 0;
IStorage *pStorage = 0;
IStream *FileStream = 0;
BYTE *BufferBytes;
STATSTG BytesStatistics;
DWORD OutData;
long OutStream;
CFile BitmapFile; CFileException e;
double SkipFloat = 0;
DWORD ByteSkip = 0;
_ULARGE_INTEGER RealData;
CreateILockBytesOnHGlobal(NULL, TRUE, &Buffer);
HRESULT hr = ::StgCreateDocfileOnILockBytes(Buffer,
STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_READWRITE, 0, &pStorage);
hr = pStorage->CreateStream(L"PICTURE",
STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_READWRITE, 0, 0, &FileStream);
m_IPicture->SaveAsFile(FileStream, TRUE, &OutStream);
FileStream->Release();
pStorage->Release();
Buffer->Flush();
Buffer->Stat(&BytesStatistics, STATFLAG_NONAME);
SkipFloat = (double(OutStream) / 512);
if(SkipFloat > DWORD(SkipFloat)) ByteSkip = (DWORD)SkipFloat + 1;
else ByteSkip = (DWORD)SkipFloat;
ByteSkip = ByteSkip * 512;
ByteSkip = (DWORD)(BytesStatistics.cbSize.QuadPart - ByteSkip);
RealData.LowPart = 0;
RealData.HighPart = 0;
RealData.QuadPart = ByteSkip;
BufferBytes = (BYTE*)malloc(OutStream);
if(BufferBytes == NULL)
{
Buffer->Release();
HWND hWnd = AfxGetApp()->GetMainWnd()->m_hWnd;
MessageBoxEx(hWnd, "Can not allocate enough memory\t", ERROR_TITLE, MB_OK | MB_ICONSTOP, LANG_ENGLISH);
}
Buffer->ReadAt(RealData, BufferBytes, OutStream, &OutData);
if(BitmapFile.Open(sFilePathName, CFile::typeBinary | CFile::modeCreate | CFile::modeWrite, &e))
{
BitmapFile.Write(BufferBytes, OutData);
BitmapFile.Close();
bResult = TRUE;
}
else
{
TCHAR szCause[255];
e.GetErrorMessage(szCause, 255, NULL);
HWND hWnd = AfxGetApp()->GetMainWnd()->m_hWnd;
MessageBoxEx(hWnd, szCause, ERROR_TITLE, MB_OK | MB_ICONSTOP, LANG_ENGLISH);
bResult = FALSE;
}
Buffer->Release();
free(BufferBytes);
return(bResult);
}
|
|
|
|
|
Why on earth did you post all this code ?
To resize an image, create a new image of the size you want and use StretchBlt to draw the resized image onto it.
Or, if you use GDI+, you can use DrawImage in the same way.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you Christian,
After using "StretchBlt" I can use the method mentioned upon to save the image, then I'll have a small pic (with small file size) on my hard disc drive?
|
|
|
|
|
Doesn't look like it. Your best bet overall is probably to read my GDI+ articles, GDI+ makes it trivial to load and save images in a variety of formats. What VC are you using ? If VC6, you need to install a PSDK to get GDI+, if a .NET version, you should have it already.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you very much!
I will try your articles.
|
|
|
|
|
Christian Graus wrote: Why on earth did you post all this code ?
No offence meant, but surely you have noticed the normal response when someone asks for help, but does not post the code that is giving problems / does not do what they want / etc?
I think posting the code shows how he is doing things so far, so we can tell him the most appropriate way to do what he wants to do.
|
|
|
|