Solved

Problems with ActiveX control

Posted on 2001-07-09
15
861 Views
Last Modified: 2010-07-27
I have an ActiveX control that I want to publish on the internet. I have recently encountered a big problem, when I add a referance to mshtml.tlb (Microsoft HTML Object Library). When I add it to my control it works fine on the win98 I have VB on, but when I try to run it (compiled ocx, packaged it with the package and deployment wizard) on  a win2k computer the program just won't start. If I remove the referance it works without problems!

any ideas?
thx
0
Comment
Question by:kristofer
  • 6
  • 4
  • 3
  • +1
15 Comments
 
LVL 7

Expert Comment

by:Inteqam
ID: 6265352
maybe you are not distributing the tlb file.
0
 
LVL 2

Author Comment

by:kristofer
ID: 6265369
I am, it's in the list, and furthermore the file (MSHTML.tlb) is allready on the win2k comp. I can run programs that uses it, just not ActiveX controls. If I turn it into a document dll, register it and run the vbp file it works fine!
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 6265420
then, i think it is a licensing problem.
this is my 2 cents.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6265452
Try the late binding, perhaps it will solve your problem.
(Because of typelib conflicts):
---------------------------------------------------------
Dim MyObject As Object
Set MyObject = CreateObject("MSHTML.HTMLxxx")

and so on ...

Hope this helps
WoK
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 6265480
good idea
good luck :o)
0
 
LVL 2

Author Comment

by:kristofer
ID: 6268029
OK, Wolfgang. Could you please, or anyone explain that a little further. Say I want to load an html webpage from "webbrowser1" to htmlDoc1 where htmlDoc1 is an IHTMLDocument.

Normally, I'd just type:
dim htmlDoc as IHTMLDocument
set htmlDoc = webbrowser1.Document

thx
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6268425
First you must(can) remove the project reference to the
Microsoft HTML Object Library. Then do following:

dim htmlDoc as Object
set htmlDoc = CreateObject("MSHTML.IHTMLDocument")

Thats late binding (without a hard project reference to the HSHTML type lib).
Thats all.

Best regards
WoK
0
 
LVL 2

Author Comment

by:kristofer
ID: 6268564
Have you tried that code out? are the "" supposed to be there? when I try I get a run time error:

Run-time error '429':
ActiveX component can't create object

Ideas?
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6270892
It could be a problem with the setup wizard not correctly registering the mshtml.tlb...  could you post your setup.inf file here
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6272620
You are right ... I have the same problem
I think you can't do it so (regretfully) ...
and therefore you can't invoke
it through CreateObject("MSHTML.HTMLDocument").
I search the registry and find that the progid of MSHTML is
'htmlfile', therefore when you write:

Dim Myhtmldoc As Object
Set Myhtmldoc = CreateObject("htmlfile")

it should function. It provides an object of the type:
"HTMLDocument". Crazy at all ...

Hope this helps
WoK

0
 
LVL 2

Author Comment

by:kristofer
ID: 6272841
OK, that seems to work... Atleast I don't get an error msg... However I need a lot more than the HTMLDocument. I need the following...

HTMLWindow2
HTMLDocument
IHTMLDocument
IHTMLElementCollection
IHTMLElement
IHTMLInputFileElement
IHTMLInputTextElement
IHTMLInputButtonElement

I tried CreateObject("htmlfile.HTMLWindow2") etc. but that didn't work... how do I search the registry? complicated I guess...
0
 
LVL 2

Author Comment

by:kristofer
ID: 6272894
NO... that didn't work either. It worked on the win98 I developed it on, but not on the win2k's that my clients will use... I get "Object does not support this property or method".

increased points to 50 then doubled... any ideas?
0
 
LVL 4

Accepted Solution

by:
WolfgangKoenig earned 100 total points
ID: 6273815
The problem you have is the incompatiblity between
WIn98 and WIN2000 mshtml.tlb (+.dll).

tlb stands for type lib

Type libs are backward compatible! and thats the reason
whye you should recompile your control on the win2000
system.
Then i should function under WIN95 and WIN2000!!

This should helps and you don't need
late binding anymore ...

Nice day
WoK

0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6273891
<<how do I search the registry?>>

Go to Start > Run ... type regedit hit Enter
0
 
LVL 2

Author Comment

by:kristofer
ID: 6297758
Took some time to install VB on the win2k, but it seems to be working fine now. thanks
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 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