Hola, no he podido encontrar el fallo asi que he decido replantearme el camino a seguir. He creado otro activeX que es llamado por el primero para coger los datos.
El problem aes que al compilar me aparece el siguiente error:
No se encuentra el miembro o metodo de datos:
Este es el codigo:
'These members represent the main TestType object properties.
Public RemoteAgentCLSID As String ' Run Remote Agent Class ID
Public ScriptViewerCLSID As String ' ActiveX script viewer Class ID
Public TestingToolName As String ' Remote Agent name
Public ExecConfigCLSID As String ' Configuration Class ID
Public CanCreateScriptTemplate As Long ' Flag
Public LastErrorMessage As String ' Most common error message
Public ResultViewerCLSID As String ' ActiveX result viewer Class ID
Private td As TDConnection
'variable of type clsActivexEx class in Activex_ex component
'create an object for class clsActivexEx in AxtivexEx component
Dim actvixTest As Class1
Private Sub Class_Initialize()
'This sub-routine is run when the TestType is loaded.
'Note that at this time, none of the optional controls is
' supported, as their class ID strings are empty.
'Also note that the remote agent class ID is empty,
' as no such agent yet exists.
'This example does not support script templates,
' and has only one error type.
ExecConfigCLSID = "" ' No configuration utility provided
RemoteAgentCLSID = "{78888EDF-6BCB-4477-AB18-9DA7D483CC52}"
ScriptViewerCLSID = "{472B9CAC-C738-43BE-A0A7-EB6AB1B8BDEA}"
TestingToolName = "Script"
CanCreateScriptTemplate = 1 ' create new test feature turned on
LastErrorMessage = "" ' Testing issues
ResultViewerCLSID = "" ' No result viewer ActiveX provided
LoadPicture ""
End Sub
Public Sub Init(mytd As Variant)
' You may need a TDConnection to use OTA functions in your application.
' If you do, add a project reference to the OTA:
' In Projects > References, check the "OTA COM 8.0 Type Library."
' and declare a module-level variable: Private td As TDConnection
Set td = mytd 'Get the td object to be used if needed
End Sub
Public Function CreateScriptTemplate(TestKey As Long, _
ByRef LocalPath As String) As Long
Set actvixTest = New Class1
' Create a batch file to emulate a test script for
' this example
Dim myf As String
Dim path As String
'Load the form to interact with the user and get the data
[b]actvixTest.LoadForm[/b]
path = actvixTest.getselectedchar
actvixTest.Form_Unload
LocalPath = "c:\temp"
myf = "C:\temp\batch.bat"
Open myf For Output As #1
Print #1, "cd C:\Archivos de Programa\NUnit 2.4.5\bin" & vbCrLf & "nunit.exe" & vbCrLf & "pause"
Print #1, vbCrLf & path
Close #1
CreateScriptTemplate = 1
End Function
Public Function GetBitmap(Status As Long) As Long
GetBitmap = 0 'no bitmap
End Function
Private Sub Form_Unload(Cancel As Integer)
'on closing the form set the object actvixTest to point to nothing
'thereby removing reference the class clsActivexEx in component Activex_ex
Set actvixTest = Nothing
End Sub
El error me lo da en "actvixTest.LoadForm"
El codigo del .cls del activeX es:
Option Explicit
Public Function LoadForm()
'Load the form
Load formActiveX
formActiveX.Caption = formActiveX.Caption
formActiveX.Show
End Function
Private Sub Class_Initialize()
'selectedItem is a global variable declared in module
'set it to nothing initially
'whcih implies that no item has been selected
selectedItem = "nothing"
End Sub
Private Sub Class_Terminate()
'on terminating unload the form
Unload formActiveX
End Sub
Public Function getselectedchar() As String
'function that gets the item selected in the drop-down box
getselectedchar = selectedItem
End Function
Public Sub Form_Unload()
Unload formActiveX
End Sub
Tb he añadido una referencia a este ultimo archivo.
Gracias y Saludos