mailshan
August 20th, 2001, 12:04 PM
Hi,
I am Shan, computer science undergraduate from Malaysia. Recently I encountered a problem in developing an ActiveX control using Visual Basic. In the Visual Basic program, I make calls to a Dynamic Link Library (DLL) provided by an ADC (Analogue-Digital Converter) manufacturer. The code as shown below illustrates more on the call to the DLL.
01 //
02 //
03 // ADC11.vbp - ActiveX control Project
04 // + Modules
05 // --+ Module1 (adc1132.bas)
06 // + User Controls
07 // --+ UserControl1 (UserControl1.ctl)
08
09
10 // Function declaration in Module1 (adc1132.bas)
11 // The file ADC1132.dll located in the same folder as the project folder
12 Declare Function adc11_get_value Lib "ADC1132.dll" (ByVal channel As Integer) As Integer
13
14
15 // Call the adc11_get_value function from ADC1132.dll in UserControl1 (UserControl1.ctl)
16 Dim value as Integer
17 value = adc11_get_value(1)
18 //
19 //
20 //
The Visual Basic program works fine when I run the program from Visual Basic. The following step was creating an OCX file. After the OCX file was created, I use the Ms Frontpage to create a web page with the ActiveX control. At this stage, I found that the web page is not standalone. It requires the DLL file in the same folder as the web page in order to work properly. I hope that by now you know what am I trying to solve.
But actually it is not that simple. I have to upload the web page into the Personal Web Server (PWS) so that others could access it through an URL (http://shaan/pico). When I upload the web page into the PWS (ADC1132.dll is copied into the virtual directory as well) I could access the page properly with a web browser within the machine that hosts the web page. The ActiveX control does not work properly in another machine when it is called through URL. This is because the ActiveX control in the machine doesn't reaches the DLL file in the server (It will try to find the DLL file in that machine itself and prompt an error stating that the DLL file is not found in the associated folder).
Q: How to make the ActiveX control in the web page to reach the DLL file in the server (Downloading the DLL file into a client machine is not a solution because it interfaces with the ADC)?
I hope to hear from you in the near future. Hope to get a favorable reply. Thank you.
Regards
R Shan
I am Shan, computer science undergraduate from Malaysia. Recently I encountered a problem in developing an ActiveX control using Visual Basic. In the Visual Basic program, I make calls to a Dynamic Link Library (DLL) provided by an ADC (Analogue-Digital Converter) manufacturer. The code as shown below illustrates more on the call to the DLL.
01 //
02 //
03 // ADC11.vbp - ActiveX control Project
04 // + Modules
05 // --+ Module1 (adc1132.bas)
06 // + User Controls
07 // --+ UserControl1 (UserControl1.ctl)
08
09
10 // Function declaration in Module1 (adc1132.bas)
11 // The file ADC1132.dll located in the same folder as the project folder
12 Declare Function adc11_get_value Lib "ADC1132.dll" (ByVal channel As Integer) As Integer
13
14
15 // Call the adc11_get_value function from ADC1132.dll in UserControl1 (UserControl1.ctl)
16 Dim value as Integer
17 value = adc11_get_value(1)
18 //
19 //
20 //
The Visual Basic program works fine when I run the program from Visual Basic. The following step was creating an OCX file. After the OCX file was created, I use the Ms Frontpage to create a web page with the ActiveX control. At this stage, I found that the web page is not standalone. It requires the DLL file in the same folder as the web page in order to work properly. I hope that by now you know what am I trying to solve.
But actually it is not that simple. I have to upload the web page into the Personal Web Server (PWS) so that others could access it through an URL (http://shaan/pico). When I upload the web page into the PWS (ADC1132.dll is copied into the virtual directory as well) I could access the page properly with a web browser within the machine that hosts the web page. The ActiveX control does not work properly in another machine when it is called through URL. This is because the ActiveX control in the machine doesn't reaches the DLL file in the server (It will try to find the DLL file in that machine itself and prompt an error stating that the DLL file is not found in the associated folder).
Q: How to make the ActiveX control in the web page to reach the DLL file in the server (Downloading the DLL file into a client machine is not a solution because it interfaces with the ADC)?
I hope to hear from you in the near future. Hope to get a favorable reply. Thank you.
Regards
R Shan