Solved

Problems with ActiveX control

Posted on 2001-07-09
15
863 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

840 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