1
How do I pass VB6 parameters?
Private Sub Command1_Click()
    Dim cnpj As String
    cnpj = "tal"
    Dim chaveCliente As String
    chaveCliente = "tal"
    Dim chaveAcesso As String
    chaveAcesso = "tal"
    Dim status As String
    status = ""
    Dim protocolo As String
    protocolo = ""
    Dim motivoRejeicao As String
    motivoRejeicao = ""
    Dim objFuncao As Funcao
    Set objFuncao = New Funcao
    objFuncao.Consultar(ByVal cnpj As String)
Whereas the Funcao was added as a reference to a COM created in .NET.
It is giving syntax error, but everywhere I looked for the syntax of sending parameters is the one in the code.
Is there any other alternative or am I doing wrong?
Is the problem on that line? objFuncao.Query(Byval cnpj As String) You should probably just call cnpj with parameter like this: objFuncao.Query(cnpj)
– iuristona
What error are you making? Try to explain a little more about your question.
– Felipe Avelar
The only sentence VB6 returns is that it has a syntax error. I am wanting to send all variables as a parameter to the function that is in the DLL created in . NET, which would look something like this: objFuncao.Query(cnpj, keyClient, keyCcess), but with Byval and writing with cnpj As String, always from syntax error
– Thiago Alex
It seems that you are confusing something, only used (Byval cnpj as String) in the definition of a method and not in your call.
– iuristona
I get it, passing parameters only passes the variables even. Now I have another question, in C# I pass some variables of type out empty String along with the method and it returns me the filled variables, as I do this in vb6?
– Thiago Alex