?
Solved

File pointer

Posted on 1998-02-18
3
Medium Priority
?
192 Views
Last Modified: 2010-04-10
void PlayWav(BSTR* File);
=======================
CFile f; f.Open("C:\\fire.wav", CFile::modeRead);
m_red.PlayWav(f);
================
I think there is a problem in file pointer.
How to correct?       
0
Comment
Question by:logout
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
stefanr earned 100 total points
ID: 1182498
Is this the same question as in the MFC area? In that case it is clear what is wrong. BSTR is a special type of string that is preceded by a length (before the first character in the string). There are special functions to create and destroy such strings. Using MFC, the most easy way is to use a CString, like this:

CString strFileName = _T("C:\\fire.wav");
BSTR bstrFileName = strFileName.AllocSysString();

m_red.PlayWav(&bstrFileName);

::SysFreeString(bstrFileName);

Regards,
Stefan
0
 

Author Comment

by:logout
ID: 1182499
Thank You
0
 
LVL 3

Expert Comment

by:stefanr
ID: 1182500
Did it succeed or did it fail?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question