• Welcome to Theos PowerBasic Museum 2017.

News:

Attachments are only available to registered users.
Please register using your full, real name.

Main Menu

Com browser output causes bug - macro conflicts

Started by Murray Ruggiero, January 12, 2011, 04:27:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Murray Ruggiero

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,


Murray Ruggiero

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,

Theo Gottwald

#2
QuoteSo 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?

Quote3) 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.

José Roca

Quote
What can I do about this particular problem? 

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