© 1995-2002 realtech VR. All rights reserved.
When you want to port applications from a platform to an other, it sometimes the pain to convert user dialog box since there is no standard for constructing.
Since the Microsoft Visual C++ has a quite convenient graphical interface for building dialog boxes, menus and save into such called 'Resource file' (.RC), and since I wanted to convert some dialog boxes to BeOS platform and since the both OS have the same 'logic' of user interface (window with press button, check boxes, list boxes etc..) WinRC2Be was born.
This program reads a .RC files and generates source code for BeOS with the same layout, exporting menu, windows and all widgets like press button, text, etc..., bitmap and icon (yes!)
This program is beta version and Open Source (MIT style) and will placed on SourceForge.net soo
Copyright (c) 2002 realtech VR
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The syntax is
w32rc2be <Resource file.RC>
Files as input
- Your .rc source file
- Your bitmaps files (BMP, ICO format). Please notes that BeOS is CASE sensitive.
- The file resource.hFiles as output
RApplication.cpp : The main program, where the BApplication is instanced
RApplication.h : the related C++ header of the application.
RWindow.cpp: this will create the function BWindow *LoadResource(unsigned id) . With this function, you can load your dialog.
RWindow.h: the related C++ header of the dialog boxes
RView.cpp: this contains the equivalent source code of the dialog box creation.
RView.h: the related C++ header of the dialog boxes
How to uses the generated source code.
Create a new project under BeOS with theses files described above. You may need the RBitmapLoader.so library that contains that exports .BMP and .ICO into BBitmap (provided)
Assuming you want to display the dialog box named IDD_FORMVIEW; here is the source code.
Win32:
#include "resource.h"
DialogBoxParam( hInstance, MAKEINTRESOURCE(IDD_FORMVIEW), NULL, (DLGPROC) myWindowProc, NULL);BeOS:
#include "resource.h"
BWindow *myWindow = LoadResource(IDD_FORMVIEW);
myWindow->Show();
Note that resource.h is portable and is used on both platform.
Before exporting your project, you must be sure that your window resources are sorted from back to front (else, some widgets won't be visible). To do, use the Layout / Tab Order in your Visual Studio Editor and re-order correctly your window items. This will not changes you Win32 application behaviour.
Beside, it will export probably everything from your Win32 application.
b5 : First Beta Public Release
b8 : Source released
© Copyright 1995-2000 realtech VR. All rights reserved® is a registered trademark of realtechVR, 198.1995, 2000