Solved

File pointer

Posted on 1998-02-18
3
187 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
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
stefanr earned 50 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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 video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

813 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now