Click here to Skip to main content
15,888,072 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: In Win32 OS, is single-precsion float faster than double? Pin
Richard Andrew x646-Apr-12 15:49
professionalRichard Andrew x646-Apr-12 15:49 
AnswerRe: In Win32 OS, is single-precsion float faster than double? Pin
Richard MacCutchan6-Apr-12 22:09
mveRichard MacCutchan6-Apr-12 22:09 
GeneralRe: In Win32 OS, is single-precsion float faster than double? Pin
Albert Holguin15-Apr-12 16:05
professionalAlbert Holguin15-Apr-12 16:05 
GeneralRe: In Win32 OS, is single-precsion float faster than double? Pin
Richard MacCutchan15-Apr-12 20:56
mveRichard MacCutchan15-Apr-12 20:56 
GeneralRe: In Win32 OS, is single-precsion float faster than double? Pin
Albert Holguin16-Apr-12 13:12
professionalAlbert Holguin16-Apr-12 13:12 
AnswerRe: In Win32 OS, is single-precsion float faster than double? Pin
Albert Holguin15-Apr-12 16:05
professionalAlbert Holguin15-Apr-12 16:05 
AnswerRe: In Win32 OS, is single-precsion float faster than double? Pin
Sean old school game guy7-May-12 10:55
Sean old school game guy7-May-12 10:55 
QuestionFmod include errors Pin
Member 79972644-Apr-12 13:55
Member 79972644-Apr-12 13:55 
I am making a C++ program to play some mp3 files and am running into trouble. I am getting identifier not found errors. Can anyone give me some advice besides including the header?

Here is my code:

    #include "fmod.h"
    #include "windows.h"
    #include <string>
    #include <iostream>
    #include <msclr\marshal_cppstd.h>
    #include <conio.h>

    #pragma comment (lib, "fmodex64_vc.lib")

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;
	using namespace std;

	/// <summary>
	/// Summary for Form1
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{

	public:
		FSOUND_SAMPLE* handle;
		Form1(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::TextBox^  textBox1;
	protected: 
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::ListBox^  list;
	private: System::Windows::Forms::Button^  button1;
	private: System::Windows::Forms::Button^  button2;


	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

    #pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->textBox1 = (gcnew System::Windows::Forms::TextBox());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->list = (gcnew System::Windows::Forms::ListBox());
			this->button1 = (gcnew System::Windows::Forms::Button());
			this->button2 = (gcnew System::Windows::Forms::Button());
			this->SuspendLayout();
			// 
			// textBox1
			// 
			this->textBox1->Location = System::Drawing::Point(97, 23);
			this->textBox1->Name = L"textBox1";
			this->textBox1->Size = System::Drawing::Size(518, 20);
			this->textBox1->TabIndex = 0;
			this->textBox1->TextChanged += gcnew System::EventHandler(this, &Form1::textBox1_TextChanged);
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->Location = System::Drawing::Point(12, 26);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(79, 13);
			this->label1->TabIndex = 1;
			this->label1->Text = L"Libray Location";
			// 
			// list
			// 
			this->list->FormattingEnabled = true;
			this->list->Location = System::Drawing::Point(15, 80);
			this->list->Name = L"list";
			this->list->Size = System::Drawing::Size(757, 472);
			this->list->TabIndex = 2;
			// 
			// button1
			// 
			this->button1->Location = System::Drawing::Point(697, 571);
			this->button1->Name = L"button1";
			this->button1->Size = System::Drawing::Size(75, 23);
			this->button1->TabIndex = 3;
			this->button1->Text = L"Play";
			this->button1->UseVisualStyleBackColor = true;
			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
			// 
			// button2
			// 
			this->button2->Location = System::Drawing::Point(616, 571);
			this->button2->Name = L"button2";
			this->button2->Size = System::Drawing::Size(75, 23);
			this->button2->TabIndex = 4;
			this->button2->Text = L"Refresh";
			this->button2->UseVisualStyleBackColor = true;
			this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(784, 606);
			this->Controls->Add(this->button2);
			this->Controls->Add(this->button1);
			this->Controls->Add(this->list);
			this->Controls->Add(this->label1);
			this->Controls->Add(this->textBox1);
			this->Name = L"Form1";
			this->Text = L"Form1";
			this->ResumeLayout(false);
			this->PerformLayout();

		}

		private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
			
		}
		private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
			msclr::interop::marshal_context context;
			std::string standardString = context.marshal_as<std::string>(textBox1->Text);
			GetAllFiles(standardString);
			//list->Items->Add();
			
		}

		void GetAllFiles(string sPath){
		WIN32_FIND_DATA FindFileData;
		string sTmpPath = sPath;
		sTmpPath += "\\*.*";

		HANDLE hFind = FindFirstFile( sTmpPath.c_str(), &FindFileData );

		if ( hFind == INVALID_HANDLE_VALUE )
			return;
		else {
			do {
				if ( ( FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) ) {
			// if directory:
					if ( strcmp(".", FindFileData.cFileName ) && strcmp("..", FindFileData.cFileName) ) {
				sTmpPath = sPath;
						sTmpPath += "\\";
				sTmpPath += FindFileData.cFileName;
						GetAllFiles( sTmpPath.c_str() );
					}
				}
				else // if file:
				{
					sTmpPath = sPath;
					sTmpPath += "\\";
					sTmpPath += FindFileData.cFileName;
					string fileType = sTmpPath.substr(sTmpPath.length()-3, sTmpPath.length());
					if(fileType == "mp3"){
						String^ myTempPath = gcnew String(sTmpPath.c_str());
						list->Items->Add(myTempPath);//cout << sTmpPath << endl;
					}
				}
			} while ( FindNextFile( hFind, &FindFileData) != 0 );

			FindClose( hFind );
		}
		return;
	}

		private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
			// init FMOD sound system
		    FSOUND_Init (44100, 32, 0);

		    // load and play mp3
		    handle=FSOUND_Sample_Load (0,"E:\\Steve\\Music\\2 Pac\\Unknown Album\\Temptations.mp3",0, 0, 0);
		    FSOUND_PlaySound (0,handle);
			FSOUND_Sample_Free (handle);
			FSOUND_Close();
		}
};



Here are my errors:

1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h(26): error C2143: syntax error : missing ';' before '*'
1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h(187): error C3861: 'FSOUND_Init': identifier not found
1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h (190): error C2065: 'handle' : undeclared identifier
1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h(190): error C3861: 'FSOUND_Sample_Load': identifier not found
1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h(191): error C2065: 'handle' : undeclared identifier
1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h (191): error C3861: 'FSOUND_PlaySound': identifier not found
1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h(192): error C2065: 'handle' : undeclared identifier
1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h(192): error C3861: 'FSOUND_Sample_Free': identifier not found
1>c:\users\steve\documents\visual studio 2010\projects\testforms\testforms\Form1.h(193): error C3861: 'FSOUND_Close': identifier not found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

AnswerRe: Fmod include errors Pin
Richard Andrew x644-Apr-12 17:40
professionalRichard Andrew x644-Apr-12 17:40 
QuestionVC++: cant manipulate forms Pin
Member 875813424-Mar-12 22:05
Member 875813424-Mar-12 22:05 
AnswerRe: VC++: cant manipulate forms Pin
f907334125-Mar-12 7:17
f907334125-Mar-12 7:17 
AnswerRe: VC++: cant manipulate forms Pin
Albert Holguin25-Mar-12 15:12
professionalAlbert Holguin25-Mar-12 15:12 
QuestionReading connection string from App.config using LINQ Pin
Wheels01219-Mar-12 4:37
Wheels01219-Mar-12 4:37 
AnswerRe: Reading connection string from App.config using LINQ Pin
Eddy Vluggen5-Apr-12 1:31
professionalEddy Vluggen5-Apr-12 1:31 
GeneralRe: Reading connection string from App.config using LINQ Pin
Wheels0125-Apr-12 2:08
Wheels0125-Apr-12 2:08 
Suggestionhelp a beginner please Pin
invincible bar17-Mar-12 23:47
invincible bar17-Mar-12 23:47 
GeneralRe: help a beginner please Pin
Richard MacCutchan18-Mar-12 2:20
mveRichard MacCutchan18-Mar-12 2:20 
GeneralRe: help a beginner please Pin
Albert Holguin21-Mar-12 7:50
professionalAlbert Holguin21-Mar-12 7:50 
QuestionPlease explain below code.... Pin
Member 154408715-Mar-12 5:44
Member 154408715-Mar-12 5:44 
AnswerRe: Please explain below code.... Pin
Richard MacCutchan15-Mar-12 6:03
mveRichard MacCutchan15-Mar-12 6:03 
GeneralRe: Please explain below code.... Pin
Member 154408715-Mar-12 6:22
Member 154408715-Mar-12 6:22 
GeneralRe: Please explain below code.... Pin
Richard MacCutchan15-Mar-12 6:54
mveRichard MacCutchan15-Mar-12 6:54 
Questionwhy construction called when i overload the operator new in c++ by calling malloc Pin
AARON_ZXF2-Mar-12 23:05
AARON_ZXF2-Mar-12 23:05 
AnswerRe: why construction called when i overload the operator new in c++ by calling malloc Pin
Richard MacCutchan2-Mar-12 23:16
mveRichard MacCutchan2-Mar-12 23:16 
GeneralRe: why construction called when i overload the operator new in c++ by calling malloc Pin
Albert Holguin21-Mar-12 8:50
professionalAlbert Holguin21-Mar-12 8:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.