Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > .NET
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 22-07-2007
carlohg carlohg is offline
Registrado
 
Registrado: may 2007
Ubicación: Medellin - Colombia
Posts: 9
Poder: 0
carlohg Va por buen camino
Importanto DLL de .NET a DELPHI

he creado una clase en visual 2005 y le he activado COM class y COM Visible.

En delphi lo agrego de la siguiente forma:

component - import componenet - Import :NET assembly

Y asi logro importar mi DLL.

El problema es que cuando quiero accederla me aparece lo siguiente

unit ADQclass_TLB;
// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //
// $Rev: 5081 $
// File generated on 22/07/2007 04:07:59 p.m. from Type Library described below.
// ************************************************************************ //
// Type Lib: C:\Documents and Settings\Carlos Horacio\Mis documentos\Visual Studio 2005\Projects\ADQclass\ADQclass\bin\Debug\ADQclass.dll (1)
// LIBID: {2B16395E-8105-4512-A8B0-47408899AE9B}
// LCID: 0
// Helpfile:
// HelpString:
// DepndLst:
// (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface
uses Windows, ActiveX, Classes, Graphics, StdVCL, Variants;

// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
ADQclassMajorVersion = 1;
ADQclassMinorVersion = 0;
LIBID_ADQclass: TGUID = '{2B16395E-8105-4512-A8B0-47408899AE9B}';
IID__ADQclass: TGUID = '{05C172B5-176E-3BFD-9259-7003E12020FC}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
_ADQclass = interface;
_ADQclassDisp = dispinterface;
// *********************************************************************//
// Interface: _ADQclass
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {05C172B5-176E-3BFD-9259-7003E12020FC}
// *********************************************************************//
_ADQclass = interface(IDispatch)
['{05C172B5-176E-3BFD-9259-7003E12020FC}']
procedure ConfStart; safecall;
procedure Detener; safecall;
function Get_SizePaq: Integer; safecall;
procedure Set_SizePaq(pRetVal: Integer); safecall;
function Get_FrecAdq: Integer; safecall;
procedure Set_FrecAdq(pRetVal: Integer); safecall;
function Get_Limite: Integer; safecall;
procedure Set_Limite(pRetVal: Integer); safecall;
property SizePaq: Integer read Get_SizePaq write Set_SizePaq;
property FrecAdq: Integer read Get_FrecAdq write Set_FrecAdq;
property Limite: Integer read Get_Limite write Set_Limite;
end;
// *********************************************************************//
// DispIntf: _ADQclassDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {05C172B5-176E-3BFD-9259-7003E12020FC}
// *********************************************************************//
_ADQclassDisp = dispinterface
['{05C172B5-176E-3BFD-9259-7003E12020FC}']
procedure ConfStart; dispid 1;
procedure Detener; dispid 2;
property SizePaq: Integer dispid 3;
property FrecAdq: Integer dispid 4;
property Limite: Integer dispid 5;
end;
implementation
uses ComObj;
end.

no se como acceder a mis propiedads ni a mis funciones ni procedimientos,
no se si falta un create o algo asi???

Gracias a cualquier información.
Responder Con Cita
  #2  
Antiguo 22-07-2007
carlohg carlohg is offline
Registrado
 
Registrado: may 2007
Ubicación: Medellin - Colombia
Posts: 9
Poder: 0
carlohg Va por buen camino

Esta es mi clase en visual 2005

Imports
NationalInstruments.DAQmx
<Microsoft.VisualBasic.ComClass()>
PublicClass ADQclass
Private myTask As Task
Private runningTask As Task
Private data AsDouble(,)
Private analogInReader As AnalogMultiChannelReader
Private analogCallback As AsyncCallback
Private FSizePaq AsInteger = 4096
Private FFrecAdq AsInteger = 4096
Private FLimite AsInteger = 10
Public Senales(,) AsDouble
Public Senales16(,) AsSingle
PublicSub ConfStart()
If runningTask IsNothingThen
Try
'Crear la tarea
myTask = New Task()
'Crear y configuro canales
myTask.AIChannels.CreateVoltageChannel("Dev1/ai0:31", "", AITerminalConfiguration.Nrse, Convert.ToDouble(-FLimite), Convert.ToDouble(FLimite), AIVoltageUnits.Volts)
myTask.Timing.ConfigureSampleClock(
"", Convert.ToDouble(FFrecAdq), SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples, FSizePaq)
'Verifico la tarea
myTask.Control(TaskAction.Verify)
runningTask = myTask
analogInReader =
New AnalogMultiChannelReader(myTask.Stream)
analogInReader.SynchronizeCallbacks =
True
analogCallback = New AsyncCallback(AddressOf AnalogInCallback)
analogInReader.BeginReadMultiSample(Convert.ToInt32(FSizePaq), analogCallback, myTask)
Catch exception As DaqException
'Escribir en archivo de reportes
runningTask = Nothing
myTask.Dispose()
EndTry
EndIf
EndSub
PrivateSub AnalogInCallback(ByVal ar As IAsyncResult)
Try
If runningTask Is ar.AsyncState Then
data = analogInReader.EndReadMultiSample(ar)
Senales = data
analogInReader.BeginReadMultiSample(Convert.ToInt32(FSizePaq), analogCallback, myTask)
EndIf
Catch ex As DaqException
'Escribir en archivo de reportes
runningTask = Nothing
myTask.Dispose()
EndTry
EndSub
PublicSub Detener()
IfNot (runningTask IsNothing) Then
runningTask = Nothing
myTask.Dispose()
EndIf
EndSub
PublicProperty SizePaq() AsInteger
Get
Return FSizePaq
EndGet
Set(ByVal value AsInteger)
FSizePaq = value
EndSet
EndProperty
PublicProperty FrecAdq() AsInteger
Get
Return FFrecAdq
EndGet
Set(ByVal value AsInteger)
FFrecAdq = value
EndSet
EndProperty
PublicProperty Limite() AsInteger
Get
Return FLimite
EndGet
Set(ByVal value AsInteger)
FLimite = value
EndSet
EndProperty
End
Class
Responder Con Cita
  #3  
Antiguo 13-08-2007
Jair Garza Jair Garza is offline
Registrado
 
Registrado: ago 2007
Posts: 5
Poder: 0
Jair Garza Va por buen camino
Que tal a todos me acabo de registrar en el foro y me llamo mucho la atencion este post

Yo estoy haciendo exactamente lo mismo con los mismos resultados, no puedo acceder a ninguno de lo metodos de la clase, el ensamblado no es mio es de otro proveedor por lo tanto no puedo acceder a ese codigo.

Solo queria preguntarle a carlohg o a alguien mas si pudieron resolver esta situacion

Saludos
Jair Garza
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Lanzamiento Delphi 2007, PHP y JBuilder 2007 R2 Santiago - Chile Andreano Noticias 4 14-05-2007 09:25:23
Trial 14 días para delphi 2007 y delphi PHP Luis M. Noticias 1 17-04-2007 18:59:27
delphi 2006 / delphi 2007 y Visual estudio 2005 avmm2004 Varios 2 13-04-2007 20:50:07
Lanzamiento de Delphi 2007 y Delphi para PHP en México con David I Andreano Noticias 13 27-02-2007 21:16:04
Lanzamiento de Delphi 2007 y Delphi para PHP en Bogotá - Colombia Andreano Noticias 9 25-02-2007 19:09:42


La franja horaria es GMT +2. Ahora son las 03:03:33.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi