Solved

File pointer

Posted on 1998-02-18
3
190 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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

730 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