PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Marc van Cauwenberghe on October 31, 2011, 07:57:15 AM

Title: OCX newbie
Post by: Marc van Cauwenberghe on October 31, 2011, 07:57:15 AM
Hi,

I followed the steps in the help file to use an ocx (http://www.mindfusion.eu/flowchartx.html).
When compiling I get following the error (see image)

Does anyone know what the problem is?

Regards,
Marc

Title: Re: OCX newbie
Post by: José Roca on October 31, 2011, 11:43:56 AM
The error message says it all. $CLSID_DataObject is already defined with a different value. Change the name. IDataObject is an standard COM Windows interface. Therefore, if they have used this name in his component, there will have conflicts because PB doesn't support namespaces. It is advisable that you generate a new include file choosing the option of adding a prefix.
Title: Re: OCX newbie
Post by: Marc van Cauwenberghe on November 01, 2011, 06:30:09 AM
Thank you Jose, that did it.

Next error: undifined type
example (now complaining about tag_STGMEDIUM_UNION):
' ========================================================================================
' _userSTGMEDIUM record <alias> wireSTGMEDIUM
' Number of members = 2
' ========================================================================================

#If Not %DEF(%tag_userSTGMEDIUM_DEFINED)
%tag_userSTGMEDIUM_DEFINED = 1

Type tag_userSTGMEDIUM
   m__MIDL_0003 As tag_STGMEDIUM_UNION                  ' _STGMEDIUM_UNION <record>
   pUnkForRelease As Dword                              ' VT_UNKNOWN <IUnknown>
End Type

Macro wireSTGMEDIUM = tag_userSTGMEDIUM

#EndIf


I gather that types used in types should be defined before (= be in the file before the type that uses them)
I have already changed place of 10 types , is this normal?

Regards,
Marc

Title: Re: OCX newbie
Post by: José Roca on November 01, 2011, 10:55:00 AM
Yes, it is normal because PB has not forward reference for structures. Besides, many type libraries contain interfaces and structures that are already available in the standard headers just for the benefit of Automation languages, that don't use these headers. For example, you could add #INCLUDE ONCE "objidl.inc" to your include file, remove that tag_userSTGMEDIUM and tag_STGMEDIUM_UNION code and change any reference to tag_userSTGMEDIUM for STGMEDIUM.

Title: Re: OCX newbie
Post by: Marc van Cauwenberghe on November 01, 2011, 01:29:50 PM
Thanks again Jose,

I am beginnning to think being able to work with this ocx  (?any) will be a hell of a lot of work just to get started.  :(
And I do so desperately want some kind of flowchart control.

Well... I will give it another go. Now 'If I were a rich man Yubby, dibby, ....'

Regards,
Marc