 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Chris Gutierrez Guest
|
Posted: Thu Aug 05, 2004 5:07 pm Post subject: Porting Delphi HID Component to C++Builder 5 - made progress |
|
|
Hi all,
I've been struggling for the last couple of days with the problem of porting Robert Marquardt's HID controller component (http://www.soft-gems.net/Controls.php) to C++Builder 5.0. As an aside, I tried to post in the group yesterday, but I foolishly posted from Google groups, which doesn't reach this newsgroup. Anyhow, I've mostly resolved my problem and am posting here to get feedback and to share what I've learned with someone else that might have this problem. I'm new to converting components between Delphi and C++ Builder... this was my first time thru.
I'm using the HID component developed by Robert Marquardt. The component comes with a Delphi package and a C++ Builder package. I was able to use the component with Delphi 6, it's fantastic and does everything I need. I then needed to use the component with C++ Builder 5. Unfortunately, the package for C++ Builder is for version 6, and won't work with version 5. Following the directions I've read in this newsgroup and others, I created a new package and added the .Pas files. The component installed without error. However, when I add the component to a new application, I couldn't build. I got errors in SetupApi.hpp, the most common of which was 'PByte' is not a member of 'System'. I tried about 10 times to remove and reinstall this package using a variety of techniques I've found via google. So far, nothing worked. I finally resolved these difficulties by making sure the header files were in the Tools->Environment Options -> Library path. It seems obvious now, but at the time I was stumped.
After I resolved these errors, I was still stuck. I had errors in SetupApi.hpp, on the line:
typedef SP_POWERMESSAGEWAKE_PARAMS_A *PSPPowerMessageWakeParamsA;
The error message is "E2257 , Expected". When I grepped for PSPPowerMessageWakeParamsA, I found it in SetupApi.pas... so I concluded that I was missing something that makes the hpp be built correctly. I commented out these 6 lines in the hpp file, and was able to build and compile my test application. Success!!! I was very happy.
So today I came into the office, and the damn component had come off the toolbar. After a bit more research, I learned that this means my component hadn't installed correctly. I cleaned up, uninstalled everything, and started over. This time, I opened the SetupApi.pas source, commented out the six lines that looked like SP_POWERMESSAGEWAKE_PARAMS_A, and built the component. It installed fine in Delphi. I then repeated the above described process, and the component installed fine in C++ Builder 5.
So here is my question... does my solution sound reasonable or am I asking for trouble? In my testing so far, I think I'm okay... but as I am new to building components in general and porting them from Delphi to C++ Builder in specific, I have my doubts.
---------------------
Just for completeness, here are a variety of things I tried which sounded good but didn't do anything at all. Hopefully I can save someone else some of the hassle I went thru:
1) Put {$ObjExportAll On} at the top of the file. So far as I can tell, this doesn't do anything at all to help in later versions of C++ Builder.
2) Adding various units to the requires portion of the package. Popular suggestions were vcl* and the like. Sounds great, totally ineffective.
3) Adding switches like <PFLAGS value...> to the source. I couldn't figure out where to add this, but the -LUDesignIde flag sounds like it's been depricated anyhow.
4) Copy header and .obj and .bpl files to random directories in the Borland tree. Totally unnecessary so long as your environment paths are set correctly.
-------------
Thanks very much in advance,
Chris Gutierrez
email: gcgutier (at) hotmail (dot) com
http://www.chrisgutierrez.org
|
|
| Back to top |
|
 |
OBones Guest
|
Posted: Thu Aug 05, 2004 6:28 pm Post subject: Re: Porting Delphi HID Component to C++Builder 5 - made prog |
|
|
This component is available in the JVCL 3 as Robert Marquardt is a
developer in this library. The JVCL 3 compiles under C++ Builder 5.
To get the JVCL 3, you will need the latest versions of both the JCL and
the JVCL. Please get them from here:
http://jvcl.sf.net/daily/
http://jcl.sf.net/daily/
Read the readme.htm files, the installation should be really
straightforward.
Should you require any help, please ask your question on the JVCL
newsgroup here:
news://forums.talkto.net/jedi.vcl
Cheers
Olivier Sannier
JVCL Developer
|
|
| Back to top |
|
 |
Chris Gutierrez Guest
|
Posted: Thu Aug 05, 2004 8:56 pm Post subject: Re: Porting Delphi HID Component to C++Builder 5 - made prog |
|
|
OBones <obones_ssspp (AT) fsdqfs_altern (DOT) org> wrote:
| Quote: | This component is available in the JVCL 3 as Robert Marquardt is a
developer in this library. The JVCL 3 compiles under C++ Builder 5.
|
Is JVCL 3 stable? I actually downloaded and installed the last stable version 2.10. The readme said it supported Delphi 5-7. Is JVCL 3.0 stable enough to go into production software? I usually try to avoid beta components for production code. I'd much rather use something you've debugged than something I hacked until it worked.
Thanks,
Chris Gutierrez
email: gcgutier (at) hotmail (dot) com
http://www.chrisgutierrez.org
|
|
| Back to top |
|
 |
Chris Gutierrez Guest
|
Posted: Thu Aug 05, 2004 9:26 pm Post subject: Re: Porting Delphi HID Component to C++Builder 5 - made prog |
|
|
I've also subscribed to this newsgroup. If I get stuck again, I'll post my
questions there. Thanks for letting me know where the active developers are reading.
Cheers,
Chris Gutierrez
email: gcgutier (at) hotmail (dot) com
http://www.chrisgutierrez.org
|
|
| Back to top |
|
 |
OBones Guest
|
Posted: Fri Aug 06, 2004 4:43 am Post subject: Re: Porting Delphi HID Component to C++Builder 5 - made prog |
|
|
Chris Gutierrez wrote:
| Quote: | OBones <obones_ssspp (AT) fsdqfs_altern (DOT) org> wrote:
This component is available in the JVCL 3 as Robert Marquardt is a
developer in this library. The JVCL 3 compiles under C++ Builder 5.
Is JVCL 3 stable? I actually downloaded and installed the last stable version 2.10. The readme said it supported Delphi 5-7. Is JVCL 3.0 stable enough to go into production software? I usually try to avoid beta components for production code. I'd much rather use something you've debugged than something I hacked until it worked.
|
JVCL3 is way more stable than the JVCL 2.10 even if it is marked beta.
It is marked as such mostly because of the lack of help file (the source
is here, though). And contrary to the 2.10, v3 has actually been tested
for compliance with BCB5 and BCB6. As such, it is not something that has
not been debugged and that you would have to hack into.
But I understand your concerns about "beta" software, just let me say
that in this case, the "beta" doesn't mean "unifinished and untested".
Cheers
Olivier Sannier
JVCL Developer
|
|
| Back to top |
|
 |
Chris Gutierrez Guest
|
Posted: Fri Aug 06, 2004 4:09 pm Post subject: Re: Porting Delphi HID Component to C++Builder 5 - made prog |
|
|
OBones <obones_ssspp (AT) fsdqfs_altern (DOT) org> wrote:
| Quote: | JVCL3 is way more stable than the JVCL 2.10 even if it is marked beta.
It is marked as such mostly because of the lack of help file (the source
is here, though). And contrary to the 2.10, v3 has actually been tested
for compliance with BCB5 and BCB6. As such, it is not something that has
not been debugged and that you would have to hack into.
Cheers
Olivier Sannier
JVCL Developer
|
Olivier,
Thanks SO MUCH for your help... I really, really appreciate it.
I will use JVCL 3.
Cheers,
Chris Gutierrez
email: gcgutier (at) hotmail (dot) com
http://www.chrisgutierrez.org
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|