Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic_cast in a shareable

Steve Porter_2
Occasional Advisor

dynamic_cast in a shareable

Hello,

I have a shareable that contains several classes (C++). There are a couple methods where I need to use dynamic_cast, but it is not working (returns 0). I have found in the release notes of several versions (I am using 6.5) that dynamic_cast now works for objects created in the shareable. What I am wondering is this, I am calling the constructors from outside the shareable (the constructors are inside). Is this the problem? Is there a way to make it work?

Thanks, Steve
4 REPLIES
Steve Porter_2
Occasional Advisor

Re: dynamic_cast in a shareable

I tried making the shareable a library instead, and linking it in directly, but I have the same problem. Dynamic_cast still returns 0.

Steve
Craig A Berry
Honored Contributor

Re: dynamic_cast in a shareable

Depending on which minor version of C++ 6.5 you have, there may be a compiler bug affecting you, but there is a patch for it. See

<>
Steve Porter_2
Occasional Advisor

Re: dynamic_cast in a shareable

Thanks, but I don't think that is it. I am running V6.5-004. When I build a junky little program to test out the specific situation, it works. This is true whether it is happening in a shareable or not. However, when I do the same thing in my application shareable, it doesn't work. Guess I'll have to find a different way to do this.

Steve
labadie_1
Honored Contributor

Re: dynamic_cast in a shareable

Does the following make the trick ?

[OpenVMS-Alpha] Automatically Creating Shareable Images from Object Files

available at (url may wrap)

http://h18000.www1.hp.com/support/asktima/appl_tools/009EF453-A516039E-1C02A1.html