|
Pardon sir, I've found it: CP itz thiz!!!! plz send me code plz plz!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
That's simple.
//CListenSocket头文件
class CListenSocket : public CSocket
{
public:
CListenSocket(HWND hWnd=NULL);
HWND m_hWnd; //事件处理窗口
virtual void OnAccept(int nErrorCode);
};
//CListenSocket实现文件
#include "ListenSocket.h"
CListenSocket::CListenSocket(HWND hWnd){m_hWnd=hWnd;}
void CListenSocket::OnAccept(int nErrorCode)
{
SendMessage(m_hWnd,WM_SOCKET_MSG,SOCKET_CLNT_ACCEPT,0);
CSocket::OnAccept(nErrorCode);
}
...
m_pListenSocket=new CListenSocket(m_hWnd);
m_pListenSocket->Create(...);
m_pListenSocket->Listen();
...
LRESULT CXxxDlg::OnSocketMsg(WPARAM wParam, LPARAM lParam)
{
UINT type=(UINT)wParam;
switch(type)
{
case SOCKET_CLNT_ACCEPT:
{
CSocket* pSocket=new CSocket;
if(!m_pListenSocket->Accept(*pSocket))
{
delete pSocket;
break;
}
...
}
...
}
}
|
|
|
|
|
You could write:
头文件=Header file
事件处理窗口=Window event handler
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Note how it will be Chinese?
|
|
|
|
|
|
|
Are you sure I need to it?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
See here and here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I have a piece of hardware (cash dispenser) that I'm trying to control with a PC. It comes with a Dll, but for the life of me I can't figure out how to use the dll. can someone please help me get started on this? It does have a manual with the dll describing the functions, but it is almost unintelligible.
Here is some of the supplied literature, if it helps to answer the question
2.1.1 EVENT
During ezLink protocol is handling, ezLink.dll notice protocol status to application program to create WM_USER_EZCDM_RECEIVE event as below
WPARAM CODE COMMENT
EVENT_RECV_RESPONSE 00001000H RESPONSE receiving
EVENT_SEND_RETRYOVER 00001001H COMMAND sending failure
EVENT_RECV_RETRYOVER 00001002H RESPONSE receiving failure
WM_USER_EZCDM_RECEIVE event is defined as follows.
#define WM_USER_EZCDM_RECEIVE (WM_USER+301)
If EVENT_RECV_RESPONSE is generated, AP must receive Response to call the ezLinkRcv() function.
2.1.2 Recording Log Data
ezLink.dll record LOG as below format. Recorded LOG FILE location is directory folder to be transmitted ezLinkPath(). LOG is recorded whenever DLL function is called.
FILE NAME: (Generating File date (year month date) + ezCDM.txt) ex) 20060206ezCDM.txt
FILE Generating Folder: selected folder path in the ezLinkPath() parameter.
2.2 DLL FUNCTION
2.2.1 ezLinkOpen
ezLinkOpen Loads the DLL and opens the communication port.
Syntax EZLINK_DLL_API UINT ezLinkOpen(SETINFO *pSetInfo);
Parameters
pSetInfo Structure with information to communicate with dll
typedef struct
{
unsigned char uiPort; //communication port
unsigned char ucDataBits; //Data bit
unsigned char ucParity; //Parity bit
unsigned char ucStopBits; //Stop bit
unsigned long dwBaudRate; //Baud Rate
HWND hwnd; //Parent window handle
unsigned char ucCommandType; //command type(1: ezCDM-1000 )
}SETINFO
Return Values
EZLINK_SUCCESS Open port success
Remarks
If DLL opens ezCDM Communication-port successfully, returns the EZLINK_SUCCESS.
2.2.2 ezLinkClose
ezLinkClose Closes the Communication Port.
Syntax EZLINK_DLL_API UINT ezLinkClose(void);
Parameters
None
Return Values
EZLINK_SUCCESS Close port success
Remarks
If DLL closes ezCDM communication-port successfully, returns EZLINK_SUCCESS.
|
|
|
|
|
It looks like you should
- call the
ezLinkOpen function passing the serial port details. - process the
WM_USER_EZCDM_RECEIVE window message to get device notifications (and possibly call ezLinkRcv function: documentation is a bit messy on this point...) - possibly use some other functions you have not reported here.
- call
ezLinkClose function when you no longer need the device (and the library).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Does your third party vendor has any forums or support personal. they may be able to guide you in right direction!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
seems fairly simple - in addition to what esteemed CPallini said
1) look for a .h file supplied by the vendor, #include it in your code - you could probably start with a MFC dialog project to get the ease of message maps etc - then you can define a Onxyz handler for the WM_USER_EZCDM_RECEIVE message ...
2) if the vendor has a '.lib' file with their SDK, you'll need to add it to additional libraries settings under link options
usually vendors provide some sort of sample - as ThatsAlok says, maybe their support site has info - if they can give you one its a good start
|
|
|
|
|
thanks for the help guys. I think my first step is going to be finding a .h I think after that and all your advice I can get it done.
augie
|
|
|
|
|
Hi,
Please suggest me any link for c++ samples which will be really helpful in my professional job..topic wise samples would be more helpful to me....
|
|
|
|
|
Best sample is your exercise you need to spend time to work with c++ but you forgot you are on the Codeproject very good place for examples in c++/C#/ASP.net,...
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hamid. wrote: ASP.net,...
humm C++ programemer coding website he hehe!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Or maybe F#
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
|
Errr.... Codeproject maybe ?
|
|
|
|
|
Please UUURGENT
Could You Give Link to that Code project SITE
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
|
He was sarcastic, in case you didn't realize
|
|
|
|
|
You're wrong it was THHB (for more info ask of CPallini ).
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
mihK wrote: http://www.codeproject.com[^]
@
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
BadKarma wrote: Could You Give Link to that Code project SITE
I don't know..!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|