.NET Components for Mobility

How to use in C++ .Net?

Last post 07-14-2007 6:15 AM by Marshall. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-11-2007 11:44 AM

    How to use in C++ .Net?

    I did post this question in the XP Specific Forum but I have Vista and that forum seems to be quite a dead forum, too. If not, sorry for that.

     

    However, I can't make it work in Visual C++ .Net.

    I write the following lines:

    using namespace InTheHand::Net;
    using namespace InTheHand::Net::Sockets;
    using namespace InTheHand::Net::Bluetooth;

     

    I get error C2653: 'InTheHand' is not a class name or a namespace.

     

    Do I have to include some header file? Or do I miss something I can't figure out?

     

    I hope anyone can help me.

    Thank you in advance

     

    Filed under: , , ,
  • 07-11-2007 1:16 PM In reply to

    Re: How to use in C++ .Net?

    Yup, most people seem to use this forum.

    The compiler command-line argument needed to reference the 32feet assembly, appears to be:

    /FU "D:\Program Files\In The Hand Ltd\32feet.NET v2.1\Assemblies\XP2\InTheHand.Net.Personal.dll"

    In .NET the types and their members (methods, properties etc) defined in an assembly are defined in its metadata, thus (woopee) no header files required.  I created a little C++/CLR test app http://32feet.net/forums/post/2472.aspx , it was created and built in VS2005, and apparently uses the command-line (yikes) below.  Might be an idea to create a project in VS which will give other nice things like Intellisense etc.

    /Od /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\playCppClr.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Zi /clr /TP /errorReport:prompt /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll" /FU "d:\program files\in the hand ltd\32feet.net\assemblies\xp2\inthehand.net.personal.dll"

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 07-11-2007 1:38 PM In reply to

    Re: How to use in C++ .Net?

    alanjmcf:

    The compiler command-line argument needed to reference the 32feet assembly, appears to be:

    /FU "D:\Program Files\In The Hand Ltd\32feet.NET v2.1\Assemblies\XP2\InTheHand.Net.Personal.dll"

     

     

    Thank you for the quick response.

    Can you tell me how to add that argument in my Visual C++?

     

    Thank you so much

    Marshall
     

     

    EDIT: I found the solution: Project->Properties->Configuration Properties->C/C++->Command Line

     

    Thank you again

     Marshall
     

  • 07-11-2007 5:39 PM In reply to

    Re: How to use in C++ .Net?

    In VS2005 for /clr projects one can do "Add Reference" rather than manually editing the command-line.  On the Project menu (on main menu bar, or right-click on the project in Solution Explorer) see option "References", then do <Add New Reference>, and (given an 32feet.NET installation) on the ".NET" tab see "InTheHand.Net...." (or manually Browse for it if installer not run).

    Glad to help.

    I've been working on a user's guide, I'll add a few words about C++/CLR to it.

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 07-14-2007 6:15 AM In reply to

    Re: How to use in C++ .Net?

    Thank you very much!!! Smile

    The method I used introduced me an exception saying that he couldn't find InTheHand.Personal. But adding the reference as you suggested did the trick.

     

    Thank you so much!

     

    Marshall
     

Page 1 of 1 (5 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.