hi Stephen,
I am working on another project at moment, what i can do now is to set up bluetooth manunly, and print out via serial port, i talk to the developer in motorola UK, he said, SS1 is the worst stack they have, no wrapper class for .net at moment. what i want to do is to using p/Invoke to achieve the function i need, but i even don't know the interface in win32 API i have,following are sampe code i have
blueprint in C++
const TCHAR *szFavouritesFile = _T("\\Windows\\BTFavouritesTemp.txt");
const TCHAR *szCustomerDll = _T("customerdll.dll") ;
const TCHAR *szAddFavourites = TEXT("AddFavorites");
typedef int (*PFNADDFAVORITES)(char *);
int CCreateVirtualPort::CreateBtPort( int m_Index, CString m_csPrinterAddress )
{
HANDLE hFile = CreateFile(szFavouritesFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
if ( hFile == INVALID_HANDLE_VALUE )
return -10;
char szPrinterAddress[ 64 ] = {0};
char szPrinterName[ 128 ] = {0};
wcstombs( szPrinterAddress, m_csPrinterAddress, wcslen(m_csPrinterAddress) );
wcstombs( szPrinterName, m_csPrinterName, wcslen(m_csPrinterName) );
//
// Create out favorites file and add to BT explorers favorite list
//
char szFavoriteString[256] = {0};
sprintf( szFavoriteString, "%s=0, 1.0, | %s:COM%d:|, |Serial Printer|, 1, 0, %d", szPrinterAddress, szPrinterName, m_Index, m_Index );
DWORD dwBytesWritten = 0;
WriteFile( hFile, szFavoriteString, strlen(szFavoriteString), &dwBytesWritten, NULL );
CloseHandle( hFile );
HINSTANCE hCustomerDLL = LoadLibrary( szCustomerDll );
if ( hCustomerDLL == NULL )
return -20;
PFNADDFAVORITES pfnAddFavorites = (PFNADDFAVORITES) GetProcAddress( hCustomerDLL, szAddFavourites );
if( pfnAddFavorites == NULL )
{
FreeLibrary(hCustomerDLL);
CString csDebug;
csDebug.Format( TEXT("Unable to find entry point %s in %s"), szAddFavourites, szCustomerDll );
SendStatusMessage( csDebug, m_hWndParent );
AfxMessageBox( csDebug );
return -30;
}
char szFileName[MAX_PATH] = {0};
wcstombs( szFileName, szFavouritesFile, wcslen(szFavouritesFile) );
int rc = pfnAddFavorites( szFileName ) ;
FreeLibrary(hCustomerDLL);
CString csDebug;
csDebug.Format( TEXT( "AddFavorites returned %d"), rc );
SendStatusMessage( csDebug, m_hWndParent );
return rc ;
}
following link could be useful,
http://support.symbol.com/support/search.do?languages=&rwTarget=%2FrfPlayerWidget.do&searchMode=GuidedSearch&searchString=stonestreet&productLine=&product=&document=&cmd=search&productFamily=&contextType=gs
also you need to check out sample SS1 SDK you download
brad