C++ -> Fivewin

C++ -> Fivewin

Postby sambomb » Thu Apr 15, 2010 2:30 pm

I have to convert an function in C++ to fivewin, but i'm having trouble with struct

There is the files .CPP and .H
http://www.4shared.com/file/6A3J6R76/RFDBinarioC.html

Here is my BIGGEST trouble, the Struct DLLReadStatusData and the method LeStatus()

Code: Select all  Expand view

#pragma once

#include <windows.h>

typedef int (WINAPI *TRATADORA) (long lnErro, LPSTR szDescricao, char bErroNaoFatal );

struct DLLReadStatusData {
    int nTamanhoStatus;
    int nSituacaoAtual;
    int nCodigoErro;
    long lnTamanhoLeitura;
    long lnProgressoLeitura;
    char* szSituacaoAtual;
};

class CLeitura
{
public:
    CLeitura(void);
    ~CLeitura(void);
    // Define o BaudRate de comunicação com a impressora
    void DefineBaudRate(long lnBaudRate);
    // Lê as memórias MF e MFD da impressora e grava em arquivo
    int LeMemorias(char* szPortaSerial, char* szNomeArquivo, char* szSerieECF, char bAguardaConcluirLeitura);
    // Cancelar a leitura das Memórias
    void CancelaLeitura(void);
    // Lê a versão da DLL
    void Versao(char* szVersao);
    // Retorna o status atual do processo de Leitura
    int LeStatus(DLLReadStatusData* pStatusData);
    // Função usada para definir a função de callback que será responsável por tratar os erros da Leitura.dll
    void TrataErro(TRATADORA funcTratadora);
private:
    // Handle para a Leitura.dll
    HINSTANCE m_hLeituraDLL;
};
 
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: C++ -> Fivewin

Postby Antonio Linares » Thu Apr 15, 2010 6:09 pm

Samir,

What error do you get ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: C++ -> Fivewin

Postby sambomb » Sat Apr 17, 2010 1:29 am

The program abort when I call de dll with the parameter as ptr. Ptr because I need to receive the var send by reference...
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: C++ -> Fivewin

Postby Antonio Linares » Sat Apr 17, 2010 7:43 am

Samir,

Please show me how you are calling the DLL function from your PRG
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Marc Venken and 98 guests