Fórum Passar parâmetos #393854

17/01/2011

0

  Estou utilizando um leitor que usa a csp2.dll. Gostaria de saber como passar os parâmetros para a função abaixo:   function csp2GetDeviceId(szDeviceId:char; nMaxLength: LongInt) : Longint; stdcall; External 'csp2.dll';   Grato
Pedro Amorim

Pedro Amorim

Responder

Posts

17/01/2011

Marco Salles

  Estou utilizando um leitor que usa a csp2.dll. Gostaria de saber como passar os parâmetros para a função abaixo:   function csp2GetDeviceId(szDeviceId:char; nMaxLength: LongInt) : Longint; stdcall; External 'csp2.dll';   Grato
  não seria Pchar ????
Responder

Gostei + 0

18/01/2011

Pedro Amorim

Desculpe, A função é com Phar. Poderia ajudar-me?   function csp2GetDeviceId(szDeviceId:Pchar; nMaxLength: LongInt) : Longint; stdcall; External 'csp2.dll';   Grato.
Responder

Gostei + 0

18/01/2011

Leonardo Xavier

Você ja tentou assim?
csp2GetDeviceId(char szDeviceId[8], long nMaxLength);

Responder

Gostei + 0

18/01/2011

Marco Salles

ou utilizando o ponteiro  
var 
Ponteiro: array [0..7] of Char; 
begin 
  csp2GetDeviceId(@Ponteiro[0], SizeOf(Ponteiro));
....
Responder

Gostei + 0

18/01/2011

Pedro Amorim

void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF, szDeviceID[ 2 ] & 0xFF, szDeviceID[ 3 ] & 0xFF, szDeviceID[ 4 ] & 0xFF, szDeviceID[ 5 ] & 0xFF, szDeviceID[ 6 ] & 0xFF, szDeviceID[ 7 ] & 0xFF, szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

18/01/2011

Pedro Amorim

void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF,                                                                                             szDeviceID[ 2 ] & 0xFF, szDeviceID[ 3 ] & 0xFF, szDeviceID[ 4 ] & 0xFF, szDeviceID[ 5 ] & 0xFF, szDeviceID[ 6 ] & 0xFF, szDeviceID[ 7 ] & 0xFF, szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

18/01/2011

Pedro Amorim

void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF,                                                                                              szDeviceID[ 2 ] & 0xFF, szDeviceID[ 3 ] & 0xFF, szDeviceID[ 4 ] & 0xFF, szDeviceID[ 5 ] & 0xFF, szDeviceID[ 6 ] & 0xFF, szDeviceID[ 7 ] & 0xFF, szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

18/01/2011

Pedro Amorim

void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF,                                                                                              szDeviceID[ 2 ] & 0xFF,                                                                                                  szDeviceID[ 3 ] & 0xFF, szDeviceID[ 4 ] & 0xFF, szDeviceID[ 5 ] & 0xFF, szDeviceID[ 6 ] & 0xFF, szDeviceID[ 7 ] & 0xFF, szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

18/01/2011

Pedro Amorim

 Por favor, Na verdade tenho o que   void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF,                                                                                              szDeviceID[ 2 ] & 0xFF,                                                                                              szDeviceID[ 3 ] & 0xFF,                                                                                              szDeviceID[ 4 ] & 0xFF,                                                                                              szDeviceID[ 5 ] & 0xFF,                                                                                              szDeviceID[ 6 ] & 0xFF,                                                                                              szDeviceID[ 7 ] & 0xFF,                                                                                              szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

18/01/2011

Pedro Amorim

 Por favor, Na verdade tenho o que segue   void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF,                                                                                              szDeviceID[ 2 ] & 0xFF,                                                                                              szDeviceID[ 3 ] & 0xFF,                                                                                              szDeviceID[ 4 ] & 0xFF,                                                                                              szDeviceID[ 5 ] & 0xFF,                                                                                              szDeviceID[ 6 ] & 0xFF,                                                                                              szDeviceID[ 7 ] & 0xFF,                                                                                              szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

18/01/2011

Pedro Amorim

 Por favor, Na verdade tenho o que segue em   void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF,                                                                                              szDeviceID[ 2 ] & 0xFF,                                                                                              szDeviceID[ 3 ] & 0xFF,                                                                                              szDeviceID[ 4 ] & 0xFF,                                                                                              szDeviceID[ 5 ] & 0xFF,                                                                                              szDeviceID[ 6 ] & 0xFF,                                                                                              szDeviceID[ 7 ] & 0xFF,                                                                                              szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

18/01/2011

Pedro Amorim

 Por favor, Na verdade tenho o que segue em C# e   void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF,                                                                                              szDeviceID[ 2 ] & 0xFF,                                                                                              szDeviceID[ 3 ] & 0xFF,                                                                                              szDeviceID[ 4 ] & 0xFF,                                                                                              szDeviceID[ 5 ] & 0xFF,                                                                                              szDeviceID[ 6 ] & 0xFF,                                                                                              szDeviceID[ 7 ] & 0xFF,                                                                                              szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

18/01/2011

Pedro Amorim

 Por favor, Na verdade tenho o que segue em C# e gostari   void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF,                                                                                              szDeviceID[ 2 ] & 0xFF,                                                                                              szDeviceID[ 3 ] & 0xFF,                                                                                              szDeviceID[ 4 ] & 0xFF,                                                                                              szDeviceID[ 5 ] & 0xFF,                                                                                              szDeviceID[ 6 ] & 0xFF,                                                                                              szDeviceID[ 7 ] & 0xFF,                                                                                              szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

18/01/2011

Pedro Amorim

 Por favor, Na verdade tenho o que segue em C# e gostaria de   void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF,                                                                                              szDeviceID[ 2 ] & 0xFF,                                                                                              szDeviceID[ 3 ] & 0xFF,                                                                                              szDeviceID[ 4 ] & 0xFF,                                                                                              szDeviceID[ 5 ] & 0xFF,                                                                                              szDeviceID[ 6 ] & 0xFF,                                                                                              szDeviceID[ 7 ] & 0xFF,                                                                                              szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

18/01/2011

Pedro Amorim

 Por favor, Na verdade tenho o que segue em C# e gostaria de ter em   void COPN2001_DEMODlg::OnBnClickedBtnInterrogate() { long lRet; unsigned char szDeviceID[10]; CString strTemp; lRet = csp2Interrogate(); csp2GetDeviceId( (char*)szDeviceID, 9); strTemp.Format( _T("%02X%02X%02X%02X%02X%02X%02X%02X"), szDeviceID[ 0 ] & 0xFF,                                                                                              szDeviceID[ 1 ] & 0xFF,                                                                                              szDeviceID[ 2 ] & 0xFF,                                                                                              szDeviceID[ 3 ] & 0xFF,                                                                                              szDeviceID[ 4 ] & 0xFF,                                                                                              szDeviceID[ 5 ] & 0xFF,                                                                                              szDeviceID[ 6 ] & 0xFF,                                                                                              szDeviceID[ 7 ] & 0xFF,                                                                                              szDeviceID[ 8 ] & 0xFF); m_statID.SetWindowText( strTemp ); }
Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar