From: magix on
Hi,

I'm using VC++.
I need the application to be always waiting for input from magnetic stripe,
capture the string, decode it, and populate into those Edit field
(IDC_EDITx)
I already have the interface ready, but how can i make the magnectic stripe
input (i.e keyboard input) to be invisible, and capture it. ...decoding is
done at the background. The magnetic stripe will in fact populate the string
and will be displayed at the keyboard cursor, after stripe.

So, I want to know how:
- to capture the stripe input in invisible way, and put into a string
buffer.

after that I know how to decode it.

Any help is appreciated. Thanks.

Regards,
Magix




From: Scott McPhillips [MVP] on
"magix" <magix(a)asia.com> wrote in message
news:48307bf0$1_1(a)news.tm.net.my...
> Hi,
>
> I'm using VC++.
> I need the application to be always waiting for input from magnetic
> stripe, capture the string, decode it, and populate into those Edit field
> (IDC_EDITx)
> I already have the interface ready, but how can i make the magnectic
> stripe input (i.e keyboard input) to be invisible, and capture it.
> ...decoding is done at the background. The magnetic stripe will in fact
> populate the string and will be displayed at the keyboard cursor, after
> stripe.
>
> So, I want to know how:
> - to capture the stripe input in invisible way, and put into a string
> buffer.
>
> after that I know how to decode it.


Do you mean that the magnetic stripe comes in to an edit control as keys?

If so, you can make make the "keys" invisible by handling the WM_CHAR
message in a class you derive from CEdit. Your message handler will get the
keys, but if you don't call CEdit::OnChar in that handler the keys will not
go to the control and will not appear,.

To intercept these keys you subclass the edit control. That means you add a
CEdit control member variable to the dialog. Then you derive a class from
CEdit (say, CMyEdit) and change the control member variable to CMyEdit.
Then add the WM_CHAR handler to CMyEdit.

--
Scott McPhillips [VC++ MVP]

From: magix on

"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:%23GAjXISuIHA.748(a)TK2MSFTNGP05.phx.gbl...
>
> "magix" <magix(a)asia.com> wrote in message
> news:48307bf0$1_1(a)news.tm.net.my...
>> Hi,
>>
>> I'm using VC++.
>> I need the application to be always waiting for input from magnetic
>> stripe, capture the string, decode it, and populate into those Edit field
>> (IDC_EDITx)
>> I already have the interface ready, but how can i make the magnectic
>> stripe input (i.e keyboard input) to be invisible, and capture it.
>> ...decoding is done at the background. The magnetic stripe will in fact
>> populate the string and will be displayed at the keyboard cursor, after
>> stripe.
>>
>> So, I want to know how:
>> - to capture the stripe input in invisible way, and put into a string
>> buffer.
>>
>> after that I know how to decode it.
>
>
> Do you mean that the magnetic stripe comes in to an edit control as keys?
>
> If so, you can make make the "keys" invisible by handling the WM_CHAR
> message in a class you derive from CEdit. Your message handler will get
> the keys, but if you don't call CEdit::OnChar in that handler the keys
> will not go to the control and will not appear,.
>
> To intercept these keys you subclass the edit control. That means you add
> a CEdit control member variable to the dialog. Then you derive a class
> from CEdit (say, CMyEdit) and change the control member variable to
> CMyEdit. Then add the WM_CHAR handler to CMyEdit.
>
> --
> Scott McPhillips [VC++ MVP]


Dear Scott,

Many thanks for your hints.
The magnetic stripe will behave like a keyboard cursor. once stripe, the
string containing the information in the card will display out at the
current cursor in any edit box or notepad, etc

I will try with your suggestions. If you have good example, it will be
great.

Thanks.
Regards,
Magix


From: magix on
Dear Scott,

Can you show me with example with some piece of code ?
Appreciate it.

Regards,
Magix

"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:%23GAjXISuIHA.748(a)TK2MSFTNGP05.phx.gbl...
>
> "magix" <magix(a)asia.com> wrote in message
> news:48307bf0$1_1(a)news.tm.net.my...
>> Hi,
>>
>> I'm using VC++.
>> I need the application to be always waiting for input from magnetic
>> stripe, capture the string, decode it, and populate into those Edit field
>> (IDC_EDITx)
>> I already have the interface ready, but how can i make the magnectic
>> stripe input (i.e keyboard input) to be invisible, and capture it.
>> ...decoding is done at the background. The magnetic stripe will in fact
>> populate the string and will be displayed at the keyboard cursor, after
>> stripe.
>>
>> So, I want to know how:
>> - to capture the stripe input in invisible way, and put into a string
>> buffer.
>>
>> after that I know how to decode it.
>
>
> Do you mean that the magnetic stripe comes in to an edit control as keys?
>
> If so, you can make make the "keys" invisible by handling the WM_CHAR
> message in a class you derive from CEdit. Your message handler will get
> the keys, but if you don't call CEdit::OnChar in that handler the keys
> will not go to the control and will not appear,.
>
> To intercept these keys you subclass the edit control. That means you add
> a CEdit control member variable to the dialog. Then you derive a class
> from CEdit (say, CMyEdit) and change the control member variable to
> CMyEdit. Then add the WM_CHAR handler to CMyEdit.
>
> --
> Scott McPhillips [VC++ MVP]


From: Scott McPhillips [MVP] on
"magix" <magix(a)asia.com> wrote in message
news:4831b2b8$1_1(a)news.tm.net.my...
> Dear Scott,
>
> Can you show me with example with some piece of code ?
> Appreciate it.

I emailed you an example project.


--
Scott McPhillips [VC++ MVP]