Board index » cppbuilder » Further ActiveX problems after installing BCB4 patch 1

Further ActiveX problems after installing BCB4 patch 1

Hi,

I've been trying to work with Mapinfo's MapX control. Under the release
version of builder 4 one was not able to use this control see posts ("Not a
Member Error" when using imported ActiveX control with BCB4). After
installing the new patch I was able to use the control fairly well but I am
still unable to use the many other classes/interfaces made available by the
control. In the XXX_tlb.h file they are all there with there methods and
properties and if I use them like:

CMapXRectanglePtr Rect;
Rect->Set(0,0,100,100);

it compiles just fine but crashes at runtime. If I break on the
Rect->Set(...) line and move the mouse over the Rect variable I get
 iid:????, intf:NULL ] the interface = NULL part is what worries me because
thats why it crashes, am I doing something completely wrong or is there
another bug. Is this the wrong way to create a (in this example)
CMapXRectanglePtr object??

Hope someone can give me a hand with this

Thanks
Eugene Duvenage

 

Re:Further ActiveX problems after installing BCB4 patch 1


Pardon a stupid question, but you did te-import and rebuilt ?

Alex

Quote
Eugene Duvenage wrote:

[snip]

--
HotSend - portable documents technology
http://www.hotsend.com/
eFax - get your faxes via email - Free !
http://www.efax.com

Re:Further ActiveX problems after installing BCB4 patch 1


Yes I deleted all the old files and then rebuilt, like I said I could use
the main Control substantially better, I just can't use any of the
additional classes.

Thanks
Eugene Duvenage

Quote
Alex Bakaev [TeamB] wrote in message <375D736D.BBE40...@jetsuite.com>...
>Pardon a stupid question, but you did te-import and rebuilt ?

>Alex

>Eugene Duvenage wrote:
>[snip]

>--
>HotSend - portable documents technology
>http://www.hotsend.com/
>eFax - get your faxes via email - Free !
>http://www.efax.com

Re:Further ActiveX problems after installing BCB4 patch 1


Eugene,

You'll need to initialize the CMapXRectanglePtr instance before using it:
It's a smart-interface wrapper that's initialized to nil: IOW it's
TComInterface<CMapXRectangle>:

CMapXRectanglePtr Rect;

// Here the Rect must be initialized
// For example, imagine there's a method in the control that
creates/opens/adds/etc a rectangle
Rect = Map1->CreateMeARectangle();

// Now you can use the Rect.
Rect->Set(0,0,100,100);

I should mention that the goal is to provide VB-like syntax [using ->
instead of .] and eliminate intermediate interfaces. It's not very efficient
but it makes things very easy to understand. So for example, I would expect
users to be doing more things like:

Map1->CreateRect();   // This may return a Rect but if there's another way
to access it, we don't use a variable
Map1->ActiveRectangle->Set(0, 0, 100, 100);  // Here we access the Rect we
just created via the 'ActiveRectangle' property.

This would map to typical VB like code:

Map.CreateRect
Map.ActiveRect.Set(.....).

The above is a made-up case. I can provide a real sample once I get in the
office, where I have the control downloaded.

Regards,

Bruneau.

Quote
Eugene Duvenage wrote in message <7jkvnt$4u...@forums.borland.com>...
>Yes I deleted all the old files and then rebuilt, like I said I could use
>the main Control substantially better, I just can't use any of the
>additional classes.

>Thanks
>Eugene Duvenage

>Alex Bakaev [TeamB] wrote in message <375D736D.BBE40...@jetsuite.com>...
>>Pardon a stupid question, but you did te-import and rebuilt ?

>>Alex

>>Eugene Duvenage wrote:
>>[snip]

>>--
>>HotSend - portable documents technology
>>http://www.hotsend.com/
>>eFax - get your faxes via email - Free !
>>http://www.efax.com

Re:Further ActiveX problems after installing BCB4 patch 1


Bruneau,

Could you post the example of initialising a rectangle object ?  I need to
pass a rectangle to the DrawLineSample function and I cannot find a way to
create a valid CMapXRectanglePtr.

Thanks,

Scott.

Quote
Jean-Marie Babet <brune...@msn.com> wrote in message

news:7jlvi8$64q18@forums.borland.com...

Quote
> CMapXRectanglePtr Rect;

> // Here the Rect must be initialized
> // For example, imagine there's a method in the control that
> creates/opens/adds/etc a rectangle
> Rect = Map1->CreateMeARectangle();

> // Now you can use the Rect.
> Rect->Set(0,0,100,100);

snip...
Quote
> The above is a made-up case. I can provide a real sample once I get in the
> office, where I have the control downloaded.

> Regards,

> Bruneau.

Other Threads