Click here to Skip to main content
15,914,221 members
Home / Discussions / COM
   

COM

 
GeneralVB COM problem Pin
andyhk9527-Nov-03 15:03
andyhk9527-Nov-03 15:03 
GeneralRe: VB COM problem Pin
Brian Shifrin1-Dec-03 7:07
Brian Shifrin1-Dec-03 7:07 
GeneralRe: VB COM problem Pin
andyhk951-Dec-03 13:39
andyhk951-Dec-03 13:39 
GeneralTOM (Text Object Model) Pin
Andre123427-Nov-03 6:00
Andre123427-Nov-03 6:00 
GeneralThread/ COM Connection point Pin
benglish7225-Nov-03 17:49
benglish7225-Nov-03 17:49 
GeneralProblem solved, thanks! Pin
benglish7225-Nov-03 18:35
benglish7225-Nov-03 18:35 
GeneralProblem with Custom COM object in implementation of Interface Pin
bryces25-Nov-03 16:08
bryces25-Nov-03 16:08 
Generalworking with New Enum... Pin
rajdawg25-Nov-03 15:09
rajdawg25-Nov-03 15:09 
I am attempting to pass in an empty collection object (MerchandiseCol) defined in VB to a C++ dll. Once C++ recieves the object, I want to fill it with records from a database, and then return it to the VB executable.
Here is what I have...
<br />
extern "C" void __stdcall GetMerchandiseCol(IDispatch* pMerchandiseCol)<br />
{<br />
	HRESULT hr = CoInitialize(0);<br />
	if (SUCCEEDED(hr))<br />
	{<br />
		dbMerch dbM; 		 	// recordset object<br />
		_clsMerchandise* pMerch; 	// VB-defined object<br />
		_colMerchs* pMerchCol;   	// VB-defined collection object<br />
		<br />
		hr = pMerchandiseCol->QueryInterface(__uuidof(_colMerchs), (void **) &pMerchCol);<br />
<br />
		if(SUCCEEDED(hr))<br />
		{<br />
			if(dbM.Open())<br />
			{<br />
				VARIANT varItem;<br />
				CComPtr<IUnknown> pUnk;<br />
				CComPtr<IUnknown> pMerchandise;<br />
				CComQIPtr<IEnumVARIANT, &IID_IEnumVARIANT> pNewEnum;<br />
				//the next line gets a new enum in collection so I can fill it<br />
				if (SUCCEEDED(pMerchCol->get_NewEnum(&pUnk)) && pUnk != NULL)<br />
				{<br />
					pNewEnum = pUnk;<br />
					hr = pNewEnum->QueryInterface(__uuidof(_clsMerchandise), (void **) &pMerch); <br />
//the line above fails. When I debug this line, I go to the following code in ATLBASE.h<br />
	<br />
	_NoAddRefReleaseOnCComPtr<T>* operator->() const<br />
	{<br />
		ATLASSERT(p!=NULL);<br />
		return (_NoAddRefReleaseOnCComPtr<T>*)p;<br />
	}<br />
<br />
//Any suggestions? I am a little out of my depth with this stuff, but I feel I am very close to having this <br />
//code work. Thanks in advance for whatever help you can provide.<br />

Generalconstants in IDL file Pin
srikanthos25-Nov-03 1:23
srikanthos25-Nov-03 1:23 
GeneralCEdit in COM Pin
Tomaz Rotovnik24-Nov-03 20:48
Tomaz Rotovnik24-Nov-03 20:48 
GeneralRe: CEdit in COM Pin
Tomaz Rotovnik24-Nov-03 21:02
Tomaz Rotovnik24-Nov-03 21:02 
GeneralRe: CEdit in COM Pin
Tomaz Rotovnik24-Nov-03 22:57
Tomaz Rotovnik24-Nov-03 22:57 
Generalusing serverxmlhttp from a service or existing process Pin
noahsarf24-Nov-03 8:30
noahsarf24-Nov-03 8:30 
GeneralIID_... but no CLSID_... Pin
Xteuk24-Nov-03 4:46
Xteuk24-Nov-03 4:46 
GeneralRe: IID_... but no CLSID_... Pin
Mike Dimmick24-Nov-03 5:31
Mike Dimmick24-Nov-03 5:31 
GeneralRe: IID_... but no CLSID_... Pin
Xteuk24-Nov-03 22:13
Xteuk24-Nov-03 22:13 
GeneralMultiThreaded OutProc Server Pin
TroLoo22-Nov-03 7:22
TroLoo22-Nov-03 7:22 
GeneralRe: MultiThreaded OutProc Server Pin
valikac24-Nov-03 5:49
valikac24-Nov-03 5:49 
Generalneutral threading in XP vs. Win2000 Pin
jremignanti21-Nov-03 11:18
jremignanti21-Nov-03 11:18 
QuestionHow can i change the dllhost appbase??? Pin
Ik@20-Nov-03 23:59
Ik@20-Nov-03 23:59 
QuestionHow do I change the program id within the com project Pin
WoodyMou19-Nov-03 5:21
WoodyMou19-Nov-03 5:21 
AnswerRe: How do I change the program id within the com project Pin
Steve S19-Nov-03 5:44
Steve S19-Nov-03 5:44 
QuestionSame method and property name? Pin
snappa19-Nov-03 2:29
snappa19-Nov-03 2:29 
AnswerRe: Same method and property name? Pin
Vi221-Nov-03 2:31
Vi221-Nov-03 2:31 
GeneralMessages in ActiveX components Pin
Anonymous18-Nov-03 10:06
Anonymous18-Nov-03 10:06 

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.