C/C++ Windows API

Moderators: Lundin
Number of threads: 450
Number of posts: 1225

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
MCI sample from Borland Code Center not saves the filename ok Posted by nicolaantonica on 25 Nov 2004 at 6:57 AM
I tested an MCI sample from Borland Code Center and it works ok, but it not saves the filename ok, and I don't understand why.

This is the code (i have changed testing to solve the problem the instruction wsprintf of the sample to strcpy)

char file[96]="";
strcpy(file,"aud.wav");
//
// now stop audio and save to disk
MCIWndStop(m_hMCIWnd);
MCIWndSave(m_hMCIWnd, file);
MCIWndClose(m_hMCIWnd);

It saves the file but with name like ⹤v

Someone knows a solution to this?




Report
Re: MCI sample from Borland Code Center not saves the filename ok Posted by jacace on 22 Jan 2013 at 1:46 PM
Hello Nicola,

You need to use a WCHAR or TCHAR data type:
MCIWndSave(m_hMCIWnd, L"file_path");
I published an article in my blog about Win32 data types for C# devs:
http://jacace.wordpress.com/2013/01/16/entendiendo-los-tipos-de-cadenas-de-la-win32/

Javier Andres Caceres Alvis
Report
Re: MCI sample from Borland Code Center not saves the filename ok Posted by jacace on 22 Jan 2013 at 1:49 PM
Hello Nicola,

You need to use a WCHAR or TCHAR data type:
MCIWndSave(m_hMCIWnd, L"file_path");
I published an article in my blog about Win32 data types for C# devs:
http://jacace.wordpress.com/2013/01/16/entendiendo-los-tipos-de-cadenas-de-la-win32/

Javier Andres Caceres Alvis
Report
Re: MCI sample from Borland Code Center not saves the filename ok Posted by jacace on 22 Jan 2013 at 1:53 PM
Hello Nicola,

You need to use a WCHAR or TCHAR data type:
MCIWndSave(m_hMCIWnd, L"file_path");
I published an article in my blog about Win32 data types for C# devs:
http://jacace.wordpress.com/2013/01/16/entendiendo-los-tipos-de-cadenas-de-la-win32/

Javier Andres Caceres Alvis



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.