|
I created a COM by pb,i invoked it in WinForm ,it worked well!
But,when i invoked it in Web Services,throw a "System.NullReferenceException" Exception!
Any help would be greatly appreciated!
Thankx!!!
|
|
|
|
|
Hello!
I know that a Visual Basic 6 in-process COM Server can create and give away a reference to a Form (a private type) like this:
' From Class MyComponent.FormCreator
Public Function CreateForm as Object
Set CreateForm = New frmMyForm
End Function
So, a VB client could use an object of type MyComponent.FormCreator to access an instance of frmMyForm:
' Client code
Dim objFormCreator As New MyComponent.FormCreator
Dim objForm as Form
Set objForm = objFormCreator.CreateForm
Set objFormCreator = Nothing ' I do not need this object anymore
objForm.Show ' I use the provided Form
What I would like to know if it is possible to make a C++ COM Server that behaves just like MyComponent.FormCreator. Can I expose my own Form object type that mimics exactly a VB 6 Form?
Thank you very much.
|
|
|
|
|
I'm trying to register an atl com object.
The self-registration succeeds in windows NT but not in win98.
iesharp.81630.com
|
|
|
|
|
Has anyone used the 'sharedpropertygroup' stuff avaiable in com+ ????
thanks in advance...
Pablo75
|
|
|
|
|
In Windows DNA Architacture, three layer,
Every client call COM+ Server,Server create a new process
for this client?
After this client want to create a com object,
a thread in which com object is run is in that process?
-----------------------------------------
Is the above right?
TIA
Hello everyone
|
|
|
|
|
Hello everyone
|
|
|
|
|
Hi all,
Can anybody help me about how to access dll from remote machine. I have used ATL AppWizard to develop dll component.
But when i try to call CoCreateInstanceEx(...)
I get the following error message...
"Class Not Registered"
Please help me as soon as possible...
|
|
|
|
|
Did you register the COM server on the remove system?
Kuphryn
|
|
|
|
|
This can only be done via DCOM, are you using DCOM? You have to register control via DCOM...I forget the exact procedure offhand.
|
|
|
|
|
I'm student. I've to make a plug-in for MS Outlook. This plug-in will take a particular date, and will delete all the attchments of the e-mails which are older than that specific date.
Kindly guide me for the task. Provide/guide me some sample code if possible. I'll be very grateful to you.
Waiting for your kind response.
Atif
Watch Your Thoughts for they will become your actions.
Watch Your Actions for they will become your habits.
Watch Your Habits for they will become your beliefs.
Watch Your Beliefs for they will determine your destiny.
|
|
|
|
|
I need to put together an ATL COM object making use of connection points to fire Events for a VB client app.
The problem is the Events will need to be fired asyncrously as when I call a particular method it goes of and creates a worker thread. I need to fire events from the worker thread multipe times back to the VB client, problem is that its now in another apartment as far as the origional thread is concerned, so COM will get upset if I user the interface pointer straight off.
From what I can tell it looks like I need to enlist the help of CoMarshalInterThreadInterfaceInStream . Does anyone have any pointers on a problem like this. Its basiclly real time data to a VB client.
As an aside, I know for Excel you can use DDE (tres old) or RTD for a higher though put in Excel XP, but not interested in this yet.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
|
Which of the following does not exist:
a) single thread apartment
b) multi thread apartment
c) cross thread apartment
d) thread neutral apartment
|
|
|
|
|
Hi,
I have create an ActiveXControl. It runs, but after one cycle it hangs in the memory.
I know that one solution are the functions AddRef() and Release(), but I don't know how I can use this and where. Please help me.
Julia
|
|
|
|
|
what do you mean " hangs in the memory"? Do you mean after you're done, there's still a floating referance to it somewhere?
You must call Release() on it, basically every time you use a referance to it, you call AddRef, and when you're done, call Release. Technically you're supposed to maintain an "accounting" of all this, but it can lead to insanity. If you're not passing referances to "outside" sources, you should be able to call Release() on it when you're done (the initial AddRef is done automatically).
OR you can use Smart pointers....look up Smart pointers in VC docs, they will do all this automatically.
|
|
|
|
|
Hi
I have created a ATL COM dll.The component will be used in WINDOWS 2000 machines which will not have Visual Studio.What are the ATL com dlls that I have to distribute along with the COM component?Please help.
Rgds,
venkatesh
|
|
|
|
|
I am using script control. when i add a procedure to the script control.if the procedure is error free then it works fine, but if there is a run-time error then a dialog box with the title "Just-In Time Debugging" and containg the option of .Net Studio that do you want to debug it. I want that this dialog box should not be displayed and i can handle this runtime error myself.
|
|
|
|
|
|
Hi
Is integer a COM automation data type?I am using windows 2000.My COM application should work for VC++ as well as VB.
If the interface method has parameters other than VARIANT will the scripting clients like VBA work?
Please help.
Rgds,
Venkatesh
|
|
|
|
|
Hi Venkatesh,
Well you can use "long" data type in your COM servers as it is compatible for both VC++ and scripting clients.
Other type that works fine is BSTR.
sandy
Last night i realized i was seeing a dream in my dream.
|
|
|
|
|
Hi Sandy,
Thank you.
Rgds,
Venkatesh
|
|
|
|
|
hi there..
i am working on a spread sheet control..and need to know if there is any problem with the way i am returning from the Invoke call..
When run this method throws an access violation...any ideas.??
here is the code..
long CControl :: GetObjCellCol(long ObjID)
{
DISPPARAMS DispParam1;
EXCEPINFO excep;
UINT nArgErr;
DISPID dispidNamed;
VARIANT * pResult = NULL;
DispParam1.cArgs = 1; //number of arguments
DispParam1.cNamedArgs = 0; // named arguments.
DispParam1.rgdispidNamedArgs = &dispidNamed;
// Dispatch IDs of named arguments.
DispParam1.rgvarg = new VARIANTARG();
DispParam1.rgvarg->vt = VT_I4;
DispParam1.rgvarg->lVal = ObjID;
IImpl::Invoke(DISPID_F1_CellCol, IID_NULL , 0 , NULL, &DispParam1,pResult , &excep, &nArgErr);
return pResult->lVal;
}
|
|
|
|
|
pResult is NULL. You should be passing the address of a valid VARIANT structure, i.e.:
VARIANT vtResult = { 0 };
IImpl::Invoke(
DISPID_F1_CellCol,
IID_NULL,
0,
NULL,
&DispParam1,
&vtResult,
&excep,
&nArgErr
);
return vtResult.lVal; When the called component comes to fill in the result value, it tries to write through a NULL pointer and causes the access violation.
Hope this helps.
|
|
|
|
|
oooooooooops
thanks )
|
|
|
|
|
I'm relatively new to c++ / com. I'm attempting to use a BHO in an intranet environment to add headers to specific urls. My problem is that using the code below, my new header doesn't turn up at the server (testing with an asp page that dumps all headers + an IP packet sniffer).
USES_CONVERSION;<br />
HRESULT hr ;<br />
<br />
if (pDispParams->cArgs >= 5 && pDispParams->rgvarg[5].vt == VT_BYREF|VT_VARIANT))<br />
{<br />
CComVariant vtURL(*pDispParams->rgvarg[5].pvarVal); <br />
vtURL.ChangeType(VT_BSTR);<br />
<br />
if (strstr(OLE2CA(vtURL.bstrVal), urlSearchList))<br />
{<br />
pDispParams->rgvarg[0].boolVal = VARIANT_TRUE;<br />
<br />
hr = m_spWebBrowser2->Stop();<br />
if (FAILED(hr))<br />
return hr;<br />
<br />
CComBSTR bstrHeaders("NewHeader: Header1\n\r");<br />
CComVariant newUrl(vtURL.bstrVal);<br />
newUrl.ChangeType(VT_BSTR);<br />
<br />
CComVariant vHeaders(bstrHeaders.m_str);<br />
vHeaders.ChangeType(VT_BSTR|VT_BYREF);<br />
<br />
hr = m_spWebBrowser2->Navigate2(&newUrl, NULL, NULL, NULL, &vHeaders);<br />
if (FAILED(hr))<br />
return hr;<br />
}<br />
}
The MSDN docs for the naviagte2 method show the headers arg as being pointer to variant. Am i using the wrong type?
Any links, code, or pointers much appreciated...
::Confused
|
|
|
|