Results 1 to 2 of 2

Thread: _bstr_t casting, passing param

  1. #1

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258

    _bstr_t casting, passing param

    Can someone please explain to me.... I'm having a ***** of a time... sure it's something totally lame.

    First things first, I can't create a _bstr_t and initialize it:
    Code:
    //throws compiler error
    //id3 error LNK2019: unresolved external symbol "void __stdcall 
    //_com_issue_error(long)" (?_com_issue_error@@YGXJ@Z) referenced in 
    //function "public: __thiscall _bstr_t::_bstr_t(unsigned short const *)" 
    //(??0_bstr_t@@QAE@PBG@Z)
    _bstr_t bstrTest = "c:\\test.mp3";
    next... can't get it work with cout
    Code:
    cout << bstrTest;

    Third, can't seem to pass _bstr_t as a parameter
    Code:
    //proto
    BOOL fileExists(_bstr_t bstrFileName);
    
    //call
    if(id3.fileExists(_bstr_t(L"")))
    	{
    		//cout << "file c:\\test.mp3 exists\n";
    	}
    What am I doing wrong?
    I have the correct h files included I am sure:
    #include <iostream>
    #include <tchar.h>
    #include <comutil.h>
    #include <atlbase.h>
    #include <atlcom.h>

    pleh!
    balls deep in bad code

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: _bstr_t casting, passing param

    You're not linking against the correct lib files. I don't know which you need, though. Look it up in the docs.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width