Solved

File pointer

Posted on 1998-02-18
3
185 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
Comment Utility
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
Comment Utility
Thank You
0
 
LVL 3

Expert Comment

by:stefanr
Comment Utility
Did it succeed or did it fail?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

743 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

15 Experts available now in Live!

Get 1:1 Help Now