Announcement

Collapse
No announcement yet.

C type Conversion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • C type Conversion


    Guys:

    How do I convert this to PB:

    Something = _bstr_t("This is a sample string").copy();

    And what type is Something ? - Dword?

    Thx

    Bruce

    ------------------

  • #2
    Hello Bruce,

    try Search on "Converting data types" in PB HELP File.

    bstr = string (dynamic)
    dword = unsigned 32-bit = dword in c++

    mfg Daniel

    ------------------
    www.edvwl.de
    www.flagranto.de

    Comment


    • #3

      Thank you for your reply, but the bstr_t seems to be different from a plain bstr.

      I searched the "Converting data types" before I posted.

      It is used in a structure like this:

      ret.Error=_bstr_t("A big error has occured").copy();

      The ret. structure is pre-defined in another dll to be available to other dll's

      so how do I access this external structure?

      Thx again

      Bruce


      ------------------

      Comment


      • #4
        It is impossible to tell without seeing more sample code at least.

        ------------------
        contact me
        kgpsoftware.com - Free and Commercial Software
        kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

        Comment


        • #5
          _bstr_t is a wrapper class around the BSTR type. The copy() method is effectively calling SysAllocString, an Automation function that allocates a new BSTR and copies the string into it.

          ------------------
          Mike Stefanik
          www.catalyst.com
          Catalyst Development Corporation
          Mike Stefanik
          sockettools.com

          Comment


          • #6
            And what type is Something ?
            It should be declared in the C-source or it's include files...

            ------------------
            Regards,
            Peter
            Regards,
            Peter

            Comment


            • #7
              Bstr is a UNICODE/WIDE OLECHAR type string. For PB it should be the same
              as Something = "this is a string"


              [This message has been edited by Thomas Tierney (edited August 02, 2005).]
              Sr. Software Development Engineer and Sr. Information Security Analyst,
              CEH, Digital Forensic Examiner

              Comment

              Working...
              X