1. Chris Baldone
  2. PowerBuilder
  3. Friday, 8 March 2019 17:19 PM UTC

This has been an issue since PB 11.5 when we included an OCX into our application.  It was there in version 12.6 and still an issue in 2017.

We have added a custom calendar OCX to our application.  To add this, I did an INSERT-> CONTROL -> OLE

From there, I select the 'Insert Control' tab, click the 'Register New' button and find the OCX.  It registers and I can select it from the list and add to the page.  I can then use the OCX like I want.

The problem is when I have to make any code change to the window that the OCX control is on.  When I do so, the control is no longer valid.  The application crashes b/c it does not recognize any of the OCX's methods.  

In the past, when I made a change, I would have to go thru the step and add the OCX a second time, copy all the code behind to the new OCX control.  This would fix the issue.  

Today, I have a screen that works.  I can go into any code behind and add a comment line, save and build.  It fails b/c the OCX is invalid now.

Is there anything I can do to fix this problem?

Roland Smith Accepted Answer Pending Moderation
  1. Friday, 8 March 2019 17:58 PM UTC
  2. PowerBuilder
  3. # 1

Create it as it's own userobject and then place that on the window.

 

Comment
  1. Chris Baldone
  2. Friday, 8 March 2019 19:23 PM UTC
Why does it invalidate the OCX object when I modify code with the way I have it?
  1. Helpful
  1. Roland Smith
  2. Friday, 8 March 2019 20:17 PM UTC
If you open the window in Edit Source and go to the bottom, you'll see a block of binary code. I think there is a bug in the Window painter that causes the binary to be dropped. It is best to keep the control as a separate userobject anyway. Then you can add your own code and have it available to all windows that use the control.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 8 March 2019 18:21 PM UTC
  2. PowerBuilder
  3. # 2

I made a nice Word doc with screen shots but the forum won't allow Word doc attachments. Here is the text instructions:

Choose New from the File menu, Ctrl+N on the keyboard, or the New toolbar button.

Choose Standard Visual and click OK.

Choose olecontrol and click OK.

Go to the Insert Control tab and select your control. Click the OK button.

Now you are in the UserObject painter. Save the object.

Open your window and place the userobject on it.

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.