I'm having to use methods from a DLL that was developed by third parties. I have only the ".DLL" file.
The DLL documentation is scarce ... there is an example of executing the method I need in VB
Private Const TamMsgErro As Long = 1000
Dim oTED As New clsGeraMidiaTed
Dim lResult As Long
Dim sMsgErroTED As String * TamMsgErro
'Chamada no Projeto
Set oTED = CreateObject("PRGerarMidiaTED.clsGeraMidiaTED")
lResult = oTED.Gerar_MidiaTEDDat(sListaArqEntrada, _
sArqSaida, _
sTipoDoc, _
sMsgErroTED, _
TamMsgErro)
If lResult <> 0 Then
MsgBox sMsgErroTED
Else
MsgBox "Arquivo [" & sArqSaida & "] gerado com sucesso !"
End If
I need to develop in Delphi, and the problem I'm having is that the "Gerar_MidiaTEDDat" method is not exported by the DLL. This method is in a class in the DLL.
Using PE Explorer I was able to get the following data from the DLL:
//PRGerarMidiaTED
//Version: 1.0
PRGerarMidiaTED;
GUID = {DA0AA6B5-73AC-41B7-BBA5-DF03D6367C63};
Dispatch _clsGeraMidiaTed;
GUID = {EEF15A9A-5C3E-45A0-B876-4E10381C7D2E};
function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
function AddRef: UI4; stdcall;
function Release: UI4; stdcall;
function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
function Gerar_MidiaTEDDat(sListaArqEntrada: BSTR; sArqSaida: BSTR; sTipoDoc: BSTR; out sMsgErro: ^BSTR; lTamMsgErro: I4): I4; stdcall;
function Verificar_VersaoGerarMidiaTED(out sVersaoGerarMidia: ^BSTR; out sMsgErro: ^BSTR; lTamMsgErro: I4): Bool; stdcall;
CoClass clsGeraMidiaTed;
GUID = {664BF784-A2D6-477B-8022-1F32FDD90FD6};
In the exported functions, PE Explorer indicated that there is a DllGetClassObject
function that should be used to get the class instance, but I have not found any examples of how to do this.
Any suggestions?