FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour C++ -> Fivewin
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
C++ -> Fivewin
Posted: Thu Apr 15, 2010 02: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 (fw): Select all Collapse
#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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: C++ -&gt; Fivewin
Posted: Thu Apr 15, 2010 06:09 PM

Samir,

What error do you get ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: C++ -&gt; Fivewin
Posted: Sat Apr 17, 2010 01: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: C++ -&gt; Fivewin
Posted: Sat Apr 17, 2010 07:43 AM

Samir,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion