Dialog sized incorrectly on Windows XP Japanese?

I have a dialog with an embedded property sheet and it looks fine on the 
english version of Windows XP, but when running on Windows XP Japanese, 
my property sheet seems to be resized wider than normal, but the 
enclosing dialog is not resized equivalently so the right edge of the 
property sheet is cut off. This only seems to occur in dialogs where 
I've embedded a property sheet.

Is there something I need to do when embedding a property sheet (or 
elsewhere) so it works correctly on non-english systems?
0
bob3920 (7)
1/7/2004 7:44:56 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
1759 Views

Similar Articles

[PageSpeed] 36

If I am not mistaken, in Japan they read things right to 
left, unlike in North America where we read left to 
right, which would affect the dialog.  In Visual C++ 
there is a property called, "Right to Left Reading 
Order," try to enable that and see if it works on the 
Windows XP Japanesse machine, that was likely the culprit.

Sincerely,

James Simpson
Straightway Technologies
http://straightway.no-ip.com
0
anonymous (74722)
1/8/2004 2:40:09 AM
"James Simpson" <anonymous@discussions.microsoft.com> wrote in 
news:058b01c3d590$bba92fe0$a601280a@phx.gbl:

> If I am not mistaken, in Japan they read things right to 
> left, unlike in North America where we read left to 
> right, which would affect the dialog.  In Visual C++ 
> there is a property called, "Right to Left Reading 
> Order," try to enable that and see if it works on the 
> Windows XP Japanesse machine, that was likely the culprit.
Incorrect. Japanese uses left to right, same as English.
What is special about Japanese: double bytes, other code page,
other fonts needed.

> I have a dialog with an embedded property sheet and it looks fine on the 
> english version of Windows XP, but when running on Windows XP Japanese, 
> my property sheet seems to be resized wider than normal, but the 
> enclosing dialog is not resized equivalently so the right edge of the 
> property sheet is cut off. This only seems to occur in dialogs where 
> I've embedded a property sheet.
How is the dialog localized? You and use an "universal" dialog and just
set the labels at runtime?
Do you set dialog/property sheet size at runtime?
If the answer is yes, then this is the wrong way to do it.
Dialogs size is expressed in dialog units and is calculated based on the 
default system font. Since this is different than the English one, the 
size of the dialog units (and of dialogs) will be different.
Anyway, you may encounter all kind of problems when localizing in any 
language.
The recomanded aproach is to localize the RC file containing the dialogs,
resizing the dialogs in the RC after translation, the load and display it.

Playing with dialogs/controls sizes at runtime is a safe recipe for troubles
and a bad internationalization practice.

If my guess about runtime size/content changes is wrong, please provide
some more details and will take it from there.


-- 
Mihai
-------------------------
Replace _year_ with _ to get the real email
0
1/9/2004 6:06:55 AM
> How is the dialog localized? You and use an "universal" dialog and just
> set the labels at runtime?

I'm actually not localizing the dialog (no translators yet) so it just 
uses the same English text (it's the same binary for all languages). I 
basically just want my English app to run on Windows XP Japanese, but it 
has this problem of the property pages being cut off. I can make it look 
okay in Windows XP-JP by making the dialog really wide, but then it 
looks bad on English systems.

> Do you set dialog/property sheet size at runtime?

When I embed the property sheet in the dialog initially, I set its 
position and size based on a placeholder picture control in the dialog 
template, but otherwise, I don't resize things at runtime. I didn't know 
of any other way to embed a property sheet in a dialog.

Here is essentially what I do to create and embed the property page in 
my dialog's OnInitDialog (the code for these functions are defined 
below...it is derived from the MFC Answer Book):

CreateEmbeddedPropertySheet( this, &mPropertySheet, FALSE );
PositionEmbeddedPropertySheet( this, &mPropertySheet, IDC_SHEET );

"IDC_SHEET" is a picture control in the dialog template where I want the 
property sheet to go.

BOOL
    CreateEmbeddedPropertySheet( 
        CWnd *              inParent, 
        CPropertySheet *    inSheet, 
        BOOL                inWizard, 
        DWORD               inStyle, 
        DWORD               inExtendedStyle )
{
    BOOL        ok;
    
    check( inParent );
    check( inSheet );
    
    if( inWizard )
    {
        inSheet->SetWizardMode();
    }
    
    ok = inSheet->Create( inParent, inStyle, inExtendedStyle );
    require( ok, exit );
    
    inSheet->ModifyStyle( 0, WS_TABSTOP );
    inSheet->ModifyStyleEx( 0, WS_EX_CONTROLPARENT );
    inParent->ModifyStyleEx( 0, WS_EX_CONTROLPARENT );
    
exit:
    return( ok );
}

BOOL
    PositionEmbeddedPropertySheet( 
        CWnd *              inParent, 
        CPropertySheet *    inSheet, 
        CRect               inNewPosition )
{
    BOOL            ok;
    CTabCtrl *      tabControl;
    CRect           tabControlRect;
    CRect           sheetRect;
    int             x;
    int             y;
    int             activePageIndex;
    int             n;
    int             i;

    check( inParent );
    check( inSheet );

    // 1 - Get current coordinates of tab control and property 
    // sheet window.
    
    tabControl = inSheet->GetTabControl();
    require_action( tabControl, exit, ok = FALSE );
    
    tabControl->GetWindowRect( &tabControlRect );
    inParent->ScreenToClient( &tabControlRect );
    
    inSheet->GetWindowRect( &sheetRect );
    inParent->ScreenToClient( &sheetRect );

    // 2 - Calculate margin between property sheet and tab control.
    
    x = sheetRect.Width() - tabControlRect.Width();
    y = sheetRect.Height() - tabControlRect.Height();

    // 3 - Move and resize property sheet window (also moves the 
    // tab window because it is a child of the property sheet window).
    
    inSheet->MoveWindow( inNewPosition.left, inNewPosition.top, 
                         inNewPosition.Width(), inNewPosition.Height() );

    // 4 - Resize tab control window to restore right / bottom margins.
    
    tabControl->SetWindowPos( NULL, 0, 0, 
                              inNewPosition.Width() - x, 
                              inNewPosition.Height() - y, 
                              SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE 
);

    // 5 - Activate each property page to prevent drawing problems.
    
    activePageIndex = inSheet->GetActiveIndex();
    n = inSheet->GetPageCount();
    for( i = 0; i < n; ++i )
    {
        inSheet->SetActivePage( i );
    }
    inSheet->SetActivePage( activePageIndex );
    
    ok = TRUE;
    
exit:
    return( ok );
}

BOOL
    PositionEmbeddedPropertySheet( 
        CWnd *              inParent, 
        CPropertySheet *    inSheet, 
        UINT                inSheetDialogItem )
{
    BOOL        ok;
    CRect       sheetRect;
    CWnd *      sheet;

    check( inParent );
    check( inSheet );
    
    // 1 - Retrieve property sheet destination position.
    
    sheet = inParent->GetDlgItem( inSheetDialogItem );
    require_action( sheet, exit, ok = FALSE );
    
    sheet->GetWindowRect( &sheetRect );
    inParent->ScreenToClient( &sheetRect );

    // 2 - Call overloaded function.
    
    ok = PositionEmbeddedPropertySheet( inParent, inSheet, sheetRect );
    require( ok, exit );
    
exit:
    return( ok );
}
0
bob3920 (7)
1/9/2004 9:36:43 PM
Reply:

Similar Artilces:

windows media player 11 for windows xp
I did a system restore on my computer because neither my dell cinema player, my windows media player, nor my windows media player would play sound when i inserted any type of dvd. It played the picture fine, but no sound. There was no problem when i play a cd though. After the restore, i couldn't open up windows media player at all, I would get a yellow symbol with an exclamation point in it saying "internal application error". How can I correct this? Does reinstalling WMP fix the internal application error? If you don't have the original install package anymore,...

Dialogs
Hi Is there any arguments to I can add to the statement below for the dialogue's "Look in:" to default to a specific folder? Application.Dialogs(xlDialogOpen).Show Thanks. >-----Original Message----- >Hi > >Is there any arguments to I can add to the statement >below for the dialogue's "Look in:" to default to a >specific folder? > >Application.Dialogs(xlDialogOpen).Show > > >Thanks. >. > You can try FileFilter = FileFilter + "Look in: name of directory,," ...

If Distribution List Contains Incorrect Addresses
We are currently using a POP3 service and are considering Exchange server. Reason: When sending an e-mail using Outlook 2000, if one of the addresses (whose domain is being hosted by the same ISP as our company) in a distribution list has an error on the name side of the address, then none of the e-mails in that transmission will be delivered. However, if the error is on the domain side “or” the address is not being hosted by the same ISP as our company, then only that recipient’s message will not be delivered - all other recipients will receive the e-mail. Question: How will Excha...

Freezpanes address
Hi all, In VBA, is it possible to determine the address at which a sheet is locked? I found a property activewindow.splithorizontal and splitvertical but they give me double length integers. Anyone know how toconvert this int an address? Kind regards, Bony -- "There are 10 types of people in this world. Those who understand Binary and those who don''t ..." Hi, You have an answer in your post in general questions -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still suffi...

Links in Outlook 2003 open Save As... dialog box
I'm not sure exactly when this started happening. Whenever I click a link in Outlook 2003 now, it opens the Save As... dialog box as well as the Website connected to the link. It doesn't matter what type of link it is; the dialog always shows up with the .exe file type selected. Any ideas? Does it oen the Save As dialog or does it open the Locate Link Browser dialog? In case of the last direct it to iexplore.exe -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -Backup and Restore -Create an Office XP CD slipstreamed with Service Pack 3 ----- "S...

How to Move Two Dialogs at Once
Hello, One of my work's project specifications is to allow users to move two Dialog boxes together so when a user moves one box, the other one moves together with the first. This is what I am trying to do: 1) Create OnMove() event //Import a function to create a Second Dialog extern "C" __declspec(dllimport) long CallDlg(); //Import a function to move a Second Dialog extern "C" __declspec(dllimport) long CallDlg2(int x, int y); void CSvg::OnMove(int x, int y) { //Detect if a user selected two-dialogs move option if (m_attach) { ...

Size of page
I have tried to change the size of my page to fit the specifications of my printer, but I can only make the pages as big as my personal printer will print. How can I make the newpaper tabloid size? Or is it impossible with this program? (Publisher 2002) If your printer cannot print tabloid, you must tile the pages. If you printer can print tabloid, setup the printer before you setup your page. Publisher can print any size you specify however unless your printer can handle large size publications, you are reduced to tiling and cutting and Elmer's glue. -- Mary Sauer MS MVP http://dgl....

How do I auto fill fields in an Internal HTML Window
I would like to auto fill the username ans password fields on an Internal HTML Window - can anyone tell me how to accomplish that? Thanks We specialize in customizing RMS for retailers. Can you email me your exact requirements and I can let you know what it would take to implement. Thank you, Ryan Sakry Program Manager rsakry@rite.us http://www.rite.us 320-230-2282 ext. 4002 (Office) 320-230-1796 (Fax) On 8/7/2010 4:44 PM, SD wrote: > I would like to auto fill the username ans password fields on an Internal > HTML Window - can anyone tell me how to accomplish th...

Dialog form Linked To Report
I have created a dialog form, on this form I select the company name from the dropdown list. when a company name is selected, then the report should be generated. presently I have a button on the form when i click on it the macro is set to propt the dialog where i have to type the name of the company, if the company name is wrong the report opens with no values, if the company name is right then I get the report. whereas what i want is insted of button I should have the List Box with company names. Which I have created. But am stuck linking this form with the report Name &q...

SOP_Document_TEMP has an incorrect record Length error
In Great Plains 8.0 Our Sales Transaction Entry, Print Invoice option throws an error occasionaly that I haven't been able to track down. The error is: 'An open operation on table 'SOP_Document_TEMP' has an incorrect record length'. If they repeate the invoice print option it works fine after 2 or 3 trys. My Sales Transaction Entry form and the Invoice are modified. I'm not able to repeate the error so it's difficult to track down. Any suggestions? Thanks Kevin R. Kevin The SOP_Document_TEMP table is a ctree temporary table which is created in the l...

Window installer service could not be accessed
Aftermath of an Xp home to XP Pro upgrade- clean install. Tried to reinstall the program files [ missing in start menu] meet with this error message: Window installer service could not be accessed. This can occur if you are running in safe Mode [ not the case here] , or if the Windows installer is not correctly installed. Corrective Action 1: ----------------------- Tried this and failed -Run-type "msiexec,ex /unregister " then "msiexec /regsever" Error message invalid instruction. Corrective Action 2: ----------------------- Checked the HKEY_CLASS...

Add "Master Number" field to the SOP_Entry window
Hi, Is there a way in modifier to add the SOP "Master Number" field to the SOP _Entry window. It is displayed on the SOP_Document_Detail_Entry window. I cannot add it as a global field so there must be a trick to it?? Thanks Because there is no Auto-Linked table to the SOP Entry form, you'll need to use VBA to pull it out of the table and display it on the window. Leslie -- Leslie Vail, CPA, MCT, MVP MCBSP-Application for Microsoft Dynamics GP MCBSP-Installation and Configuration for Microsoft Dynamics GP cell: 972-814-8550 fax: 972-692-7472 "Glen" wrote: ...

Dialog on Dialog?
Hello, Following up from a request several days ago regarding frames, I would like to ask for a little assistance on actually implimenting it! I have creating my 2 dialog templates, both have a class associated with them already. I have added an object of the kind i wish to make child of the main dialog, but I can not figure out how to go from here with rgeards to actually creating it. Could someone give me some indication pleasE? - MR MR, You will now want to investigate creating modeless dialogs. CDialog::Create is the call you use for this. Add a member variable of one of the s...

Modal dialog box question
Hi, I've created a dialog called InfoWindow. Previously I had called it like so: c_InfoWindow = new InfoWindow(); c_InfoWindow->Create(InfoWindow::IDD, this); c_InfoWindow->SetWindowPos(NULL, r, t, w, h, SWP_NOZORDER); c_InfoWindow->ShowWindow(SW_SHOW); Now I want to create it as a Modal dialog, but I can't work out how to set it's size / position at runtime. InfoWindow IW(); // somehow set properties here (SetWindowPos gives runtime error) IW.DoModal(); Hi, Could you try to pass some variables to InfoWindow before calling its DoModal()? For example: MyDlg dlg; ...

Any Tricks to decreasing Workbook size (disk space usage)?
Wondering if any of you have any suggestions for decreasing the file size for a workbook. Granted it has a LOT of sheets (aka tabs) (about 210), but not a lot of info and it grows in 2MB increments it seems - 45 rows to a sheet, 36 columns, a third of which are blank, and a third are numeric entries, the other third formulas. It is getting a bit unwielding to e-mail around and I am looking for ideas on how I can decrease the size of it. Thanks for any thoughts you may have. -- Bruce Bruce, I did an experiment where I created 6 sheets with a 36x45 block of data + a header. This came...

Trouble after XP SP2?
Anyone having problems with MS Money 2002 after doing the XP SP2 upgrade? Immediately after restarting, I was forced to dig up the Money CD so that it could reinstall itself. That seemed to work, but I am still getting Windows Installer errors suggesting that it's still trying to install Money every time I open an IE window (!). I also get them - "Error 1606 - Could not access network location" - when I open Money. I also get it when I maximize an already-open Money from the tray. Cancelling everything seems to take care of it, but what's up? How do I fix t...

how do i keep my font size when i switch years on calender
I am making calenders on size D paper (24 x 36) how do i keep my font size of 36 when I switch years Months? Highlight the month on page two, Edit, Undo Synchronize. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com http://officebeta.iponet.net/en-us/publisher/FX100649111033.aspx "kirkhardee" <kirkhardee@discussions.microsoft.com> wrote in message news:3CEB9DE9-1E89-4E87-B9B6-68CF4C549FD8@microsoft.com... >I am making calenders on size D paper (24 x 36) how do i keep my font size of > 36 when I switch years ...

How to show icon for a dialog.
Hi, I am adding a simple dialog to my aplication. This dialog is not having any customized code..I want to add my custom icon for that dialog. i mean whenever the dialog is shown it should display 16 X 16 icon in the titlebar.. so, how to do that ? Jigar In OnInitDialog method of your dialog box class load the icon using ::LoadIcon(..) and the call the dialog box's SetIcon(..) method. AliR. "Jigar Mehta" <jigar.programmer@gmail.com> wrote in message news:1141156992.695173.29930@v46g2000cwv.googlegroups.com... > Hi, > > I am adding a simple dialog to my aplic...

FIX: Untracking emails incorrectly tracked for Outlook 2003 and 2007
Hi all, As you know, it is tough to un-link or un-track emails (Outlook records in general) if you track them by mistake or link them to the wrong CRM record. The link below shows how to do it when using Outlook 2007. (I assume it is the same for CRM 3.0 and 4.0 but I cannot test the former since we just upgraded to 4.0.) http://blog.sonomapartners.com/2007/05/remove_crm_link.html The problem was doing it with Outlook 2003. I think I figured a way. You have to follow the steps in the link above but the problem was showing the CRM user fields in the email record to set them to 0. If you ope...

MailBox Size #5
I have a problem at my company. Everyone here has 100 Meg mailbox and they want more room. I think the common mailbox size is about 50 Meg. Is there a paper out there about mailbox size and performance of Outlook and Exchange? Thanks The problem is that there are many mailbox quota plans as there are administrators. Unless there is a typo, what you saying below is that everyone has 100 MB, the average size is 50 MB, and they all want more. Are you doing any sort of Mailbox Manager (clean out deleted items, sent items over 180 days, etc) to clean out unwanted/unneeded e-mail. Why do they wa...

Common dialog not registered
When trying to load the common dialog tool I get the message 'not registered' why is this and how do I register? Hi, As the message says that control isn't licensed for use in Excel except 'as I understand' in the Developer edition. I believe this performs a similar function fname = Application.GetOpenfileName(.... Mike "Cash" wrote: > When trying to load the common dialog tool I get the message 'not registered' > why is this and how do I register? ...

Chart sizes with window frame check box frozen in the checked stat
I am running Excel 2000 under Windows XP on my laptop. Under the Tools:Options menu there is a check box for "Chart sizes with window frame". It is currently checked. If I uncheck the box the check mark disappears, but when I click on "OK" nothing changes and the zoom box on the toolbar does not activate. When I open the Tools:Options menu again the check box is still checked. It will not turn off. I have tried uninstalling and reinstalling without effect. I have compared settings with my Excel 2000 installations on my desktops at home and at work (where thing...

Dynamic creation of owner-drawn button inside a dialog
Hi some months ago I created a owner-drawn button class that works really fine when assigning this class to a resource id via a DDX member variable. But now we want to reuse this class for dynamic creation of a button control inside the OnInitDialog member funtion of a dialog. Creating the control like that MyButton.CreateNULL,NULL,WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON|BS_OWNERDRAW,CRec t(0,0,100,100),this,2); seems to be OK. But the button never appeared inside the dialog. DrawItem of the button class is never called. So what may be missing? Thanks in advance Bernd How have you declared My...

Outlook '02 Network Password Dialog box
Help! I have recently added 1 additional email account to my outlook. Now everytime the email checks for messages I get a dialog box with "Enter Network Password". It comes up in the middle of the screen no matter what I am doing. I have clicked on "Save this password in your password list" box but it continues to come up everytime. Is there a way to get rid of this box? Thank you. Kris ...

Windows
I like this group very informative and helpful. But where, where do I find the equivalent group for Internet Explorer 8. Have tried but not successful Internet Explorer General Newsgroup. In your Newsreader: news://msnews.microsoft.com/microsoft.public.internetexplorer.general On the Web: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.internetexplorer.general -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "sswcharlie" <sswcharlie@discussions.microsoft.com> wrote in message news:53A...