Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
commdlg32.bi missing
#1
Hello. First post here. Have been finding some usefull information on this board.

I would like to know where I can download commdlg32.bi
I have installed FB but it only has commdlg.bi in the include/win directory. I've done a web search to no avail.

Also, is there any easy way to use C++ resource scripts in a FB app?

For example, if I have a file called menu.rc with a menu in it that I want to use in FB...
Code:
IDR_MYMENU MENU
BEGIN
     POPUP "&File"
    BEGIN
      MENUITEM "&New\tCtrl+N", ID_FILE_NEW
      MENUITEM "&Open\tCtrl+O", ID_FILE_OPEN
      MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE, GRAYED
      MENUITEM "Save &As", ID_FILE_SAVEAS, GRAYED
      MENUITEM SEPARATOR
      MENUITEM "&Close\tEsc", ID_FILE_CLOSE, GRAYED
        MENUITEM SEPARATOR
      MENUITEM "E&xit\tAlt+F4", ID_FILE_EXIT
    END

    POPUP "&Edit", GRAYED
    BEGIN
      MENUITEM "C&ut\tCtrl+X", ID_EDIT_CUT
      MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
      MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
      MENUITEM "Select &All\tCtrl+A", ID_EDIT_ALL
      MENUITEM SEPARATOR
      MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
      MENUITEM SEPARATOR
      MENUITEM "&Find\tCtrl+F", ID_EDIT_FIND
    END

    POPUP "&Window", GRAYED
    BEGIN
      MENUITEM "Tile &Horizontally\tCtrl+H", ID_WINDOW_TILEHORIZ
      MENUITEM "Tile Ver&tically\tCtrl+T", ID_WINDOW_TILEVERT
      MENUITEM "&Cascade", ID_WINDOW_CASCADE
      MENUITEM "C&lose All", ID_WINDOW_CLOSEALL
    END

    POPUP "&Settings"
    BEGIN
      MENUITEM "Opt&ions\tCtrl+I", ID_SETTINGS_PREFS
      MENUITEM "&Always On Top", ID_SETTINGS_AOTOP      
    END

    POPUP "&Help"
    BEGIN
      MENUITEM "&Help Topics\tF1", ID_HELP_CONTENTS
      MENUITEM "&About",    ID_HELP_ABOUT
    END

END

...how could I do that? :???:
Reply
#2
to compile with a resource file just include it in the command line ie

Code:
fbc main.bas res.rc

as for commdlg32

it is just commdlg.bi
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#3
Yeah it definitely includes the .rc file when I do that but I have never been able to load the menu. When I used this resource in a C++ app I used MAKEINTRESOURCE(IDR_MYMENU) for the .lpszMenuName parameter of my window class and it loaded the menu each time a window was created. Using the following code in FB

Code:
With wc
    .lpszClassName = StrPtr("GenericAppClass")            ' Class name
    .lpfnWndProc   = @WndProc                             ' Window procedure
    .style         = CS_OWNDC Or CS_VREDRAW Or CS_HREDRAW ' Class style
    .hInstance     = GetModuleHandle(NULL)                ' Instance
    .hIcon         = LoadIcon( NULL, IDI_APPLICATION )    ' Window icon
    .hCursor       = LoadCursor( NULL, IDC_ARROW )        ' Window cursor
    .hbrBackground = Cast( HBRUSH, COLOR_WINDOW+1 )       ' Window background
    .lpszMenuName  = MAKEINTRESOURCE(IDR_MYMENU)        ' Menu resource
End With

RegisterClass @wc

the menu is not loaded.


I am looking for commdlg32.bi because I am trying out the Wallace Visual Editor 1.1 and the code that it generates always seems to have the line '$include: 'win/commdlg32.bi'.

I tried changing it to commdlg.bi before I made my first post on the subject but I received an error on compiling. FB opens the commdlg.bi in a new tab when I try to compile my code and gives the message "Illegal specification, at parameter 1: num type __CDHOOKPROC as function (byval as HWND, byval as UINT....."

And the parameter that it flags is HWND.

Any ideas?
Reply
#4
OK , in the generated code you need to change it to

Code:
'$include: 'windows.bi'
'$include: 'win\commdlg.bi'

This will enable HWND, and the other data types needed

also take note that in the code these need to be changed.

Code:
GetOpenFileName (ofn)
GetSaveFileName (ofn)

to

Code:
GetOpenFileName (@ofn)
GetSaveFileName (@ofn)

I believe this is occuring because the code output by Wallace is aimed at the 0.14 version , before the Windows headers were properly converted.
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#5
And for your menu problem

examine this...

http://www.streetcds.co.uk/menutest.zip

the important bits are the defines in both the .bas and the .rc

let me now if you still have any problems
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#6
Duh! I forgot to include my defines in my main source file. I'm too used to C++ builder which wouldn't have let me compile without fixing it.

Thanks Yetifoot.

Oh, and I was able to make the Wallace generated code compile but the text on the menu didn't appear and trying to use the menu cause the app to fail. But that's ok. Now that I can use resource scripts I prefer to do it that way. The code is much more elegant than the generated code.
Reply
#7
i had the thing with the text not appearing. there is a font that comes with wallace and it needs to be in the current directory. make sure you've got it (and not just a 0 byte empty file), and the text boxs/etc should work.
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)