Board index » cppbuilder » Using COM objects such as MicroSoft XML or other non ActiveX COM objects

Using COM objects such as MicroSoft XML or other non ActiveX COM objects

Hello to all,

I hope I am in the right new group.  I am in desparate need of
help in
how to use com objects in builder.  I particular, I need to use
the
Microsoft XML parser com object.  I have tried to use the Import
Type
Library under Projects menu option, but when I go to compile the
component wrapper for which builder generated, I get a 1000
(figuratively) error messages.  I have tried to compile this into
the
dcuser package.

Please any and all help is appreciated.

Note, that this is not an ActiveX or other form of automation
object.
It is just a com object.

Regards,

James

 

Re:Using COM objects such as MicroSoft XML or other non ActiveX COM objects


Quote
>Microsoft XML parser com object.  I have tried to use the Import
>Type
>Library under Projects menu option, but when I go to compile the
>component wrapper for which builder generated, I get a 1000
>(figuratively) error messages.  I have tried to compile this into
>the
>dcuser package.

Have you tried creating a new application and importing the type
library into the application?

Also, what is the first or first few error messages?

cheers,
John

Re:Using COM objects such as MicroSoft XML or other non ActiveX COM objects


The error messages are type mismatch.  I had to go and change the
automatic code generated for a lot of BSTR to BSTR* and also the object
pointers for the interfaces had to be changed to indicate *.

I have tried to just add the type library into an existing project, but
I always get errors when I try to assign any properties.  I have tried
to instanciate a TComxxx. object and assign values but I get access
violation errors every time.  I have tried the interface but I am not
allow to access it. I have tried the CoClassxxx to create and instance
and it returns ok, but I constancely get access violation errors when I
try to assign or get anything.

I am very initated with this.

Regards,

James

Quote
John Moshakis wrote:
> >Microsoft XML parser com object.  I have tried to use the Import
> >Type
> >Library under Projects menu option, but when I go to compile the
> >component wrapper for which builder generated, I get a 1000
> >(figuratively) error messages.  I have tried to compile this into
> >the
> >dcuser package.

> Have you tried creating a new application and importing the type
> library into the application?

> Also, what is the first or first few error messages?

> cheers,
> John

Re:Using COM objects such as MicroSoft XML or other non ActiveX COM objects


Which versions of Builder and the xml parser are you using?

Re:Using COM objects such as MicroSoft XML or other non ActiveX COM objects


Why do you think you had to go and change the autogenerated code? Why do
you think the generated code (as opposed to the code calling it) is in
error?

.a

Quote
James Williams wrote:

[snip]

Re:Using COM objects such as MicroSoft XML or other non ActiveX COM objects


Because the compiler was the one giving the error.  The wrappers were being
passed a BSTR* while the wrapper functions were declared with just a BSTR
parameter.

This was all from the import tyle generation.  When I tried to compile it
before anything was changed, it gave type mismatch errors.  Hence I went
through the code and made these simple changes and all works well.

This happens only if I tell the wizard to generate VCL wrappers and install
as componenets.  If I just have the wizard create the units without the VCL
wrappers all is well.  So, yes, there is a borland bug here.  It happens to
alot of the coms I have tried to import.

Regards,

James

Quote
"Alex Bakaev [TeamB]" wrote:
> Why do you think you had to go and change the autogenerated code? Why do
> you think the generated code (as opposed to the code calling it) is in
> error?

> .a

> James Williams wrote:
> [snip]

Re:Using COM objects such as MicroSoft XML or other non ActiveX COM objects


James, could you post samples of the wrong code, please? Compiler will
give an error in either case, no matter what code is in error - imported
or created by your.

thanx,
.a

Quote
James Williams wrote:

[snip]

Other Threads