Click here to Skip to main content
15,910,234 members
Home / Discussions / COM
   

COM

 
GeneralRe: SCODE or HRESULT or...? Pin
soptest31-May-02 13:26
soptest31-May-02 13:26 
GeneralGIT and the FTM Pin
Philippe Mori31-May-02 4:09
Philippe Mori31-May-02 4:09 
GeneralRe: GIT and the FTM Pin
soptest31-May-02 9:04
soptest31-May-02 9:04 
GeneralRe: GIT and the FTM Pin
Philippe Mori14-Jun-02 3:46
Philippe Mori14-Jun-02 3:46 
GeneralW2A query Pin
Nish Nishant30-May-02 1:07
sitebuilderNish Nishant30-May-02 1:07 
GeneralRe: W2A query Pin
Prem Kumar30-May-02 7:48
Prem Kumar30-May-02 7:48 
GeneralRe: W2A query Pin
Nish Nishant30-May-02 15:02
sitebuilderNish Nishant30-May-02 15:02 
GeneralRe: W2A query Pin
soptest30-May-02 7:59
soptest30-May-02 7:59 
W2A uses stack, so size of BSTR is limited.
Use this code:
//------------------------//
// Convert BSTR to char * //
//------------------------//
inline char* ConvertBSTRToString(BSTR pSrc)
{
	if(!pSrc) return NULL;
	
	DWORD cb,cwch = ::SysStringLen(pSrc);//convert even embeded NULL
	
	char *szOut = NULL;
	
	if(cb = ::WideCharToMultiByte(CP_ACP, 0, pSrc, cwch + 1, NULL, 0, 0, 0))
	{
		szOut = new char[cb];
		if(szOut)
		{
			szOut[cb - 1]  = '\0';
			
			if(!::WideCharToMultiByte(CP_ACP, 0, pSrc, cwch + 1, szOut, cb, 0, 0))
			{
				delete []szOut;//clean up if failed;
				szOut = NULL;
			}
		}
	}

	return szOut;
};


soptest
GeneralRe: W2A query Pin
Nish Nishant30-May-02 15:04
sitebuilderNish Nishant30-May-02 15:04 
GeneralATL DLL-server problem Pin
Hans Ruck29-May-02 2:21
Hans Ruck29-May-02 2:21 
GeneralRe: ATL DLL-server problem Pin
-Dy29-May-02 5:43
-Dy29-May-02 5:43 
GeneralMS Excel automation Pin
28-May-02 23:01
suss28-May-02 23:01 
GeneralRe: MS Excel automation Pin
Amit Dey30-May-02 19:19
Amit Dey30-May-02 19:19 
QuestionHow to get HTML code from MSHTML? Pin
28-May-02 13:29
suss28-May-02 13:29 
AnswerRe: How to get HTML code from MSHTML? Pin
soptest28-May-02 14:25
soptest28-May-02 14:25 
GeneralRe: How to get HTML code from MSHTML? Pin
29-May-02 6:52
suss29-May-02 6:52 
Generalautomation Pin
28-May-02 6:03
suss28-May-02 6:03 
GeneralRe: automation Pin
Prem Kumar28-May-02 7:28
Prem Kumar28-May-02 7:28 
GeneralRe: automation Pin
31-May-02 4:21
suss31-May-02 4:21 
GeneralFire Event from outside the COM Method Pin
Koep28-May-02 3:33
Koep28-May-02 3:33 
GeneralRe: Fire Event from outside the COM Method Pin
Len Holgate30-May-02 19:50
Len Holgate30-May-02 19:50 
GeneralRe: Fire Event from outside the COM Method Pin
Koep30-May-02 21:08
Koep30-May-02 21:08 
GeneralRe: Fire Event from outside the COM Method Pin
Len Holgate30-May-02 21:14
Len Holgate30-May-02 21:14 
GeneralRe: Fire Event from outside the COM Method Pin
Koep30-May-02 23:51
Koep30-May-02 23:51 
GeneralRe: Fire Event from outside the COM Method Pin
Len Holgate31-May-02 0:01
Len Holgate31-May-02 0:01 

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.