Author Topic: Com browser output causes bug - macro conflicts  (Read 2529 times)

0 Members and 1 Guest are viewing this topic.

Offline Murray Ruggiero

  • Newbie
  • *
  • Posts: 18
Com browser output causes bug - macro conflicts
« on: January 12, 2011, 04:27:06 PM »
I created 3 files with the COM browser.
The contents of one of them (ADOR.inc) had:
MACRO SearchDirection = LONG
MACRO ADO_LONGPTR = LONG
MACRO PositionEnum_Param = LONG   
but powerbasic tells me that: these macros have invalid names.
I'm thinking there may be some name-conflict with a previous include.
Here are the includes I used:

#INCLUDE ONCE "WIN32API.INC"  ' include windows api calls
#INCLUDE ONCE "/ROUGHSETSCONTAINERLAPTOP/ComBrowserOutputGeneral/ADODB.INC"
#INCLUDE ONCE "/ROUGHSETSCONTAINERLAPTOP/ComBrowserOutputGeneral/ADOR.INC"
#INCLUDE ONCE "/ROUGHSETSCONTAINERLAPTOP/ComBrowserOutputGeneral/ADOX.INC"

These are based on 3 Microsoft libraries: (see list of 3 here:)
Program Files\Common Files\System\ado\msado15.dll#Microsoft ActiveX Data Objects 2.8 Library
\Program Files\Common Files\System\ado\msador15.dll#Microsoft ActiveX Data Objects Recordset 2.8 Library
\Program Files\Common Files\System\ado\msADOX.dll#Microsoft ADO Ext. 2.8 for DDL and Security

So in other words, if you use the #include statement with the COM browser output from 3 different Microsoft libraries, you get an uncompilable program.  Note: I am not using Jose's browser here, I'm using the browser that comes with Pbasic.
So my questions are:
1) is this due to a macro being renamed twice (in 2 different libraries)
and
2) would jose's browser have the same error
and
3) is there anything I can do about it?
Thanks,


Offline Murray Ruggiero

  • Newbie
  • *
  • Posts: 18
In my previous post (an hour ago) I said that when you use the COM browser on multiple Microsoft libraries and try to include the resulting INC files, you get conflicts.  You can get the same MACRO defined twice for instance, which causes error.  I can solve this simply by programmatically going through the INC files and removing duplicate definitions in the entire group.  However, thats not the whole problem.  I'm getting other types of conflicts as well.  Here is an INTERFACE PROPERTY conflict:

 INTERFACE Properties $IID_ADOX_Properties
    INHERIT IDISPATCH

    PROPERTY GET COUNT <1610743808> () AS LONG   <--- CONFLICT!!!
    METHOD Meth__NewEnum <-4> () AS IUNKNOWN
    METHOD Refresh <1610743810> ()
    PROPERTY GET ITEM <0> (BYVAL Item AS VARIANT) AS i_Property
END INTERFACE 
What can I do about this particular problem? 
Thanks,

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 1110
  • Gender: Male
    • it-berater
Re: Com browser output causes bug - macro conflicts
« Reply #2 on: January 12, 2011, 04:56:58 PM »
Quote
So my questions are:
2) would jose's browser have the same error

Would it not be fair that you at least take the time to try that yourself?
Remember Jose gives you the COM Browser for free. And now you expect him to also solve your problems ... for free?

Quote
3) is there anything I can do about it?

Yes, use Jose's includes and Jose's COM-Browser, and if the problem is still there then post again.

PS: I have merged the topics because they belong together, Please do not open new topics with the same thing.
« Last Edit: January 12, 2011, 05:01:52 PM by Theo Gottwald »

Online José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 3126
  • Gender: Male
    • José Roca Software
Re: Com browser output causes bug - macro conflicts
« Reply #3 on: January 12, 2011, 05:11:35 PM »
Quote
What can I do about this particular problem? 

Use prefixes in interface names. You can't have different interfaces with the same name.