Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX DLL...How to...???

Status
Not open for further replies.

JerryKreischer

Programmer
Jul 31, 2003
20
US
I have an ActiveX DLL that I need for a specialized App that will reset the date/time of the client's machine - wriiten in VB6...
I have 1 public property -

Private mvarClientDate As Variant

Public Property Let ClientDate(ByVal vData As Variant)
mvarClientDate = vData
End Property

Public Property Get ClientDate() As Variant
ClientDate = mvarClientDate
End Property


I have a module that contains a 'Sub Main()'

Public Sub Main()
Dim cls As New ClientTime
On Error Resume Next
If IsDate(cls.ClientDate) Then
Date = Format(cls.ClientDate, "MM/DD/YYYY")
Time = Format(cls.ClientDate, "HH:MM:SS")
Else
MsgBox "Could not set date/time..."
End If
End Sub



I also have the OBJECT info re: the control defined in my page:

function CreateTimeClient() {
document.write(' <OBJECT ID=&quot;TimeClient&quot; CLASSID=&quot;CLSID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&quot;\n');
document.write(' TYPE = &quot;application/x-oleobject&quot;\n');
document.write(' CODEBASE=&quot; document.write('<param name=ClientDate value=&quot;01/01/2004 06:00:00 AM&quot; />');
document.write(' </OBJECT>\n');
}


When I execute this, the param (ClientDate) is not being passed to the DLL (I have used other MSGBOXs to verify this)...


Does anyone know what I'm missing??? Do I somehow have to 'Get' the param value?? How??

Thanx in advance
Jerry
 
Sounds like your
Code:
IsDate
function is not recognizing its argument as a value that can be converted to a date. You might have to do some formatting on the value while it is in the dll to ensure that it can be converted to a date.

You can place the line,

Code:
Debug.Print cls.ClientDate

before the
Code:
IsDate
function to see exactly what is being returned and make adjustments accordingly.

Take Care,

zemp

&quot;If the grass looks greener... it's probably because there is more manure.&quot;
 
Sorry...I also tried using different MsgBox's to display the ClientDate before the 'IsDate' test, and it always showed up empty...

I keep thinking there must be a way of 'Get'ing or 'Read'ing the params from the HTML...They don't seem to be passed to the DLL automatically...

Thanx
Jerry
 
You have the date in the dll set up as a property and not a parameter. I think you have to look into how to set a property or change it to a parameter. Whichever is easier.

Take Care,

zemp

&quot;If the grass looks greener... it's probably because there is more manure.&quot;
 
Zemp...

That's the reason for the question...How to get the param passed into the DLL...

Jerry
 
Something along the lines of

Code:
cls.Clientdate = ??

Then you need to have your dll code run on the value .



Take Care,

zemp

&quot;If the grass looks greener... it's probably because there is more manure.&quot;
 
No...I never was able to figure it out. I wound up writing a Browser Helper Object (BHO) that did what I needed.

Sorry...

Jerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top