Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STL iterators and post/pre incrementing Pin
Tim Smith4-Aug-04 4:05
Tim Smith4-Aug-04 4:05 
GeneralRe: STL iterators and post/pre incrementing Pin
Anonymous4-Aug-04 17:58
Anonymous4-Aug-04 17:58 
Generalsorry Pin
yingkou4-Aug-04 2:33
yingkou4-Aug-04 2:33 
GeneralRe: sorry Pin
Antony M Kancidrowski4-Aug-04 2:59
Antony M Kancidrowski4-Aug-04 2:59 
GeneralRe: sorry Pin
palbano4-Aug-04 4:59
palbano4-Aug-04 4:59 
GeneralRe: sorry Pin
yingkou4-Aug-04 15:19
yingkou4-Aug-04 15:19 
GeneralRe: sorry Pin
bikram singh5-Aug-04 7:19
bikram singh5-Aug-04 7:19 
QuestionHow to use a external Vfp DLL with VC++ Pin
paulotharso4-Aug-04 1:42
paulotharso4-Aug-04 1:42 
I have a problem to use a DLL done in Vfp 8 with a code in VC++.

The source codes is below.

The message-> Warning: attempt to call Invoke with NULL m_lpDispatch!

is showed when the canal.processar routine is called.

Somebody can help me????

PauloTharsoSmile | :)
ptharso@hotmail.com


***********************teleway.cpp -----------------------------------------------------
#include "stdafx.h"
#include "Teleway.h"
#include "canalfoxdll.h" // Added by ClassView
#include "k3l.h" // Added by Paulo

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CWinApp theApp; // The one and only application object
using namespace std;

Icanalfoxsrv canal; byte Info[20]; int key;

int32 Kstdcall Processador ( int32 Obj, K3L_EVENT *E ){ cout << "Processando eventos\n";

if (E->ObjectId == koiChannel || E->ObjectId == koiPlayer){
memcpy(Info,(char *)E + 28,E->ParamSize);
key = canal.processar(E->DeviceId,E->ObjectId,E->Code,E->AddInfo,E->ParamSize,(const char *)Info); // chamafox
if(!key) cout << "OK!"; else cout << "Falha no canal: " << E->ObjectId << endl;
}
return TRUE;
}

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; int check=FALSE;

Icanalfoxsrv * canal = new Icanalfoxsrv;

if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)){
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}else{
CString strHello; strHello.LoadString(IDS_HELLO);
cout << (LPCTSTR)strHello << endl;
if (check!=TRUE) { char *Ret = k3lStart();
if (!Ret || !*Ret) k3lRegisterEventHandler( Processador );
check = TRUE;
}
// K3L_EVENT * wrk = new K3L_EVENT ; wrk->Code=1; wrk->ObjectId=1; wrk->ParamSize=8;
// Processador(2,wrk);
}
return nRetCode;
}
***********************canalfoxsrv.dll--------------------------------------------------
DEFINE CLASS canalfoxsrv as Session olepublic

PROCEDURE processar(p as Long,c as Long,e as Long,r as Long,l as Long,a as String ) as Integer
IF p<1 OR c>59 OR c<0 THEN
RETURN 1
ENDIF
INSERT INTO canalfoxtbl (placa,canal,evento,parametro,tamanho,adicional) VALUES (p,c,e,r,l,a)
RETURN 0
ENDPROC

PROCEDURE acionar(o as Long,c as Long, a as String @) as Integer
DECLARE INTEGER k3lSendCommand IN "K3LE1600" as Comandar STRING @
buffer=SPACE(50)
Comandar(@buffer)
RETURN 0
ENDPROC

PROCEDURE init
SET DEFAULT TO "c:\avisual\teleway"
SET DATE TO ANSI
ENDPROC
-----------------------------------------------------------------
Generalhandling message on log-on Pin
Anonymous4-Aug-04 1:10
Anonymous4-Aug-04 1:10 
GeneralRe: handling message on log-on Pin
David Crow4-Aug-04 3:04
David Crow4-Aug-04 3:04 
GeneralRe: handling message on log-on Pin
bikram singh5-Aug-04 7:27
bikram singh5-Aug-04 7:27 
GeneralDoc/View based app without menu bar Pin
Suresh Chandra M4-Aug-04 0:34
Suresh Chandra M4-Aug-04 0:34 
GeneralRe: Doc/View based app without menu bar Pin
Michael P Butler4-Aug-04 0:48
Michael P Butler4-Aug-04 0:48 
GeneralRe: Doc/View based app without menu bar Pin
Suresh Chandra M4-Aug-04 0:52
Suresh Chandra M4-Aug-04 0:52 
QuestionTansfer a string formula from Excel to C++ ?? Pin
GAR.J4-Aug-04 0:23
GAR.J4-Aug-04 0:23 
AnswerRe: Tansfer a string formula from Excel to C++ ?? Pin
palbano4-Aug-04 5:11
palbano4-Aug-04 5:11 
GeneralNo Question, Solution Pin
V.3-Aug-04 23:42
professionalV.3-Aug-04 23:42 
GeneralWindows Socket problem Pin
bouli3-Aug-04 23:19
bouli3-Aug-04 23:19 
GeneralRe: Windows Socket problem Pin
Antony M Kancidrowski4-Aug-04 1:02
Antony M Kancidrowski4-Aug-04 1:02 
GeneralRe: Windows Socket problem Pin
bouli4-Aug-04 2:01
bouli4-Aug-04 2:01 
GeneralRe: Windows Socket problem Pin
Antony M Kancidrowski4-Aug-04 2:39
Antony M Kancidrowski4-Aug-04 2:39 
GeneralRe: Windows Socket problem Pin
Anthony_Yio4-Aug-04 1:32
Anthony_Yio4-Aug-04 1:32 
GeneralRe: Windows Socket problem Pin
bouli4-Aug-04 1:56
bouli4-Aug-04 1:56 
GeneralRe: Windows Socket problem Pin
Anthony_Yio4-Aug-04 19:48
Anthony_Yio4-Aug-04 19:48 
GeneralRe: Windows Socket problem Pin
bouli4-Aug-04 22:24
bouli4-Aug-04 22:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.