Question concerning typecast
-
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
-
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
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 ?
-
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 ?
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