Announcement

Collapse
No announcement yet.

Excel.inc and Win32API.inc issue

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

  • Excel.inc and Win32API.inc issue

    I know there have been a few posts on the issues related to using the excel.inc file that was included with the sample files and the win32api file at the same time, however, I am having difficulty understanding a solution and what that mean for the code I have written that uses these inc files separately, which I am not trying to combine into a single application.

    Any direction, the more easy to follow, the better, would be appreciated.

    Thanks in advance,

    David

  • #2
    Excel.inc has declares and definitions for Excel COM.
    Win32api.has declares and definitions for Windows API procedures, UDTs and constants, and links to other API includes that do the same.

    Either can have a mis-match with a programmer's code, but a mutual mis-match between them would be unlikely because they don't "cover the same ground".

    The PB includes and Jose includes have mis-matches between them. Use only one kind with a particular module.

    A common mis-match is byref vs. pointer byval.

    Once you pick which includes to use, you correct your source to match.

    Cheers,
    Dale

    Comment


    • #3
      Dale,

      I an grateful for your reply, but could use something a little more specific as a solution. I have been using PowerBasic since the 1989 Turbo Basic days, so I am old and this is and fixing the issue to use both includes at the same time is a little above my pay grade.

      Anything you can do, to dumb down the explanation so that I might be able to use both includes, would be appreciated.

      Regards

      David

      Comment


      • #4
        Also been using since TurboBASIC.

        You should not have a problem using Excel.inc and Win32API.inc at the same time. They contain definitions for completely different things.

        Have the includes been modified? Version of PB? Are the includes and source from that same versions' install?

        Best would be some (otherwise compilable) code that demonstrates the error you're getting.

        At least the entire logical line of code where the error occurs, error number, which file the error iine is in.

        Cheers,

        (can't fix it till we know what's broke! info...info...info)

        Dale

        Comment


        • #5
          Is the problem with paths to the .inc files in the two #INCLUDE lines your source?

          Comment


          • #6
            Hey guys,

            Incredibly grateful for the help. The issue is what is referred to by the compiler as a likely conflict with INTERFACE IDBIND ARC

            I am using the Excel and Win32API Include files that came with the CC. I have seen others have had this issues, but not sure an easy way (or at least easy t understand way) to fix it.

            Thanks again.

            David

            Comment


            • #7
              Would that be error 477 maybe?

              Anyway, on Help Search put "IDBIND" (without quotes) in the search for box press list topics. Some interesting stuff in there. (like early or late binding differences.)

              ARC is a keyword, don't use to name anything. Use like MyARC or ARC1 or something to name variable, method, property, etc.

              What is the version of Excel you have installed vs. the version the the one with PBCC is for? Mostly not much difference, but you can make an include file for your installed Excel with the COM Browser (IDE Tools menu item)

              I do not see an Excel.inc vs. Win32API.inc conflict.

              With no failing source code, and going beyond me into objects, I think I'm done here.

              Cheers,
              Dale

              Comment


              • #8
                Hi Dave,

                ..likely conflict with INTERFACE IDBIND interfacename

                (eg Error 466) Can occur when the compiler finds that the interfacename is already in use.

                It occurs, for example, when you add #Include "win32api.inc" to the source code for the samples provided with PBCC6.
                C:\PBCC60\samples\Objects\Excel\EXCELAP1.bas & EXCELAP2.bas.

                Those samples call upon a supplied version of Excel.inc in the same folder.
                If you look at the start of that Excel.inc file you will see..
                Code:
                ' Generated by: PowerBASIC COM Browser v.2.00.0086
                ' Date & Time : 03/08/11 at 9:22 AM
                ' Options:
                ' Always use an Interface Prefix : Off    ' << NB safer to have this On !!
                ' Interface Prefix               : Excel
                ' Prefix ProgIDs, ClassIDs...    : On
                ' Use ANSI Strings               : Off
                ' Use Singular Enumerations      : Off
                ' Generate Dispatch Interfaces   : On
                ' Include Parameter Names        : On
                ' Use Property Get/Set statements: On
                ' ------------------------------------------------
                ' Library Name: Excel
                It so happens that some of the generated Inteface IDBIND declares created by Pbrow.exe have interfacenames which are duplicates of Function Names declared in WinGDI.inc (internally referenced by win32api.inc), - and that's not allowed !

                When duplication like that occurs, one way to resolve the problem is to re-generate the Excel.inc file using the COM Browser option "Always use an Interface Prefix. (See help topics under 'Com browser' in the PBCC Help file).
                That way you can turn the Interface IDBIND interfacename into something more likely to be unique (ExcelARC for example).
                Last edited by Dave Biggs; 4 Sep 2018, 04:26 AM. Reason: Removed suggestion to use Int_ as prefix -- leaving Excel as per original means less editting in samples
                Rgds, Dave

                Comment


                • #9
                  Thank you Dave, Dale and Stuart for the help. I appreciate it.

                  Comment


                  • #10
                    There are multiple variables in the EXCEL.inc and the WIN32API.inc that are the same. This is a copy of the EXCEL.inc that i went through and commented out all the variables that conflicted with the WIN32API.inc, This works for me.
                    Attached Files

                    Comment

                    Working...
                    X