By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,338 Members | 1,350 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,338 IT Pros & Developers. It's quick & easy.

AxImp and OCX

P: n/a
Hi all ,
this is the first time that using .Net and C#
and
this is the first time that I write on this NG .

I have problem with OCX "avaibility" :

1. I have imported my OCX with AxImp
2. I have create one Instance of this Ocx that I have Imported
3. I have try to use one Method of this Ocx but I get this message error:

you not use the Mothod "nameMethod" at this time !

Uhmm ,
I Think that Ocx in the .NET Form must be "loaded" first that I call "nameMethod" .

But I haven't understand the way for get the Event from this Ocx that Allow me to understand
if it is really Loaded !

Tnx all , for any help !

dm















Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Yes , I do .
I have skip the first step of my Programs when I have Write This email .

using System;
using System.Windows.Forms;
using AxMyOcx;

... code
... code

public static void Main()
{
AxMyOcxObject myOb = new AxMyOcxObject();

Form myForm = new Form(); // i create a Form
myForm.Controls.Add(myOb); // i add the OCX at form

// myOb.myMethod(); // If a Uncomment this line : << ERROR , You can't call myMethod at this time >>
myForm.ShowDialog(); // the Form show my Form and OCX inside the Form !
}
If I try to call "myMethod" after 2 o 3 seconds inside another place of my Program , it Work !
I concluded , that my OCX must be "loaded" before I use the myMethod ?

DM
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.