Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
$set mfoo
class-id. ECF.
environment division.
input-output section.
*
object section.
class-control.
Util is class "Util"
.
special-names.
call-convention 2 is DSDLL.
*>----------------------------------------------------------------
data division.
file section.
*
working-storage section. *> Definition of global data
77 cmdstatus pic s9 comp-5.
77 cmdstatus-r pic s9.
*Crio um ponteiro
*-----variaveis do ecf --------
*variavel utilizada para carregar a DLL na memoria
01 SAT-Tanca usage is procedure-pointer.
*>----------------------------------------------------------------
class-object. *> Definition of class data and methods
*>----------------------------------------------------------------
object-storage section.
*>----------------------------------------------------------------
*> Poe Nulo no final
*>----------------------------------------------------------------
method-id. "PoeNulo".
01 i Pic X(4) comp-5.
01 j Pic X(4) comp-5.
linkage section.
77 zSTR pic x(256).
procedure division using zSTR. *> by value i.
MOVE LENGTH OF zStr TO j
perform varying i from j by -1 until i = 0
if zSTR(i:1) not = space and x"0"
add 1 to i
move x"0" to zSTR(i:1)
exit method
end-if
end-perform.
exit method.
end method "PoeNulo".
*>----------------------------------------------------------------
*>----------------------------------------------------------------
*> I N I C I O D A S R O T I N A S
*> SAT-CFe
*>----------------------------------------------------------------
*>----------------------------------------------------------------
method-id. "SATEnviarCFe".
local-storage section.
01 WS-NRO-OFI pic x(006).
01 RZ-INFADCONTRIB pic x(008).
01 retorno pic x(008).
01 codigoDeAtivacao pic x(009).
01 DataBlock-Pointer usage pointer.
01 w-campos-ret.
03 w-campo1 pic x(256).
03 w-campo2 pic x(256).
03 w-campo3 pic x(256).
03 w-campo4 pic x(256).
03 w-campo5 pic x(256).
03 w-campo6 pic x(256).
linkage section.
01 lnk-datahoraimp.
03 lnk-dataimp pic x(006).
03 lnk-horaimp pic x(006).
01 lnk-erro.
02 lnk-fs pic x(002).
02 lnk-mensagem pic x(040).
01 VDA-DATA-BLOCK.
05 VDA-IO-TEXT-BUFFER2 PIC X(256).
procedure division.
*>Seto essa variável para cada um dos sat.
set SAT-Tanca to entry "SAT.dll".
move "000001" to ws-nro-ofi
move z"12345678" to rz-infadcontrib codigoDeAtivacao
CALL DSDLL "ConsultarStatusOperacional" using
ws-Nro-ofi
by reference codigoDeAtivacao
returning DataBlock-Pointer
*>Ai pego o retorno
set address of VDA-DATA-BLOCK to DataBlock-Pointer
perform trata-retorno
move spaces to VDA-IO-TEXT-BUFFER2
exit method.
processos-ok.
CALL DSDLL "ConsultarSAT" using WS-Nro-ofi
returning DataBlock-Pointer
set address of VDA-DATA-BLOCK to DataBlock-Pointer
perform trata-retorno
move spaces to VDA-IO-TEXT-BUFFER2
CANCEL "ConsultarSAT"
exit method.
trata-retorno.
unstring VDA-IO-TEXT-BUFFER2
delimited by "|" into w-campo1
w-campo2
w-campo3
w-campo4
w-campo5
w-campo6
end method "SATEnviarCFe".
end class-object.
Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
A few questions for you:
Is SAT.dll written in Net Express? If it is then it too will have to be recompiled using Visual COBOL.
What is the error that you are receiving?
Is the set SAT-Tanca to entry "SAT.dll" statement loading the .dll? Try removing the .dll extension from name.
Are the calling program and the called program both the same bitism?
Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
Not SAT.dll was not done in NetExpress.
I put the image of the error, but my Visual Studio is in Portuguese: www.mmsis.com.br/images/Erro_SAT.png
I took the .dll but the error persists
Are the calling program and the called program both the same bitism? I did not understand that.
Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
This looks like you are trying to call this native .dll from a managed .NET program in Visual COBOL whereas you were calling it from a native program in Net Express, correct?
Are you compiling the OO program that you show above as managed code or is that compiled as native code? I am a bit confused because the syntax of the program you are showing uses the old native OO syntax and not the new managed syntax.
If you are calling a native .dll from a managed code program then they must be using the same bitism. That means that if SAT.dll is a 32-bit .dll then your managed project should also have a target of x86 and not x64 or anyCPU. If SAT.dll is a 64-bit .dll then your managed project should be targeting x64.
Can you check your project properties on the COBOL tab and tell me what the target CPU is set to?
Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
- I do not understand anything, the DLL was written in C # if it is native I have no idea.
- That's how I learned and this working out for that will change, I do not know anything about the managed syntax.
- SAT.dll is a 32-bit dll, Yes my project is set to AnyCPU.
Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
Pita, tente o seguinte:
Crie um novo projeto nativo dentro da solução.
adiciona a dll
selecione propriedades do projeto nativo e informe a plataforma 86x
No projeto da aplicação insira algo como:
declare myClass as type solution.projectNative = new solution.projetcNative()
declare myString as string = "visual cobol"
invoke myClass::nameMethod(myString)
display myString.
Penso que isso irá te ajudar.
Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
Altair, adicionar a dll, onde? Fica complicado programei em NET Express por muito tempo agora temos que nos adaptar a esta nova plataforma e esta bem complicado, não encontramos nada na WEB sobre VC e para fazer qualquer coisa temos que recorrer a programação C# ai traduzir para o Cobol. Veja eu tenho um código que esta em BASE64 passei a pergunta mas não sei se temos que falar que queremos converter ou decodificar, a língua portuguesa nos prega muitas peças, principalmente para traduzir para o Inglês usando o Google Tradutor.
Só um desabafo, voltando ao assunto, fiz um projeto Nativo mas não sei onde adicionar a dll.
Grande abraço e obrigado pelo tempo.
Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
Na verdade, você não precisa criar um projeto nativo. Click-right sobre o nome do projeto e Add Reference > Browse e selecione a DLL desejada. Depois é só fazer a chamada. Anexei um arquivo com dois projetos, um em VB.NET (DLL) e outro em Visual Cobol chamando a DLL. Espero que possa lhe ajudar. Caso ainda não saiba, escrevi o livro Visual Cobol for .NET disponível nas livrarias online AgBook e Saraiva.
In fact, you do not need to create a native project. Click-right on the project name and Add Reference> Browse and select the desired DLL. Then just make the call. I have attached one file with two projects, one in VB.NET (DLL) and another in Visual Cobol calling the DLL. I hope you can help. If you still do not know, I wrote a book Visual COBOL for .NETavailable in online bookstores AgBook and Saraiva.
Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
Pita,
It worked? Funcionou?
Good morning, I am again with this old problem, I need to convert this program done in Net EXpress to Visual Cobol, noting que the program works Correctly in NetExpress but in Visual Cobol can not load the DLL. The dll this installed in windows \\ system32 folder. Thank you.
O exemplo que você me passou funciona, vou tentar fazer a adaptação para o SAT.dll mas agora tenho que terminar o processo com o ACBr já esta muito atrasado. Obrigado
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.