|
Hi,
I am reading unicode text from an Access database and want to put it in a combobox. The problem is that the text in the combobox appears to be plain ASCII. If I copy the text from the combobox and paste it into Word or so, I see the correct text again?
What should I do to get the unicode text displayed correctly, or is this "behavior by design"?
|
|
|
|
|
Hello, I have doubts about MFC7.0:
where can I get it?, is it free? do I have to buy it?
is used in order to get the graphical possibilies of XP and in order to get improved MFC controls and classes?
where can I get informed about that?
As always thank you very much...
|
|
|
|
|
I think if you install visual studio.net you can get it.And of cource it is not free(poor microsoft )
Also if you want xp visualization in MFC6 or later for all platform check this:
http://www.codeproject.com/useritems/themewrapper.asp
Mazy
|
|
|
|
|
when a modeless dialog is visible, I click mouse outside the dialog ,
windows send what message by the dialog?
Thank you very much!
|
|
|
|
|
When a dialog have loses the focus or get focus it's WM_SETFOCUS
with WPARAM I think with TRUE if the dialog is on focus or FALSE if not....
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Thank: Vladimir Georgiev, Rickard Andersson
the Message is : WM_NCACTIVATE
|
|
|
|
|
Windows sends WM_NC(something) that stands for No Client.
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
How can I get a rotated standard region(such as: ellise region, roundrect region)?
HRGN hRgn = CreateRectRgn(0,0,220,120);
DWORD size = GetRegionData( hRgn, 1, NULL);
RGNDATA *pData = (RGNDATA*)GlobalAlloc(GMEM_FIXED|GMEM_MOVEABLE,size);
GetRegionData(hRgn, size,pData);
double a = 0.5; // 0
xform.eM11 = (float)cos(a);
xform.eM12 = (float)sin(a);
xform.eM21 = -xform.eM12;
xform.eM22 = xform.eM11;
xform.eDx = 0;
xform.eDy = 0;
HRGN hNewRgn = ExtCreateRegion(&xform,pData->rdh.nRgnSize,pData);
// failure! why ?
GlobalFree(pData);
DeleteObject(hRgn);
DeleteObject(hNewRgn);
Thank you very much!
|
|
|
|
|
Try with
HRGN hNewRgn = ExtCreateRegion(&xform,size,pData);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
thanl: Joaquín M López Muñoz, now, I can get the rotated region!
the modify codes:
DWORD size = GetRegionData(hRgn, sizeof(RGNDATA), NULL);
RGNDATA *pData = (RGNDATA*)GlobalAlloc(GMEM_FIXED|GMEM_MOVEABLE,size);
GetRegionData(hRgn, size,pData);
a = 0.5; // 0
xform.eM11 = (float)cos(a);
xform.eM12 = (float)sin(a);
xform.eM21 = -xform.eM12;
xform.eM22 = xform.eM11;
xform.eDx = 0;
xform.eDy = 0;
HRGN hNewRgn = ExtCreateRegion(&xform,size,pData);
GlobalFree(pData);
DeleteObject(hRgn);
CodeProject.com Forum problems or suggestions?
Reply to a Message
Here you can reply to a message in the current discussion thread
Forum Visual C++
Subject: Re: How can I get a rotated region?
Sender: Joaquín M López Muñoz
Date: 2:45 31 Jan '02
|
|
|
|
|
how do i get a button to check if text has been entered into an edit box?
|
|
|
|
|
QnD way:
In the "on click" message handler for the button, call UpdateData(TRUE) to save the contents of the edit box into it's associated member variable (I assume you're using DDX). Then check the length of that string to see if the user entered anything.
Jon Sagara
What about ?
|
|
|
|
|
Use Class Wizzard to add a message map function to the EDIT Control, that will invoke its handler when it being edited. EN_UPDATE is the message you must add a handler for. Thus, this function will invoke everytime the contents of the edit control is changed.
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
Hi everyone. I have a control bar with a combo box on it, in which I want to put in all of the names of the fonts installed on the system (just like Word does, for example).
Is there an MFC or API method of getting a list of the fonts installed on the system? I serached through MSDN without much luck, maybe I am using the wrong words to search on? I only need to get the names of the fonts (like they appear in Word).
|
|
|
|
|
How about EnumFontFamiliesEx(...) ?
Jon Sagara
What about ?
|
|
|
|
|
void SNDLL_API SetFontSizeToCombo( HDC hDC,LPCTSTR lpszFamily,CComboBox & Box )
{
Box.ResetContent();
TEnumSizeDataStru Data;
Data.pComboBox = &Box; Data.yPerInch = GetDeviceCaps(hDC,LOGPIXELSY);
EnumFontFamilies(hDC, lpszFamily, (FONTENUMPROC)ProcEnumSizeToCombo, (LPARAM)&Data);
}
int APIENTRY ProcEnumSizeToCombo(
LPLOGFONT lpLogFont,
NEWTEXTMETRIC * lpTEXTMETRICs,
DWORD fFontType,
LPVOID lpData)
{
CComboBox * pComboBox = (((TEnumSizeDataStru *)lpData)->pComboBox);
LONG yPerInch = ((TEnumSizeDataStru *)lpData)->yPerInch;
CString strSize; strSize.Format("%2d",lpTEXTMETRICs->ntmSizeEM);
if( pComboBox->FindString(-1,strSize)==CB_ERR )
pComboBox->AddString(strSize);
return 1;
}
|
|
|
|
|
|
Hi, can anyone tell me how an ActiveX control can terminate its container application? I have seen this done but cannot work out how.
Also how can a control get the file location of the container application?
Any help at all would be appreciated.
Thanks, Worzle
|
|
|
|
|
Assuming the control is a child to the application (this is not always true).
Look up AfxGetMainWnd in the help.
//The following line send a WM_CLOSE message
// to the Application's main window. This will cause the
// Application to exit.
AfxGetMainWnd()->PostMessage(WM_CLOSE, 0, 0);
|
|
|
|
|
Thats great, thanks a lot!
|
|
|
|
|
can some one please tell me how to read some input like this:
" john Smith 444-44-4444
jamie Scott 333-33-3333"
and then i have to create objects of these things.
thank you
|
|
|
|
|
See to:
MFC samples by VC6
|
|
|
|
|
My application needs that i use a ComboBox and ListBox.The ComboBox will display a drive or directory in the system and my listbox will display all the subdirectories.This comboBox and listbox get displayed in a Dialog application. There is a function called CWnd::DlgDirListComboBox .As per documentation this is supposed to load a directory.
there are 2 classes in my application
CForDialog and CForApp .
I used this line of code inside InitDialog in CForDialog class .......throws unhandled exception
this->DlgDirListComboBox(_T(""),IDC_COMBO1,IDC_LIST1,DDL_DIRECTORY|DDL_EXCLUSIVE);
can u help
|
|
|
|
|
You must not give a constant string as path spec :
"
lpPathSpec
Points to a null-terminated string that contains the path or filename. DlgDirListComboBox modifies this string, which should be long enough to contain the modifications. For more information, see the following “Remarks” section.
"
HTH, Jens
|
|
|
|
|
The Directory Path must not be a static path in DlgDirList-Method!
Sample:
IDC_LIST1 is the box to be filled...
CString *temp1 = new CString("c:\\tmp\\style\\*.xsl");
LPTSTR str1 = temp1->GetBuffer(temp1->GetLength());
int ret=this->DlgDirList(str1,IDC_LIST1,0,0);
|
|
|
|