activex dll...asp...Newbie

Results 1 to 3 of 3

Thread: activex dll...asp...Newbie

  1. #1
    Join Date
    Dec 1969

    Default activex dll...asp...Newbie

    Hi All, <BR>I think I&#039;ve finally figured out what I need to do but don&#039;t know how to do it. LOL <BR><BR>I need to take some code that is in an ocx and convert it to a activex.dll. <BR>The vendor gave me the type library for the ocx. <BR><BR>I need to take the code at the end of this message and make an activex.dll <BR>out of it. From there I need to access this dll from an asp page to write <BR>data and read data. <BR><BR>I have no clue how to do this. Could someone please give me an idea of what <BR>the asp page would look like and what the dll would look like? <BR><BR>I need to read like 15 data items that I can define in the dll and post that <BR>data to a asp page. In order to read those data items I need to write one <BR>of them that I can also define in the dll code. <BR><BR>Basically what I want to do is click "Update" on a asp page. By clickin <BR>that It will write 1 data Item. wait 5 seconds and Read 15 data items. <BR><BR>Once again I&#039;m completely lost and would appreciate any help. <BR><BR>Thanks <BR><BR>Here is the original code of the ocx.that I need to convert to a dll. I do <BR>have the converted oca to tlb file from the vendor. <BR><BR>Globals------------------------------------ <BR>&#039; Data Item Types <BR>Public Const CounterType As Integer = 5 <BR>Public Const NumberType As Integer = 7 <BR>Public Const FloatType As Integer = 19 <BR>Public Const StringType As Integer = 22 <BR><BR>&#039; Error Codes <BR>Public Const ThinkAndDoSuccess As Integer = 1 <BR>Public Const ThinkAndDoOperationFailed As Integer = 0 <BR>Public Const ThinkAndDoNoDataTable As Integer = -1 <BR>Public Const ThinkAndDoTagNotFound As Integer = -2 <BR>Public Const ThinkAndDoNoProjectLoaded As Integer = -3 <BR>Public Const ThinkAndDoCOMFailure As Integer = -4 <BR>Public Const ThinkAndDoException As Integer = -5 <BR><BR>--------------------------------------------------------------- <BR>Form <BR><BR>Private Sub Form_Load() <BR>&#039; connect up with think and do <BR>If (ThinkAndDoSuccess &#060;&#062; TndNTag1.Connect) Then <BR>MsgBox "Couldn&#039;t connect with project" <BR>Unload ThinkAndDoNTagTest <BR>Else <BR>&#039; Register tag&#039;s <BR>nrc% = TndNTag1.StartTagList() <BR>nrc% = TndNTag1.AddToTagList(CounterType, 1, "") <BR>nrc% = TndNTag1.AddToTagList(CounterType, 2, "") <BR>nrc% = TndNTag1.AddToTagList(CounterType, 3, "") <BR>nrc% = TndNTag1.AddToTagList(CounterType, 4, "") <BR>nrc% = TndNTag1.AddToTagList(CounterType, 5, "") <BR>nrc% = TndNTag1.AddToTagList(CounterType, 6, "") <BR>nrc% = TndNTag1.AddToTagList(CounterType, 7, "") <BR>nrc% = TndNTag1.AddToTagList(CounterType, 8, "") <BR>nrc% = TndNTag1.AddToTagList(CounterType, 9, "") <BR>nrc% = TndNTag1.AddToTagList(CounterType, 10, "") <BR>nrc% = TndNTag1.AddToTagList(FloatType, 0, "") <BR>nrc% = TndNTag1.AddToTagList(NumberType, 0, "") <BR>nrc% = TndNTag1.AddToTagList(StringType, 0, "") <BR>nrc% = TndNTag1.EndTagList() <BR>End If <BR>End Sub <BR><BR>Private Sub ReadButton_Click() <BR>nrc% = TndNTag1.Read() <BR><BR>Text1.Text = TndNTag1.GetFirstValue() <BR>Text2.Text = TndNTag1.GetNextValue() <BR>Text3.Text = TndNTag1.GetNextValue() <BR>Text4.Text = TndNTag1.GetNextValue() <BR>Text5.Text = TndNTag1.GetNextValue() <BR>Text6.Text = TndNTag1.GetNextValue() <BR>Text7.Text = TndNTag1.GetNextValue() <BR>Text8.Text = TndNTag1.GetNextValue() <BR>Text9.Text = TndNTag1.GetNextValue() <BR>Text10.Text = TndNTag1.GetNextValue() <BR>Text11.Text = TndNTag1.GetNextValue() <BR>Text12.Text = TndNTag1.GetValueAt(11) <BR>Text13.Text = TndNTag1.GetValueAt(12) <BR><BR>End Sub <BR><BR>Private Sub WriteButton_Click() <BR>&#039; Tags are already there -- so we&#039;ll just set the values! <BR>Dim v As Variant <BR>v = CLng(Text1.Text) <BR>nrc% = TndNTag1.UpdateVariantValue(0, v) <BR>v = CLng(Text2.Text) <BR>nrc% = TndNTag1.UpdateVariantValue(1, v) <BR>v = CLng(Text3.Text) <BR>nrc% = TndNTag1.UpdateVariantValue(2, v) <BR>v = CLng(Text4.Text) <BR>nrc% = TndNTag1.UpdateVariantValue(3, v) <BR>v = CLng(Text5.Text) <BR>nrc% = TndNTag1.UpdateVariantValue(4, v) <BR>v = CLng(Text6.Text) <BR>nrc% = TndNTag1.UpdateVariantValue(5, v) <BR>v = CLng(Text7.Text) <BR>nrc% = TndNTag1.UpdateVariantValue(6, v) <BR>v = CLng(Text8.Text) <BR>nrc% = TndNTag1.UpdateVariantValue(7, v) <BR>v = CLng(Text9.Text) <BR>nrc% = TndNTag1.UpdateVariantValue(8, v) <BR>v = CLng(Text10.Text) <BR>nrc% = TndNTag1.UpdateVariantValue(9, v) <BR>&#039;v = CSng(Text11.Text) <BR>nrc% = TndNTag1.UpdateFloatValue(10, CSng(Text11.Text)) <BR>&#039;v = CLng(Text12.Text) <BR>nrc% = TndNTag1.UpdateLongValue(11, CLng(Text12.Text)) <BR>Dim s As String <BR>s = "Dude" <BR>nrc% = TndNTag1.UpdateStringValue(12, s) <BR><BR>&#039; Do the write <BR>nrc% = TndNTag1.Write() <BR><BR>End Sub<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default I don't think you will...

    ...with that ocx. It apparently expects to run on the client. For example, it pops up a MsgBox on failure. Can&#039;t do that with ASP and server-side code. And apparently the TextNN variables noted are actually client-side text boxes.<BR><BR>Mind you, I don&#039;t pretend to understand what that (somewhat poorly written) code is doing, but I just don&#039;t see how it can be expected to run on the server. <BR><BR>And where is TndNTag1 defined and created and whatever??? Certainly not in any of the code you show.<BR><BR>I think you&#039;re going to have to start over with this one.<BR><BR>Oh...and ASP also doesn&#039;t have any (built-in) way to wait 5 seconds, either. Again, that&#039;s not something you normally want to do on a server.<BR><BR>I think you are trying to mix water and oil here, and you don&#039;t have the ultrasonic mixer you need to make that work.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Nice analogy Bill :-)

    --&#062;I think you are trying to mix water and oil here, and you don&#039;t have the ultrasonic mixer you need to make that work.&#060;--<BR><BR><BR><BR>cheers! <BR><BR>Sincerely<BR>Vlince<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts