• Announcements

    • Reminder - MoDaCo position on illegal content   07/30/15

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such softwareNintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)CUSTOM ROMS You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)ROMs must give full credit to the original authorISSUES If you have any issues with this policy, please contact PaulOBrien directly via PM.
    • Reminder: Selling items on the forum directly is not allowed   07/30/15

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspension / ban.
Sign in to follow this  
Followers 0

Delphi and RAPI (RAPI.pas fixed and included)

4 posts in this topic

Posted

Not sure where to put this so please move to a more appropriate section if needed :)

I recently wanted to use Delphi to create some software which interacts with my Smartphone (E100), looking around the internet led me to RAPI.pas but this had no instructions and two critical errors.

I've found and fixed the errors and made headway into communicating with my smartphone through Delphi applications.

(Fixed Delphi.pas attached in zip file)

There is little to no information to using RAPI and Delphi on the internet (that I could find after two days of searching) so I'm posting this here for others to benefit from :lol:

Simply add RAPI.pas to your Uses like this example:

uses

 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

 Dialogs, StdCtrls, ComCtrls,  RAPI;

You will initially need to connect to your device, using CeRapiInit is not recommended as your program can hang if no device is connected.

Instead use CeRapiInitEx, I use the following code (placed on a button press here) which I converted from a C++ example:

procedure TForm1.Button1Click(Sender: TObject);


var


ri : TRapiInit;


hRes : HRESULT;


dwRet : DWORD;




begin


ri.cbSize :=  sizeof(ri);


hRes := CeRapiInitEx(ri);


dwRet := WaitForSingleObject(ri.heRapiInit, 5000);




if ((dwRet <> WAIT_OBJECT_0) OR (SUCCEEDED(ri.hrRapiInit) = FALSE))then begin


  // Could not initialize Rapi


  CeRapiUninit;


end


 // else you are connected!




end;

and of course once you have finished what you need to do call CeRapiUninit to close the connection.

I'll add more if anyone will find it usefull but the above (with the fixed RAPI.pas) is enough to get you started :lol:

RAPI.zip

0

Share this post


Link to post
Share on other sites

Posted

我也想用deiphi开发smartphone2003,真得能行吗?请指教一下我该怎么做。

0

Share this post


Link to post
Share on other sites

Posted

请辨解我的消息, 我翻译了它与Babelfish 。 特尔斐可能只被使用开发可能与Smartphone 相处融洽的个人计算机应用, 如果您希望开发实际Smartphone 软件您将需要使用嵌入视觉C++ 或嵌入Visual.basic 。 如果您想要开发个人计算机应用我能possably 协助您由提供代码样品:)

and in English...

Please excuse my message, I have translated it with Babelfish.

Delphi can only be used to develop PC applications that can interact with the Smartphone, if you wish to develop actual Smartphone software you will need to use eMbedded Visual C++ or eMbedded Visual Basic.

If you want to develop a PC application I can possably assist you by providing code samples :lol:

0

Share this post


Link to post
Share on other sites

Posted

can it work with Windows 7?

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.