Loading...
 
Multi-Language Add-In for Visual Studio

Multi-Language Add-In for Visual Studio


Bitmaps in Dialogues

Hi,

I'm using the trial version of the Multi-Language Add-In for Visual Studio 2005 (C++, MFC)
I encountered a problem when using dialogues with picture controls in bitmap mode (the bitmaps are added as resources in the project).
Whenever the AddIn copies such a dialog, the bitmap ids in the picture controls of the copy are lost and have to be assigned again.
It seems like the first and the last digit of the image-id are cut off in the process.
The original image ids were:
151,152,153,153,161.
The following id values were assigned to the copy:
"5","5","5","5","6".

Hope this helps.


Regards,

Benjamin

Germany

Hi Benjamin,

can you post (or send me) an example DIALOG resource containing bitmap IDs?

Do you have numeric IDs in the DIALOG resource (and not symbolic values)?

Phil


Hi Phil,
thank you for your fast reply.

I made a simple example project and added a picture control bitmap in the about box.
Here is the resource code of the dialog:

/////////////////////////////////////////////////////////////////////////////

//
// Dialog
//

IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "TESTInfo über bitmapDialogTest"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "bitmapDialogTest Version 1.0",IDC_STATIC134,40,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 2011",IDC_STATIC135,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,16,WS_GROUP
CONTROL 1333,IDC_STATIC136,"Static",SS_BITMAP,135,17,32,30

END


I used the placeholder in the dialog editor which VS assigned to the resource bitmap, but as you can see in the example, VS writes the value to the the rc file (IDB_BITMAP2 = 1333).

The control in the ml resource file looks like this:

CONTROL "33",IDC_STATIC136,"Static",SS_BITMAP,135,17,32,30


I hope this helps.

We just upgraded to the full version of your addin by the way, it saved me A LOT of work.
Thank you for that!

Ben

Germany

Hi,

Ok, I understand it now.

I have started programming a fix for this problem, but I'm not going to finish it today. I expect that I will upload a new version before Monday.

Phil

Germany

Hi,

I have just uploaded a new version, which I think fixes this problem.

Phil

> Hi,
>
> I have just uploaded a new version, which I think fixes this problem.
>
> Phil

Hi Phil,
I just tried the new version, but I think the problem is not completely solved.
When i add a new language now, the existing dialogs keep their correct id, but all dialogs for the new language still have the problem.

Ben

Germany

Hi Ben,

I have an idea what the problem might be.

Unfortunately, I've been ill for the last couple of days, and should be in bed rather than at my computer. I'll try to fix it as soon as I can.

Phil

Hi Phil,

No Rush.
Get well soon!

Ben

Germany

Hi Ben,

I've just made a modification and uploaded a new version, which I think will fix the problem.

You'll probably have to delete the incorrect DIALOG resources (or all the localized resources) from the .rc file, so that the Add-In regenerates them.

By the way, I think I have problem handling strings in the source code containing escape sequence (for unmanaged C++ projects).

Phil

Hi Phil,
that worked nicely, even without deleting the old dialogs.
Thanks!

Anyway it seems like I will keep you busy for a bit longer, but i will discuss that in a new thread wink

Ben