471,335 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,335 software developers and data experts.

AxImp & VB .Net

Moi
Hello,

I used AxImp on one ActiveX I've written (VC++6), and I'm trying to use the
generated assemblies in VB. Net.

it seems that the underlying ocx is not created when I'm calling the
AboutBox method
(or any method/member of my activex).

What am I missing ?

Thanks,
Laurent

Imports AxEARAXLib

Public Class Form1

Inherits System.Windows.Forms.Form

Dim myax As New AxEarAX()

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Debug.WriteLine(myax.ProductName)

Try

myax.AboutBox() ' InvalidActiveXStateException thrown here --- myax.ocx =
Nothing :(

Catch ex As Exception

Debug.WriteLine(ex.Message)

Debug.WriteLine(ex.StackTrace())

End Try

End Sub

End Class
Jul 22 '05 #1
1 2362
I think you first need to add the control to the form using
Form.Controls.Add

-Atul
http://www.ssware.com/
Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net

"Moi" <mo*@moi.tk.invalid> wrote in message
news:db**********@ikaria.belnet.be...
Hello,

I used AxImp on one ActiveX I've written (VC++6), and I'm trying to use
the
generated assemblies in VB. Net.

it seems that the underlying ocx is not created when I'm calling the
AboutBox method
(or any method/member of my activex).

What am I missing ?

Thanks,
Laurent

Imports AxEARAXLib

Public Class Form1

Inherits System.Windows.Forms.Form

Dim myax As New AxEarAX()

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Debug.WriteLine(myax.ProductName)

Try

myax.AboutBox() ' InvalidActiveXStateException thrown here --- myax.ocx =
Nothing :(

Catch ex As Exception

Debug.WriteLine(ex.Message)

Debug.WriteLine(ex.StackTrace())

End Try

End Sub

End Class

Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Wiktor Zychla | last post: by
2 posts views Thread by Or Lavy | last post: by
1 post views Thread by Moi | last post: by
reply views Thread by John Olbert | last post: by
4 posts views Thread by jonpb | last post: by
reply views Thread by Christian | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.