Click here to Skip to main content
15,905,971 members
Home / Discussions / COM
   

COM

 
QuestionRe: Know if a dll COM is registred or no! Pin
CPallini19-Feb-09 2:49
mveCPallini19-Feb-09 2:49 
AnswerRe: Know if a dll COM is registred or no! Pin
MrKBA19-Feb-09 3:31
MrKBA19-Feb-09 3:31 
QuestionRe: Know if a dll COM is registred or no! Pin
CPallini19-Feb-09 5:02
mveCPallini19-Feb-09 5:02 
AnswerRe: Know if a dll COM is registred or no! Pin
MrKBA19-Feb-09 5:07
MrKBA19-Feb-09 5:07 
QuestionRe: Know if a dll COM is registred or no! Pin
CPallini19-Feb-09 5:14
mveCPallini19-Feb-09 5:14 
AnswerRe: Know if a dll COM is registred or no! Pin
MrKBA19-Feb-09 6:35
MrKBA19-Feb-09 6:35 
QuestionHow do I convert IDL to ODL and make a Typelib necessary only for the compile? Pin
Bruce Axtens19-Feb-09 2:15
Bruce Axtens19-Feb-09 2:15 
QuestionProblem with SAFEARRAY across COM boundary Pin
astropunk18-Feb-09 12:46
astropunk18-Feb-09 12:46 
I am having a problem with safearrays. On the client side, I create a CComSafeArray and populate it with variants. Then I assign the safearray to a variant, which I pass as an in/out parameter across COM to the server. The server extracts the safearray from the variant, and attempts to extract the elements from the safearray, but fails. Any ideas why?

Here is the client function:

void CMyClass::GetData(VARIANT* pvData)
{
...
		// create a 2D SAFEARRAY to hold the data
		CComSafeArrayBound bound[2];
		bound[0].SetCount(parms.GetSize()/2);  // parms is a CStringArray, declared above
		bound[0].SetLowerBound(0);
		bound[1].SetCount(2);
		bound[1].SetLowerBound(0);

		CComSafeArray<variant> sa;
		sa.Create(bound, 2);

		// populate the array
		LONG index[2];
		for (int i = 0; i < parms.GetSize(); i+=2)
		{
			index[0] = i / 2;
			index[1] = 0;
			ATLASSERT(S_OK == sa.MultiDimSetAt(index, CComVariant(parms.GetAt(i))));

			index[1] = 1;
			ATLASSERT(S_OK == sa.MultiDimSetAt(index, CComVariant(parms.GetAt(i+1))));
		}

		// assign the array to the VARIANT parameter
		pvData->vt = VT_ARRAY|VT_VARIANT;
		pvData->parray = sa.Detach();
}
</variant>


The COM call looks like this:
[id(1),helpstring("...")] HRESULT SetData([in,out] VARIANT * pvntData,[out,retval] EnumResult *pVal);


And the server function(s) looks like this:
...
                // copy the safe array to a member variable
		if (pvntData->vt == VT_ARRAY | VT_VARIANT)
		{
			SafeArrayCopy(pvntData->parray, &m_psaData);
			SafeArrayDestroy(pvntData->parray);
		}

...
m_psaData is a member variable of type SAFEARRAY *
...
		// extract the data
		long lNumRows,lNumCols;
		long idxColRow[2];
		SafeArrayGetUBound(m_psaData, 1, &lNumRows);
		SafeArrayGetUBound(m_psaData, 2, &lNumCols);

		ATLASSERT(lNumCols == 1);  // expect 2 columns (upper bound being 1)
		VARIANT vParm1;
		VARIANT vParm2;

		for (int row = 0; row <= lNumRows; row++)
		{
			idxColRow[0] = row;
			   
			idxColRow[1] = 0; 
			SafeArrayGetElement(m_psaData, idxColRow, (void *)&vParm1);

			idxColRow[1] = 1; 
			SafeArrayGetElement(m_psaData, idxColRow, (void *)&vParm2);

                        // NOTHING HERE!
...


At this point, vParm1 and vParm2 are empty. Why am I not seeing the correct values?

To make matters more interesting...I DO see the expected values when I step through the debugger. But when I build a release executable, the values are empty.

Can anyone here help??

Thank you,
Tim
QuestionDoes anyone know of a tool for reporting differences between two versions of the same typelib? Pin
pdohara18-Feb-09 11:11
pdohara18-Feb-09 11:11 
AnswerRe: Does anyone know of a tool for reporting differences between two versions of the same typelib? Pin
«_Superman_»18-Feb-09 18:06
professional«_Superman_»18-Feb-09 18:06 
GeneralRe: Does anyone know of a tool for reporting differences between two versions of the same typelib? Pin
pdohara19-Feb-09 11:27
pdohara19-Feb-09 11:27 
GeneralRe: Does anyone know of a tool for reporting differences between two versions of the same typelib? Pin
«_Superman_»19-Feb-09 18:02
professional«_Superman_»19-Feb-09 18:02 
GeneralRe: Does anyone know of a tool for reporting differences between two versions of the same typelib? Pin
pdohara23-Feb-09 9:11
pdohara23-Feb-09 9:11 
QuestionError : hr 0x80040154 Class not registered Pin
pandit8418-Feb-09 3:47
pandit8418-Feb-09 3:47 
QuestionRe: Error : hr 0x80040154 Class not registered Pin
«_Superman_»18-Feb-09 17:59
professional«_Superman_»18-Feb-09 17:59 
AnswerRe: Error : hr 0x80040154 Class not registered Pin
pandit8418-Feb-09 18:29
pandit8418-Feb-09 18:29 
QuestionInvalid callee error when calling COM function Pin
vineeshV18-Feb-09 1:32
vineeshV18-Feb-09 1:32 
QuestionIXMLHTTPRequest only seems to work once! [modified] Pin
Henrik Nelson18-Feb-09 1:05
Henrik Nelson18-Feb-09 1:05 
QuestionExcel's 2007 WorkbookBeforeSave Interface cancel problem Pin
nitincop18-Feb-09 0:58
nitincop18-Feb-09 0:58 
QuestionProblem with COleDispatchDriver::CreateDispatch(...). It is failing on x64 platform. Pin
sumd17-Feb-09 23:21
sumd17-Feb-09 23:21 
QuestionError - hr = 0x80040110 Class does not support aggregation (or class object is remote) Pin
pandit8416-Feb-09 17:54
pandit8416-Feb-09 17:54 
AnswerRe: Error - hr = 0x80040110 Class does not support aggregation (or class object is remote) Pin
«_Superman_»16-Feb-09 23:08
professional«_Superman_»16-Feb-09 23:08 
GeneralRe: Error - hr = 0x80040110 Class does not support aggregation (or class object is remote) Pin
pandit8416-Feb-09 23:27
pandit8416-Feb-09 23:27 
AnswerRe: Error - hr = 0x80040110 Class does not support aggregation (or class object is remote) Pin
frx9617-Feb-09 14:13
frx9617-Feb-09 14:13 
QuestionInterfacing with Excel Manager application Pin
Aladin10116-Feb-09 6:35
Aladin10116-Feb-09 6:35 

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.