Solved

ActiveX object in form

Posted on 2002-03-25
9
264 Views
Last Modified: 2013-12-18
I have created a OCX in VB, and inserted this (it includes UI) into the design of a form.
I have set the name of it, but im having problem accessing this object.  It says 'variant does not contain an object'.
Anything i have forgotten to do ... ?
0
Comment
Question by:Gunsen
  • 5
  • 4
9 Comments
 
LVL 10

Expert Comment

by:zvonko
ID: 6893741
place here at least the LotusScript code for accessing your registered control.
Most the times I am reading my typos so what I want to read. Therefore I supose you are doing the same: overreading your typos :-)
0
 
LVL 3

Author Comment

by:Gunsen
ID: 6893848
What is the scope of this inserted object?

The object-name is:  console
It try using a property in the ocx, and tried the following:
SettingsFile = "E:\myfile.ini" (in initialize event)
console.SettingsFile = "E:\myfile.ini"
formname.console.SettingsFile = "E:\myfile.ini"

Then i get the error (variant does not contain
an object).

Is there any special considerations in destroying this attached design object?
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6894313
OK,

before doing anything else, set this two agent Options:
Option Public
Option Declare

The second Option will warn you if Object wrong declared or Object properties and methods invoced that are not accessible.

What line do you create your Object?
What is the Object variable: formanme or console?

Normal doing is like this:
Dim formname As Variant
Set formname = CreateObject("myRegApp")
formname.SettingsFile = "E:\myfile.ini"

and this depends on Properties and Methods of "myRegApp" or what the name of your registered application object creator is.

If your OCX is correct registered on this test machine, then you can see your registered Properties and Methods in "OLEClasses" browser left from the agent source code. Look for this.

0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Author Comment

by:Gunsen
ID: 6894653
Ok, i have done a Create|Insert of the OCX.
Is this wrong (i already know what you are saying).
If thats wrong approach, how do i assure that the control is at right UI place...
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6894669
I am loosing the thread :-)

can you send me please your database and thius OCX control with a short description to: zp@arcor.de

Please do zip it for download time reduction :-)

If you decide to do it on your own: icluding the OCX into form is also a way, but with reduced command set.
Better aproach is to instatiate the object in BackEnd.



0
 
LVL 3

Author Comment

by:Gunsen
ID: 6894712
Hi, appritiate ur answer.

This propblem is more in general.
If i insert an ocx directly on a form, how do i address it (i know this is an applet in notes).

I allways have Explicit declares.

The thing im wondering about is how to address this object. O have inserted the object (control) onto a form and then... whats the name of this instanced object ?

This is not back-end this is front end.

300 p is the value...
0
 
LVL 10

Accepted Solution

by:
zvonko earned 300 total points
ID: 6895342
OK, I do not know what your OCX is doing, so let us use a general OCX.

I placed "Microsoft ProgressBar Control, version 6.0" on my form.
The name placed in OCX properties was same as OCX name, but I changed it to this string in property dialog: "myProgressBarOne"
The Object name has to be unique on the form.

I added a button to control this OCX.
Here is the silly code for this button:
Sub Click(Source As Button)
  Dim ws As New NotesUIWorkspace
  Dim uidoc As NotesUIDocument
  Dim OCX_OBJ As Variant
  Set uidoc = ws.CurrentDocument
  Set OCX_OBJ = uidoc.getObject("myProgressBarOne")
  If (OCX_OBJ.Value = 0) Then
    OCX_OBJ.Min = 1
    OCX_OBJ.Max = 10
    OCX_OBJ.Value = 1
  End If
  Print "Act: " & OCX_OBJ.Value
  If (OCX_OBJ.Value < OCX_OBJ.Max) Then
    OCX_OBJ.Value = OCX_OBJ.Value + 1
  Else
    OCX_OBJ.Value = 1
  End If
End Sub

The OCX was comming from MSCOMCTL.OCX

Is this working for you?


0
 
LVL 3

Author Comment

by:Gunsen
ID: 6895844
That's the ticket.
Thanx, zvonko
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6895863
anytime <|;-)

how far did you progress with your domino3 RunOnServer attempts?

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question