資源簡介
flex中調用dll,可以讓大家方便的控制各種硬件設備等

代碼片段和文件信息
//?MyTestDll.cpp?:?Defines?the?initialization?routines?for?the?DLL.
//
#include?“stdafx.h“
#include?“MyTestDll.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CMyTestDllApp
BEGIN_MESSAGE_MAP(CMyTestDllApp?CWinApp)
//{{AFX_MSG_MAP(CMyTestDllApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CMyTestDllApp?construction
CMyTestDllApp::CMyTestDllApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CMyTestDllApp?object
//?===============================================================
CMyTestDllApp?theApp;
#pragma?comment(lib?“FlashRuntimeExtensions.lib“)
FREContext?context;
//?===============================================================
//?播放本DLL內的WAV聲音資源,默認異步操作
//?===============================================================
#include?
#pragma?comment(lib?“Winmm.lib“)
BOOL?PlayWavRes(char?*pFile?BOOL?bAsyn)
{
????HMODULE?hMod?=?theApp.m_hInstance;
????int?nFileLen?=?strlen(pFile);
????int?nSndIdx?=?0;
????BOOL?bRet;
????
????if?(nFileLen?>?3)
????{
????????DWORD?dwFlag?=?(SND_FILENAME?|?SND_NODEFAULT);
????????dwFlag?|=?(bAsyn???SND_SYNC?:?SND_ASYNC);
????????bRet?=?PlaySound((LPCTSTR)pFile?NULL?dwFlag);
????}
????else
????{
????????nSndIdx?=?atoi(pFile)?+?1000;
????????DWORD?dwFlag?=?(SND_RESOURCE?|?SND_NODEFAULT);
????????dwFlag?|=?(bAsyn???SND_SYNC?:?SND_ASYNC);
????????if(!hMod)?hMod?=?GetModuleHandle(NULL);?//?NULL則取EXE的句柄
????????bRet?=?PlaySound((LPCTSTR)nSndIdx?hMod?dwFlag);
????}
????
????return?bRet;
}
//?===============================================================
//?轉換中文
//?===============================================================
void?utf8_to_ansi(char*?src?char*?&dest)?
{
????int?wcsLen?=?::MultiByteToWideChar(CP_UTF8?NULL?src?strlen(src)?NULL?0);//測試轉換
????wchar_t*?wszString?=?new?wchar_t[wcsLen?+?1];
????::MultiByteToWideChar(CP_UTF8?NULL?src?strlen(src)?wszString?wcsLen);??//utf8?轉Unicode
????wszString[wcsLen]?=?‘\0‘;
????
????int?ansiLen?=?::WideCharToMultiByte(CP_ACP?NULL?wszString?wcslen(wszString)?NULL?0?NULL?NULL);
????dest?=?new?char[ansiLen?+?1];???//unicode版對應的strlen是wcslen
????::WideCharToMultiByte(CP_ACP?NULL?wszString?wcslen(wszString)?dest?ansiLen?NULL?NULL);
????dest[ansiLen]?=?‘\0‘;
????delete?[]?wszString;
}
//?===============================================================
//?獲取Char*長度
//?===============================================================
int?getCharLength(c
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????20427??2012-03-16?03:37??FlexANEDll_TestPrj\01_MyTestDll\FlashRuntimeExtensions.h
?????文件???????8614??2012-03-16?03:38??FlexANEDll_TestPrj\01_MyTestDll\FlashRuntimeExtensions.lib
?????文件????????340??2013-08-30?17:10??FlexANEDll_TestPrj\01_MyTestDll\MyTestDll.clw
?????文件???????5917??2013-08-30?17:45??FlexANEDll_TestPrj\01_MyTestDll\MyTestDll.cpp
?????文件????????230??2013-08-30?17:26??FlexANEDll_TestPrj\01_MyTestDll\MyTestDll.def
?????文件???????4263??2013-08-30?17:45??FlexANEDll_TestPrj\01_MyTestDll\MyTestDll.dsp
?????文件????????541??2013-08-30?17:10??FlexANEDll_TestPrj\01_MyTestDll\MyTestDll.dsw
?????文件???????2065??2013-08-30?17:36??FlexANEDll_TestPrj\01_MyTestDll\MyTestDll.h
?????文件??????50176??2013-08-30?17:45??FlexANEDll_TestPrj\01_MyTestDll\MyTestDll.ncb
?????文件??????53760??2013-08-30?17:45??FlexANEDll_TestPrj\01_MyTestDll\MyTestDll.opt
?????文件???????1836??2013-08-30?17:45??FlexANEDll_TestPrj\01_MyTestDll\MyTestDll.plg
?????文件???????3083??2013-08-30?17:10??FlexANEDll_TestPrj\01_MyTestDll\MyTestDll.rc
?????文件???????2603??2013-08-30?17:10??FlexANEDll_TestPrj\01_MyTestDll\ReadMe.txt
?????文件??????24576??2013-08-30?17:45??FlexANEDll_TestPrj\01_MyTestDll\Release\MyTestDll.dll
?????文件???????2152??2013-08-30?17:45??FlexANEDll_TestPrj\01_MyTestDll\Release\MyTestDll.lib
?????文件????????401??2013-08-30?17:10??FlexANEDll_TestPrj\01_MyTestDll\res\MyTestDll.rc2
?????文件????????381??2013-08-30?17:10??FlexANEDll_TestPrj\01_MyTestDll\Resource.h
?????文件????????211??2013-08-30?17:10??FlexANEDll_TestPrj\01_MyTestDll\StdAfx.cpp
?????文件???????1447??2013-08-30?17:10??FlexANEDll_TestPrj\01_MyTestDll\StdAfx.h
?????文件???????1710??2013-08-31?17:25??FlexANEDll_TestPrj\02_MyLibrary\.actionsc
?????文件????????304??2013-08-31?17:25??FlexANEDll_TestPrj\02_MyLibrary\.flexLibProperties
?????文件????????475??2013-08-31?17:24??FlexANEDll_TestPrj\02_MyLibrary\.project
?????文件?????????88??2013-08-31?17:24??FlexANEDll_TestPrj\02_MyLibrary\.settings\org.eclipse.core.resources.prefs
?????文件???????2104??2013-08-31?17:30??FlexANEDll_TestPrj\02_MyLibrary\bin\MyLibrary.swc
?????文件????????418??2013-08-31?17:29??FlexANEDll_TestPrj\02_MyLibrary\src\com\MyDllTest\MyDllAs.as
?????文件???????1642??2013-08-25?17:09??FlexANEDll_TestPrj\03_MyANEPack\2.p12
?????文件????????479??2013-08-31?17:31??FlexANEDll_TestPrj\03_MyANEPack\extension.xm
?????文件???????1267??2013-08-31?17:30??FlexANEDll_TestPrj\03_MyANEPack\library.swf
?????文件???????2104??2013-08-31?17:30??FlexANEDll_TestPrj\03_MyANEPack\MyLibrary.swc
?????文件???????9584??2013-08-31?17:33??FlexANEDll_TestPrj\03_MyANEPack\MyTestDll.ane
............此處省略49個文件信息
- 上一篇:WAS基本使用手冊
- 下一篇:PCM時分復用電路的設計與仿真
評論
共有 條評論