• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • Last Modified:

Client side component via ASP????

Hi,

l have written a simple scanner activex dll using the kodak image scan control (imgscan.ocx) on VB6, and l have tested the dll from a test.exe also written on VB6. It was working fine nicely. But when l used the package and deployment wizard program that come along with VB6 and package it for internet deployment, l cannot get it to run from the browser. l put both the cab file and sample generated webpage into a test directory on my test webserver. At the same time, l also modify the generated sample webpage to as follow:

<HTML>
<HEAD>
<TITLE>Scan2.CAB</TITLE>
</HEAD>
<BODY>
<OBJECT ID="Scan"
CLASSID="CLSID:5E6FDC68-EDDB-4A76-B5DD-0061AE4AAB93"
CODEBASE="Scan2.CAB#version=1,0,0,0">
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
set objscan = createobject("Scan2.Scan")
objscan.StartScan
<SCRIPT>
</BODY>
</HTML>

Is this the right way to deloy an activex control to be runned on the client side assuming security issue is overcome? Is there any articles on this subject on the web?

Please help. Thxs.

0
mikeckt
Asked:
mikeckt
  • 3
  • 2
  • 2
  • +2
1 Solution
 
CJ_SCommented:
Try:
<script language="VBScript">
Scan.StartScan
</script>
0
 
CJ_SCommented:
Oh, and give it time to load!!! Otherwise it won't know the component at all.

CJ
0
 
naveenkohliCommented:
Here is the link to information on deploying ActiveX control..

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaxctrl/html/msdn_deplactx.asp

What error are you getting with your existing code?

Naveen
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
raja_velpuruCommented:
Try this out:

*********************************************************
<HTML>
<HEAD>
<TITLE>Scan2.CAB</TITLE>
<script language="javascript">
function scanImage(vForm){
       vForm.objScan.StartScan();
}
</script>
</HEAD>
<BODY>
<form name="myForm">
<OBJECT ID="objScan"
name="objScan" CLASSID="CLSID:5E6FDC68-EDDB-4A76-B5DD-0061AE4AAB93"
CODEBASE="Scan2.CAB#version=1,0,0,0">
</OBJECT>
<input type="button" name="scan" value="Scan Image" onClick="scanImage(this.form)">
</form>
</BODY>
</HTML>
*********************************************************
0
 
mikecktAuthor Commented:
First, thxs guys.

On further investigation, it seems that the error come directly from the packaging wizard. When l re-packaged the dll for internet deployment using the VB6 package and deployment wizard program, this time l noticed that there was a warning message as follow:

"The information found in the file 'C:\WINNT\system32\imgscan.ocx' does not match that found in the registry. Make sure the file is registered on this computer in the directory you are retrieving it from.

Your project may not function properly if you continue. Do you wish to continue?"

There is no problem if l compile the scan program into a dll from VB6. There is also no problem if l reference the scan dll from another test program created from VB6. Infact, the test program run fine. There is also no error message when l add the Kodak Image Scan component "imgscan.ocx" in the scan project. In any case, this kodak Image Scan component was installed automatically during the Win2K installation, and l believe it's used by the kodak imaging program in the "Accessories" folder ("C:\Program Files\Windows NT\Accessories\ImageVue\Kodakimg.exe"). The Kodak Imaging program also run fine without problem; it was able to scan images.

Any ideas what could be the problem? Your help is very much appreciated.

thxs.
0
 
raja_velpuruCommented:
Sorry, I am not able to get what problem u r facing now.

Did u try the sample I gave u?

What are the errors u r getting?
0
 
mikecktAuthor Commented:
Yes, l did try out the sample html code. It did ask me whether l want to install the scan.cab file which l say "yes". When l pressed the button generated by the html code, nothing happened. The browser's status bar indicated a message "Error in the page". My guess is that the cab file was not properly installed. l think that is why there is no scan activex in the folder "C:\WINNT\Downloaded Program Files". That confirmed my suspicion that the error occur when l package the cab file for internet deployment using the VB6 Package & Depolyment Wizard program. For some reason, the VB6 Packaging program was NOT able to package the component "C:\WINNT\system32\imgscan.ocx" in the cab file. The warning message was:

"The information found in the file 'C:\WINNT\system32\imgscan.ocx' does not match that found in the
registry. Make sure the file is registered on this computer in the directory you are retrieving it from.

Your project may not function properly if you continue. Do you wish to continue?"


Any idea what could be the problem????

Thxs.
0
 
raja_velpuruCommented:
I guess the problem would be in making the package CAB file of the OCX.

Try these out:
1. Register the OCX from where u have it saved. For example, if the OCX is residing in C:\test then run the following command at RUN prompt

regsvr32 "C:\test\imgscan.ocx"

2. Now using the Packaging & Delpoyment wizard, make the package CAB from C:\test\imgscan.ocx
I guess thsi time it shoudl give you any warnings.

Further run the HTML, i have sent.

In CODEBASE, just mention the CAB file alone, let it refer itself to the latest version. For example,
<OBJECT ID="objScan"
name="objScan" CLASSID="CLSID:5E6FDC68-EDDB-4A76-B5DD-0061AE4AAB93"
CODEBASE="Scan2.CAB">

provided u have Scan2.CAB also in the same path as that of the HTML page.
0
 
gladxmlCommented:
No comment has been added lately and it seems that this question have been abandoned. So it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question or invite a Moderator to close this question if there's no reply from you after seven days.

In the absence of responses, I will recommend the following:

To accept the comment and points awarded to raja_velpuru

** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **


Just trying to help for the cleanup...
gladxml
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now