[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

File pointer

Posted on 1998-02-18
3
Medium Priority
?
194 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 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 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

872 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