Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Question concerning typecast

Question concerning typecast

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structureshelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hanno25
    wrote on last edited by
    #1

    Hi! I found the following explanation to a subroutine. The subroutine gets 2 values, the second one is optionally set to zero or to an result. When it is set to zero, I have to write : Export((_bstr_t)name, (VARIANT *)NULL); But what kind of typecast do I have to do, if I will use as a first and second parameter a _bstr_t or CString-Type in the RESULT-array? I tried some things, but nothing worked. Explanation from help file: Sub Export( ByVal PathOrFilename As String,Optional ByRef Result As Variant ) Result is an array containing four string items, 1st is the complete filename or empty 2nd item is the complete navigation filename or empty 3rd item is the complete meteo filename or empty 4th item is the complete tilt filename or empty. Thanks a lot, Hanno -- modified at 4:23 Tuesday 28th March, 2006

    C 1 Reply Last reply
    0
    • H hanno25

      Hi! I found the following explanation to a subroutine. The subroutine gets 2 values, the second one is optionally set to zero or to an result. When it is set to zero, I have to write : Export((_bstr_t)name, (VARIANT *)NULL); But what kind of typecast do I have to do, if I will use as a first and second parameter a _bstr_t or CString-Type in the RESULT-array? I tried some things, but nothing worked. Explanation from help file: Sub Export( ByVal PathOrFilename As String,Optional ByRef Result As Variant ) Result is an array containing four string items, 1st is the complete filename or empty 2nd item is the complete navigation filename or empty 3rd item is the complete meteo filename or empty 4th item is the complete tilt filename or empty. Thanks a lot, Hanno -- modified at 4:23 Tuesday 28th March, 2006

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      hanno25 wrote:

      Sub Export( ByVal PathOrFilename As String,Optional ByRef Result As Variant )

      This is VB so I don't really see what you are trying to do. You know that you are on a C++ forum ?

      H 1 Reply Last reply
      0
      • C Cedric Moonen

        hanno25 wrote:

        Sub Export( ByVal PathOrFilename As String,Optional ByRef Result As Variant )

        This is VB so I don't really see what you are trying to do. You know that you are on a C++ forum ?

        H Offline
        H Offline
        hanno25
        wrote on last edited by
        #3

        Yes, I know that. The help-file only gives informations in VB. I have to use the supplied COM-interfaces in C++. Below, there is the information from the precompiled header file: inline HRESULT xxx::ICoClass::Export ( _bstr_t PathOrFilename, VARIANT * Result ) { HRESULT _hr = raw_Export(PathOrFilename, Result); if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); return _hr; } But that doesn't gives informations, that the result-Parameter has to be handled as a array, that's why I copied the VB-code in the first text. Hanno

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups