DvdKite

Hi To all!

I've found this useful forum now!

I've got a Compact Flash RIFD Reader for a PPC2003 device and I have to use it to read on an RFID tag.

I have to administrate the use of that CF Reader from a JSP page. My purpose is to made a check between a value in the .jsp page and a value placed in the tag, and then I've have to be sure that they're equal before leave the user to continue browsing the site.

I've a dll sdk for the Compact Flash written in C++. Many friends has told me that the only way to use the recognize system ( descripted before) is to create an ActiveX control and install it on the pocket pc... it should allow the jsp page to access to the compact flash of the device and made Read/write operations.

Do you know where I can find help for this

I'm new in this so Is there any tutorial

any help is appreciated for this!

Can you please answer to me at 180000_NOSPAM_@tin.it (by removing _nospam_)

Thanks,

David



Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

Ilya Tumanov

Moving to C++ forum as it only can be done in C++.






Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

Christopher Fairbairn

Hi David,

Within Visual Studio 2005 create a new project and select the "MFC Smart Device ActiveX Control" project type found within the Visual C++ part of the dialog.

This will allow you to create an ActiveX control for the PDA. You will then need to use the provided DLL to interface to the RFID Reader within this project and expose some methods and properties which can be accessed from your javascript hosted within your JSP.

There is an added complication. Pocket Internet Explorer will only allow you to script against controls which are explictly deemed "safe for scripting" as outlined here http://support.microsoft.com/kb/293106.

I don't have access to the older SDK documentation at present, but you can find details on how to find instructions on what you have to do here http://support.microsoft.com/kb/322732/en-us (look at the section labled "Pocket Internet Explorer Requires That the IObjectSafety Interface Is Implemented in ActiveX Objects"). Essentially your object should implement the IObjectSafety interface.

You may find the following bunch of articles helpful - http://www.pocketpcdn.com/sections/com.html

Thanks,

Christopher Fairbairn






Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

DvdKite

Many Many thanks for your help !

I'm downloading now the Visual Studio 2005 :-) (my friend has doing a thesis with it and I'll ask to him some help to try your suggestions)....

I've seen your second link and read it all... but I can't find this articles searching in the sdk online documentations:

"

Workaround or Resolution

In both cases, IObjectSafety must be implemented to either avoid the error message or to allow the ActiveX object to be loaded. For more information, see the following topics in the Pocket PC 2002 Software Development Kit (SDK) documentation:

? Pocket PC 2002 SDK
? Writing Applications for Pocket PC 2002
? Technical Articles
? Creating ActiveX Controls for Pocket Internet Explorer
? Declaring Your Control as "Safe for Scripting"

"

Do you also know some place where I can find a step by step example for creating a dll with some methods that I can call from the Jscript of my jsp page

Thanks again,

Dvdkite





Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

DvdKite

Hi,

It's me again! :-)


I've tried to create from VS2005 the new project by selecting "MFC Smart Device ActiveX Control" but it doesn't work.... VS said that It can't create the new project....
Any ideas

Is there any additional library that I have to install

thanks!!! :-)

David :-)




Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

Christopher Fairbairn

Hi,

Can you create a project using any of the other C or C++ Smart Device project types

If you havn't already you may like to install service pack 1 for Visual Studio 2005, there was an issue with the way the wizards were implemented (using HTML) and certain versions of Internet Explorer. This typically meant you could complete all the wizard steps, but just got a beep and then nothing when you clicked the last button.

You may like to see the following thread for some further details about this problem - http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1625686&SiteID=1

Hope it helps,

Christopher Fairbairn






Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

DvdKite

Hi Christopher,

It's me again,

I'm serching/working on this only one time/week :-)

Finally I've installed the full version of Visual Studio 2005 and Now I can see the option

create new project >visual c++>MFC Smart Device ActiveX Control.

Now I need some help on how to proceed in this (I'm really newbie):

I've got a COMPACT FLASH reader for RFID tags.

With It I've received a a folder "Reader dll v3.3.0" and iside it I can find those folders:

  • CFReaderDLL
  • CFReaderDLL Static
  • CSharp CFWrapper
  • ReaderDLL
  • ReaderDLL Static
  • Samples (it include a useful demo with .cpp, .h,.lib files)

I suppose I have to use one of the CFreaderdll ..CF= compactFlash....

But What is the difference between the static and the non static dll

I also suppose that the first CFReader DLL is the one I have to use and it contains

3 file:

  • CFReader.dll
  • CFReader.lib
  • CFReaderDLL.h

I think that the dll contain some funcions/methods described in the .h file.

So now... Do I have to import one of that file in my new MFC Smart Device... project

How can I proceed now in order to create the activix control

I've seen that in the demo dll is there some example code in .cpp file...

Can you simply tell me bystep what can I try to do before of all :-)

Really thanks again,

David :-)





Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

Christopher Fairbairn

Hi,

Assumming CFReader.dll is the correct dll for you to be using (perhaps there is documentation for the vendor's API which will tell you which dll you should be using) you probably can use it within your C++ application as follows:

  • Within the source code for your application (a *.cpp file), #include the header file (CFReaderDll.h)
  • Within the project properties (right click on your project within Solution Explorer and select Properties) navigate down the tree on the left hand side and select "Input" underneath the Linker subtree. Then append the name of the lib file (CFReader.lib) into the "Additional Dependencies" textbox. Within the "General" section of the Linker settings you may also need to specify the directory where this file can belocated in the "Additional Library Directories" property.
  • When you deploy your application make sure that CFReader.dll is either located within the application directory or the \Windows directory.

With these steps completed you should be able to use the functions documented by the vendor.

There may be further requirements for this particular dll/header file. You would be best to seek documentation/guidance from the vendor in this regard, or have a look at their sample application.

Hope this helps,

Christopher Fairbairn






Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

DvdKite

Hi Chrsropher,

As always thanks.

I've done all your suggestion and now I hope to be able to use the function of the reader library, now I have to test it!

I've browsed the material provided from the vendor and I've found a dll demo

(just to explane you what I'm talking about , this is the link of the reader.dll package and include all the files mentioned, it's a free download and it's 700k http://acg-id.aaitg.com/fileadmin/acg_id/products/readers/Zip/ReaderDLL_v3.3.0.zip )

In dll demo folder I've opened the DLLDemo.cpp and I suppose it is the main application that I have to paste,in order to test it, in my APPLICATION.cpp project. It is correct

the main contains many functions that is defined in other .cpp files , Can I import that cpp files Or it's too easy, for the test, copy the function at the end of the main in APPLICATION.cpp

Once I've imported the c++ code, I'll deploy the applications to the device (I use "Build" menu and then "deploy solution"). At that point I'll have the folder of my activeXcomponent in program file of the ppc2003emulator. Obliviously that file cannot be opened by clicking on so I must (I suppose this) call it from an html page, it is correct

If yes , how can I do it

Is there any special command (for example, in the html code: " <OBJECT ID="APPLICATION" CLASSID="..... >...I've found this in another msdn article)...

Thanks in advace again,

David





Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

DvdKite

:-) any suggestion :-)

Thanks





Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

pol_WWY

Can't create new project

- Install service pack to VS2005





Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

DvdKite

Hi Pol,

Yes Now I'm able to create a new project and also to select the MFC Smart device activeX control...

Now I need only some suggestion on how integrate the function of the READER.dll (link is in my past answers)

I'm a new in C++ and I simply need to create an active X that read a number from the tag and return that number.

then I have to call the activex from the jsp pages and take the number returned....

It seems easy but every suggestion is appreciated!

Thanks,

David





Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

DvdKite

Hi To all :-)

It's me again :-)

I've now done all of the step suggested by Christofer:

Christopher Fairbairn wrote:

Hi,

Assumming CFReader.dll is the correct dll for you to be using (perhaps there is documentation for the vendor's API which will tell you which dll you should be using) you probably can use it within your C++ application as follows:

  • Within the source code for your application (a *.cpp file), #include the header file (CFReaderDll.h)
  • Within the project properties (right click on your project within Solution Explorer and select Properties) navigate down the tree on the left hand side and select "Input" underneath the Linker subtree. Then append the name of the lib file (CFReader.lib) into the "Additional Dependencies" textbox. Within the "General" section of the Linker settings you may also need to specify the directory where this file can belocated in the "Additional Library Directories" property.
  • When you deploy your application make sure that CFReader.dll is either located within the application directory or the \Windows directory.

With these steps completed you should be able to use the functions documented by the vendor.

There may be further requirements for this particular dll/header file. You would be best to seek documentation/guidance from the vendor in this regard, or have a look at their sample application.

Hope this helps,

Christopher Fairbairn

Then I've used the vendor demo like said in my last post:

DvdKite wrote:

...

I've browsed the material provided from the vendor and I've found a dll demo

(just to explane you what I'm talking about , this is the link of the reader.dll package and include all the files mentioned, it's a free download and it's 700k http://acg-id.aaitg.com/fileadmin/acg_id/products/readers/Zip/ReaderDLL_v3.3.0.zip )

...

Then I've supposed to be able to access to the method provided in the redelDLL so I've wrote my activeX using the dlldemo provided at that link. I've included all the .cpp files and .h file of the demo. I've made a simple read of a block using all steps included in the flow diagram of the vendor manual and in that demo cpp application. I've used all the function specific for windows CE devices instead of the windows pc provided, I've done it with the manual).

But the problem is: When I try to build the application, VS studio cannot find ALL the method of the dll, none of them

I've tryed to place the complete path to the dll but nothing, I've copied the dll, dll.h and lib in the main folder of my VS project and it find the dll, but not the method included in it! :-O

I've tryied all but nothing....

After this I've thought that maybe I've doing something wrong or choose a wrong dll so I've tryed to open DIRECTLY the visual studio project DEMO provided by the vendor ( DLLDemo.vcproj included in the samples dlldemo,IT MUST WORK)... and, like with my project, it doens't find the method included in the dll ....

So can anyone please help me tryng if the DLLDemo.vcproj can built on your pc

At this link you can download the dll with the demo

http://acg-id.aaitg.com/fileadmin/acg_id/products/readers/Zip/ReaderDLL_v3.3.0.zip

and it's about a few Kb...

I relly don't know what to do.. I must create this activeX or I can't finish this project in time to get my degree :-(

Thanks.

Dvdkite





Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

DvdKite

DvdKite wrote:

Hi To all :-)

It's me again :-)

I've now done all of the step suggested by Christofer:

Christopher Fairbairn wrote:

Hi,

Assumming CFReader.dll is the correct dll for you to be using (perhaps there is documentation for the vendor's API which will tell you which dll you should be using) you probably can use it within your C++ application as follows:

  • Within the source code for your application (a *.cpp file), #include the header file (CFReaderDll.h)
  • Within the project properties (right click on your project within Solution Explorer and select Properties) navigate down the tree on the left hand side and select "Input" underneath the Linker subtree. Then append the name of the lib file (CFReader.lib) into the "Additional Dependencies" textbox. Within the "General" section of the Linker settings you may also need to specify the directory where this file can belocated in the "Additional Library Directories" property.
  • When you deploy your application make sure that CFReader.dll is either located within the application directory or the \Windows directory.

With these steps completed you should be able to use the functions documented by the vendor.

There may be further requirements for this particular dll/header file. You would be best to seek documentation/guidance from the vendor in this regard, or have a look at their sample application.

Hope this helps,

Christopher Fairbairn

Then I've used the vendor demo like said in my last post:

DvdKite wrote:

...

I've browsed the material provided from the vendor and I've found a dll demo

(just to explane you what I'm talking about , this is the link of the reader.dll package and include all the files mentioned, it's a free download and it's 700k http://acg-id.aaitg.com/fileadmin/acg_id/products/readers/Zip/ReaderDLL_v3.3.0.zip )

...

Then I've supposed to be able to access to the method provided in the redelDLL so I've wrote my activeX using the dlldemo provided at that link. I've included all the .cpp files and .h file of the demo. I've made a simple read of a block using all steps included in the flow diagram of the vendor manual and in that demo cpp application. I've used all the function specific for windows CE devices instead of the windows pc provided, I've done it with the manual).

But the problem is: When I try to build the application, VS studio cannot find ALL the method of the dll, none of them

I've tryed to place the complete path to the dll but nothing, I've copied the dll, dll.h and lib in the main folder of my VS project and it find the dll, but not the method included in it! :-O

I've tryied all but nothing....

After this I've thought that maybe I've doing something wrong or choose a wrong dll so I've tryed to open DIRECTLY the visual studio project DEMO provided by the vendor ( DLLDemo.vcproj included in the samples dlldemo,IT MUST WORK)... and, like with my project, it doens't find the method included in the dll ....

So can anyone please help me tryng if the DLLDemo.vcproj can built on your pc

At this link you can download the dll with the demo

http://acg-id.aaitg.com/fileadmin/acg_id/products/readers/Zip/ReaderDLL_v3.3.0.zip

and it's about a few Kb...

I relly don't know what to do.. I must create this activeX or I can't finish this project in time to get my degree :-(

Thanks.

Dvdkite

Anyone can help me with this please

I was only able to run this project (with some changes) in Visual studio 2003... but trying to convert the 2003 project to 2005 can't find how to make it work!!! ti give me many errors! :-( :-(

It seems that it can't find the method included in the dll but it is all in the project directory!!!!

PLease help!

Thanks,

Dvdkite





Re: Smart Devices Native C++ Development How to create an ACTIVEX control for ppc2003 to command an RFID Reader

DvdKite

Hi Christopher,

I'm getting mad trying to build this ActiveX.

Can you please tell me where I have to pu the main

When I create a new project the system automatically create the NAME_APPLICATION.ccp file

Code Snippet

// DLL_v1.cpp : Implementation of CDLL_v1App and DLL registration.

#include "stdafx.h"

#include "DLL_v1.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#endif

CDLL_v1App theApp;

const GUID CDECL BASED_CODE _tlid =

{ 0x254748A6, 0xE2D1, 0x4446, { 0x97, 0x2A, 0x5C, 0xE3, 0xCC, 0x7A, 0xAD, 0x42 } };

const WORD _wVerMajor = 1;

const WORD _wVerMinor = 0;

// CDLL_v1App::InitInstance - DLL initialization

BOOL CDLL_v1App::InitInstance()

{

BOOL bInit = COleControlModule::InitInstance();

if (bInit)

{

// TODO: Add your own module initialization code here.

}

return bInit;

}

// CDLL_v1App::ExitInstance - DLL termination

int CDLL_v1App::ExitInstance()

{

// TODO: Add your own module termination code here.

return COleControlModule::ExitInstance();

}

// DllRegisterServer - Adds entries to the system registry

STDAPI DllRegisterServer(void)

{

AFX_MANAGE_STATE(_afxModuleAddrThis);

if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))

return ResultFromScode(SELFREG_E_TYPELIB);

if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))

return ResultFromScode(SELFREG_E_CLASS);

return NOERROR;

}

// DllUnregisterServer - Removes entries from the system registry

STDAPI DllUnregisterServer(void)

{

AFX_MANAGE_STATE(_afxModuleAddrThis);

if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))

return ResultFromScode(SELFREG_E_TYPELIB);

if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))

return ResultFromScode(SELFREG_E_CLASS);

return NOERROR;

}

So now where I have to put the main HERE

Please help!

Thanks