Exception in Property Page 
Author Message
 Exception in Property Page

I am getting an unexplained exception error when accessing a property page for
a user control, only when using the compiled (VB6) OCX. I have tracked the
exception down to a ReDim Preserve statement. The values in the ReDim, however,
are all valid. The code is:

' Module Level
Type POINTAPI
  X as Long
  Y as Lony
End Type

Dim pPoints() as POINTAPI
Dim nPoints as Integer        ' Initialised to -1 in the
PropertyPage_Initialize Event

Sub Picture1_Click(Button......)
  nPoints = nPoints + 1
  ReDim Preserve pPoints(nPoints)  ' This is where the exception occurrs
  .
  .
  .
End Sub

It works fine in the IDE. Any ideas, anybody?

TIA

Mick

http://www.*-*-*.com/
ICQ# 19344626



Sun, 18 Nov 2001 03:00:00 GMT  
 Exception in Property Page
Hello,
The only thing I can see at this time is the fact that if nPoints is
initialized to -1 in the PropertyPage_Initialize Event. You then increment
nPoints by one and come up with 0. Then you try to ReDim an array with a
zero. This might be where the problem is occurring. What if you initialize
nPoints to 0 in the PropertyPage_Initialize Event?

Good Luck



Quote:
> I am getting an unexplained exception error when accessing a property page
for
> a user control, only when using the compiled (VB6) OCX. I have tracked the
> exception down to a ReDim Preserve statement. The values in the ReDim,
however,
> are all valid. The code is:

> ' Module Level
> Type POINTAPI
>   X as Long
>   Y as Lony
> End Type

> Dim pPoints() as POINTAPI
> Dim nPoints as Integer        ' Initialised to -1 in the
> PropertyPage_Initialize Event

> Sub Picture1_Click(Button......)
>   nPoints = nPoints + 1
>   ReDim Preserve pPoints(nPoints)  ' This is where the exception occurrs
>   .
>   .
>   .
> End Sub

> It works fine in the IDE. Any ideas, anybody?

> TIA

> Mick

> http://members.aol.com/midipapa/MONeill.htm
> ICQ# 19344626



Sun, 18 Nov 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Host for Property Pages or Public Property Page

2. Host for Property Pages or Public Property Page

3. User Defined Exceptions in VB.net component utilized by an ASP page

4. Thread Exception-WinForm app executed from Web page

5. Getting Page Custom Properties onto a new page

6. Q: Property Sheets / Property Page How to

7. USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!

8. How to Hide the Default Property Page for an ActiveX Control in Front Page

9. Modify property of property page

10. How to enable the page from and page to property of the common dialog

11. Adding an additional property page to a windows prop page

12. Catch Exception Compluss Exception Code

 

 
Powered by phpBB® Forum Software