Board index » cppbuilder » Trouble installing ActiveX made in Microsoft VC++

Trouble installing ActiveX made in Microsoft VC++

Hello,
I've got an ActiveX created by Pixel Translation (used for image processing)
that they say was made using Microsoft C++ (Ver 6.0). When I try to import
the ActiveX, the type library (xxxLIB_TLB.h) that is built during
installation has problems in the section dealing with Events, beginning with
the error "declaration terminated incorrectly" and generating many more
after that. The properties seem to be handled corrected in the type library,
but problems occur right when the Events begin getting handled.

Has anyone seen this before, and know how to handle it.
By the way, before attempting to install the ActiveX, I updated my C++
Builder 5.0 with the 1.0 patch, but to no avail.

Thanks
Chris Wieland

 

Re:Trouble installing ActiveX made in Microsoft VC++


In article <39da3549_1@dnews>,

Quote
Chris Wieland <dellaenterpri...@prodigy.net> wrote:
>Hello,
>I've got an ActiveX created by Pixel Translation (used for image processing)
>that they say was made using Microsoft C++ (Ver 6.0). When I try to import
>the ActiveX, the type library (xxxLIB_TLB.h) that is built during
>installation has problems in the section dealing with Events, beginning with
>the error "declaration terminated incorrectly" and generating many more
>after that. The properties seem to be handled corrected in the type library,
>but problems occur right when the Events begin getting handled.

It would help us diagnose the problem if you posted some of the errors
and the lines of code which generate them. :)

You might also try running the .cpp file that includes that header
through cpp32, which will generate a .i file that shows you *exactly*
what the compiler is seeing at that point.

--
Si vales, valeo.

Re:Trouble installing ActiveX made in Microsoft VC++


Well, there are tons of errors, but here are the first three and the
associated lines in the xxxLib_Tlb.h that is generated.
The errors almost suggest a missing bracket.

==================
The first 3 errors:

[C++ Error] PixezocxLib_TLB.h(4431): E2040 Declaration terminated
incorrectly
[C++ Error] PixezocxLib_TLB.h(4676): E2040 Declaration terminated
incorrectly
[C++ Error] PixezocxLib_TLB.h(4676): E2190 Unexpected }
================

The .H file where the first 3 errors occur.

4417 //
*********************************************************************//
4418 // Interface: _DPixEzImageEvents
4419 // Flags:     (4096) Dispatchable
4420 // GUID:      {A1FF59A2-0995-11CF-B3E8-00608C82AA8D}
4421 //
*********************************************************************//
4422 interface _DPixEzImageEvents : public TDispWrapper<IDispatch>
4423 {
4424   void __fastcall Change()
4425   {
4426     _TDispID _dispid(/* Change */ DISPID(1));
4427     OleProcedure(_dispid);
4428   }
4429
4430   void __fastcall Yield()
4431   {
4432     _TDispID _dispid(/* Yield */ DISPID(2));
4433     OleProcedure(_dispid);
4434   }
.
.
.
4660   void __fastcall PreMessageBox(long MessageID, BSTR MessageText, BSTR
Caption, long Flags,
4661                                 long* Action, short* Handled, TVariant*
ExtraData)
4662   {
4663     _TDispID _dispid(/* PreMessageBox */ DISPID(23));
4664     TAutoArgs<7> _args;
4665     _args[1] = MessageID /*[VT_I4:0]*/;
4666     _args[2] = MessageText /*[VT_BSTR:0]*/;
4667     _args[3] = Caption /*[VT_BSTR:0]*/;
4668     _args[4] = Flags /*[VT_I4:0]*/;
4669     _args[5] = Action /*[VT_I4:1]*/;
4670     _args[6] = Handled /*[VT_I2:1]*/;
4671     _args[7] = ExtraData /*[VT_VARIANT:1]*/;
4672     OleProcedure(_dispid, _args);
4673   }
4674
4675
4676 };
================

Quote
"Robert West" <aphr...@magescave.blackforest.org> wrote in message

news:8rdisj$54b$1@sphinx.inprise.com...

Quote
> In article <39da3549_1@dnews>,
> Chris Wieland <dellaenterpri...@prodigy.net> wrote:
> >Hello,
> >I've got an ActiveX created by Pixel Translation (used for image
processing)
> >that they say was made using Microsoft C++ (Ver 6.0). When I try to
import
> >the ActiveX, the type library (xxxLIB_TLB.h) that is built during
> >installation has problems in the section dealing with Events, beginning
with
> >the error "declaration terminated incorrectly" and generating many more
> >after that. The properties seem to be handled corrected in the type
library,
> >but problems occur right when the Events begin getting handled.

> It would help us diagnose the problem if you posted some of the errors
> and the lines of code which generate them. :)

> You might also try running the .cpp file that includes that header
> through cpp32, which will generate a .i file that shows you *exactly*
> what the compiler is seeing at that point.

> --
> Si vales, valeo.

Thanks,
Chris Wieland

Re:Trouble installing ActiveX made in Microsoft VC++


I think Yield is a #define when a Win32 program is built. It expands to
empty space - hence the errors. It's really an unfortunate choice of
name on the AX developers' part. I suggest changing the name to
something different or #undef'ing the Yield before including the _tlb.h
file.

HTH,
.a

Quote
Chris Wieland wrote:

[snip]

Re:Trouble installing ActiveX made in Microsoft VC++


In article <39DA5FE5.CD8A8...@jetsuite.com>,
Alex Bakaev [TeamB] <al...@jetsuite.com> wrote:

Quote
>I think Yield is a #define when a Win32 program is built. It expands to
>empty space - hence the errors. It's really an unfortunate choice of
>name on the AX developers' part. I suggest changing the name to
>something different or #undef'ing the Yield before including the _tlb.h
>file.

I didn't know this, but it turns out alex is right:
winbase.h line 55:
#define Yield()

i can't imagine what the reason for this is. *sigh*
--
Si vales, valeo.

Re:Trouble installing ActiveX made in Microsoft VC++


Alex and Robert,

Yikes! You guys are fast. Thanks.
From the looks of this ActiveX, there are going to be many of these
irregularities.

I guess my next question is:
If the ActiveX doesn't easily import, and I need to modify the generated
.CPP or .H files,
how to I proceed after my manual changes to continue the importing of the
OCX?
Can I still have an ActiveX icon that I can drop on a form, or do I need to
instantiate
the ActiveX in code?

Chris Wieland

"Alex Bakaev [TeamB]" <al...@jetsuite.com> wrote in message
news:39DA5FE5.CD8A8C2D@jetsuite.com...

Quote
> I think Yield is a #define when a Win32 program is built. It expands to
> empty space - hence the errors. It's really an unfortunate choice of
> name on the AX developers' part. I suggest changing the name to
> something different or #undef'ing the Yield before including the _tlb.h
> file.

> HTH,
> .a

> Chris Wieland wrote:
> [snip]

Re:Trouble installing ActiveX made in Microsoft VC++


Quote
Chris Wieland wrote:
> If the ActiveX doesn't easily import, and I need to modify the generated
> .CPP or .H files,
> how to I proceed after my manual changes to continue the importing of the
> OCX?

Well, you import it, get the icon on the palette, then modify the
header. You can rebuild the package at this time if you want, but I
don't think it's needed.

.a

Re:Trouble installing ActiveX made in Microsoft VC++


Quote
aphr...@magescave.blackforest.org (Robert West) wrote:
>I didn't know this, but it turns out alex is right:

>winbase.h line 55:
>#define Yield()

>i can't imagine what the reason for this is. *sigh*

It's a Microsoft header file. What do you expect - them to know how to
use #define properly?

I'd appreciate these headers rewritten for C++. I really would. But I
don't suppose it's seen as worth it.

Alan Bellingham
--
al...@episys.com  
For book reviews and much more, see the Association of C and C++ Users
website at http://www.accu.org

Re:Trouble installing ActiveX made in Microsoft VC++


Alex,
Thanks a lot for the guidance. For now, I just commented out all the
references to the Yield() event in the .H and got my ActiveX added to the
ActiveX tool tab. Hopefully, thats a function I don't need in the OCX.

Very gratefully yours,
Chris Wieland

"Alex Bakaev [TeamB]" <al...@jetsuite.com> wrote in message
news:39DA75FB.C80F6220@jetsuite.com...

Quote

> Chris Wieland wrote:

> > If the ActiveX doesn't easily import, and I need to modify the generated
> > .CPP or .H files,
> > how to I proceed after my manual changes to continue the importing of
the
> > OCX?

> Well, you import it, get the icon on the palette, then modify the
> header. You can rebuild the package at this time if you want, but I
> don't think it's needed.

> .a

Re:Trouble installing ActiveX made in Microsoft VC++


In article <39DA75FB.C80F6...@jetsuite.com>,
Alex Bakaev [TeamB] <al...@jetsuite.com> wrote:

Quote

>Chris Wieland wrote:

>> If the ActiveX doesn't easily import, and I need to modify the generated
>> .CPP or .H files,
>> how to I proceed after my manual changes to continue the importing of the
>> OCX?

>Well, you import it, get the icon on the palette, then modify the
>header. You can rebuild the package at this time if you want, but I
>don't think it's needed.

He'll have to modify the header *before* getting the icon on the palette,
because the package won't compile with the header as is.

Chris --- modify it, then build; the generation process is what
created the component.

--
Si vales, valeo.

Other Threads