Announcement

Collapse
No announcement yet.

What is the correct Syntax?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What is the correct Syntax?

    I'm going to transfer an exiting large DLL source code to PB.
    Working with typelibs and objects is relative new in PB. So i'm currently experimenting with all functions documented in PB help file.
    The #COM statement includes "#COM NAME "LibName", 3.32" as an example.
    Below You can see some meta and com statements as an example.

    '-------------------------------------------------------------------------------------------------------
    ' META STATEMENTS
    '-------------------------------------------------------------------------------------------------------
    #Compiler PBWin 9
    #Compile Dll "c:\programme\mcadd\addon\mcAcon.dll"
    #Dim All
    #Register None

    #COM Name "DDX", 2.6.3 'This is the syntax just like in the help file.
    #COM Guid Guid$("{EE2303F2-4EF6-42F6-92AB-4241221FF278}")

    '......

    When #COM Name "DDX", 2.6.3 is used then following error is raised:
    End-of-line expected
    Line 19: #COM Name "DDX", 2.6.3
    End of line expected - No characters are allowed on a line (except for a comment) following a metastatement, END SUB, or a label.

    When #COM Name "DDX" is used then following error is raised:
    Variable expected
    Line 27: Global Object oHost As OdaHostApp
    Variable expected - A variable was expected, but not found.
    A common cause for this error is the use of a reserved keyword as a variable.

    When #COM Name "DDX", "2.6.3" is used then following error is raised:
    Syntax error - Something is incorrect on the line; however, the compiler could not determine a proper error message or decode the line further.
    A common cause is mixing two statement keywords together, using a reserved keyword for a variable name, or attempting to use an undefined COM INTERFACE member (in an OBJECT statement) when using early-binding, etc.

    What is the correct Syntax?
    Norbert Doerre

  • #2
    Use
    Code:
    #COM NAME "DDX", 2.63 'comments...
    and drop the keyword object from your global declaration
    Code:
    Global oHost As OdaHostApp
    Make sure you have that the OdaHostApp definition is before this line of code.
    Sincerely,

    Steve Rossell
    PowerBASIC Staff

    Comment

    Working...
    X