Project File

Answers to general questions about Windows programming.
Ron Allen
Member
Posts: 5
Joined: Sun Jan 11, 2015 11:20 pm

Project File

Postby Ron Allen » Fri Jan 23, 2015 3:55 pm

Hello,
I have added a '.BAS' file to a project. How do I get the project to 'see' it.
When I call a sub or function in the added file. The compiler thinks it is not there. The sub and functions are declared in the added file.

thanks,
Ron

TechSupport
Site Admin
Posts: 809
Joined: Tue Sep 14, 2004 7:55 pm
Location: Mississauga ON, Canada

Re: Project File

Postby TechSupport » Fri Jan 23, 2015 6:47 pm

The project knows about the file, but the code generator does not write an #include metastatement
for it. You will have to manually add the #include metastatement to the main project file.

When you open the main file in a project, you will see code similar to the following:

Code: Select all

' >>PHNX_BEGIN_OPTIONS
'=========================================================================================
#DIM ALL
#REGISTER NONE
#COMPILE EXE
#OPTION VERSION4
'=========================================================================================
' >>PHNX_END_OPTIONS

' >>PHNX_BEGIN_WINAPI
'=========================================================================================
' The following constants define the minimum required platform.  The minimum required
' platform is the earliest version of Windows, Internet Explorer etc. that has the
' necessary features to run your application.  Wnen defined, they enable features
' available on platform versions up to and including the version specified.
%NTDDI_VERSION                                = &H05010000
%WINVER                                       = &H0501
%WIN32_WINNT                                  = &H0501
%WIN32_IE                                     = &H0600

#Include Once "WIN32API.INC"
#Include Once "COMMCTRL.INC"
#Include Once "UTILITY.INC"

#Link "E:\VolPhoenix\Phoenix3\bin\Layout32.sll"
'=========================================================================================
' >>PHNX_END_WINAPI

' >>PHNX_BEGIN_CONSTANTS
'=========================================================================================
'--------------------------- [ Command Identifiers ] ---------------------------

%IDR_FORM1_GRIDMENU                         = 105
%IDM_FORMAT                                 = 28000
%IDM_CUT                                    = 28001
%IDM_COPY                                   = 28002
%IDM_PASTE                                  = 28003
%IDM_DELETE_ROW                             = 28004
%IDM_DELETE_COLUMN                          = 28005

'--------------------------- [ Control Identifiers ] ---------------------------

' Form1
%IDD_FORM1                                  = 100
%IDC_FORM1_GRID1                            = 101
%IDC_FORM1_SELECTFILE                       = 102
'=========================================================================================
' >>PHNX_END_CONSTANTS

' >>PHNX_BEGIN_GLOBALS
'=========================================================================================
GLOBAL  ghInstance      AS DWORD    ' handle of the application instance

GLOBAL  gdwADM_LAYOUT   AS DWORD    ' identifier of registered message
' Purpose: sent to a top-level window to apply layout rules when
'          the window is resized or a splitterbar is moved.
' wParam:  handle of window associated with the layout resource
' lParam:  identifier of layout resource
' Return:  N/A
'=========================================================================================
' >>PHNX_END_GLOBALS

GLOBAL g_fDataInvalid   AS LONG

' >>PHNX_BEGIN_DECLARES
'=========================================================================================
'=========================================================================================
' >>PHNX_END_DECLARES

' >>PHNX_BEGIN_INCLUDES
'=========================================================================================
#Include Once "Form1.inc"

#RESOURCE RES, "GridDemo.res"
'=========================================================================================
' >>PHNX_END_INCLUDES

#Include "MyFile.bas"

' >>PHNX_BEGIN_LOAD (programmer accessible procedures)
...
' >>PHNX_END_LOAD (programmer accessible procedures)


Code within a >>PHNX_BEGIN_xxx/>>PHNX_END_xxx block is generated by the IDE and overwritten during a rebuild
while code outside of a block is left intact. In the example above, the file, "MyFile.bas", was manually added to the project.
Notice that the #Include "MyFile.bas" statement was added such that it is not within a >>PHNX_BEGIN_xxx/
>>PHNX_END_xxx block.

This is like this for historical reasons. This IDE has been around since version 5 of the compiler. Back then there was
no forward referencing. Getting the order of the files right was a bit of a hassle. In fact, it is still problematic when
structures are involved.

Notwithstanding the above, there is a way to get the IDE to add the #include metastatement for you.

1) Form the Project menu, select the Settings command.
Or,
1) Right-click the project name in the Explorer window and select the Settings command.
2) Click the Next button until the Optional Settings page appears.
3) Select the Code Generation tab.
4) Click the Includes button.
5) Add the file you would like an #include statement generated for.
6) Click the OK and Finish buttons when done.
7) Rebuild project.

Ron Allen
Member
Posts: 5
Joined: Sun Jan 11, 2015 11:20 pm

Re: Project File

Postby Ron Allen » Fri Jan 23, 2015 9:49 pm

Hello,
Thank you for helping me out.

I was beginning to think something was wrong with my installation.
I am impressed and grateful for you very timely response to my questions, it is refreshing to have this level of support.
I have tried to use my license of 'WinLift' with your designer, no luck, and Patrice, tho helpful in other areas, offers no usable advise for implementing his product with your designer.
Do you have any experience or advice to offer on the subject of using 'WinLift' with your designer?
I have had no success with the product with Firefly and now Phoenix.

thanks for any help you may be able to provide.

Ron

TechSupport
Site Admin
Posts: 809
Joined: Tue Sep 14, 2004 7:55 pm
Location: Mississauga ON, Canada

Re: Project File

Postby TechSupport » Fri Jan 23, 2015 10:45 pm

I will have to look into this.


Return to “Windows Programming”

Who is online

Users browsing this forum: No registered users and 1 guest