|
You may consider calling CoInitialize() in the new thread to join a STA apartment. Also, you seem to create an object in main STA (in OnInitDialog) and then pass a raw interface pointer to in (wrapped with CActiveMovie3) to another apartment. It violates COM principles.
Consider using CoMarshalInterThreadInterfaceInStream or create an object in Mediathread.
-= Alexander =-
<<= Long Live COM =>>
|
|
|
|
|
Hello,
I am looking at converting some C++ code to use COM objects instead to avoid recomiling the world when anything changes.
At the moment I am trying to work out whether you can have a static method/property in an interface (equivalent to static function in a C++ class).
None of the documentation/books I have seen even mentions this, I am therefore presuming it is something that isn't possible.
If anyone could confirm this, or maybe point out some 'alternatives' to me I would be grateful.
Also, is it possible to publish a non-implemented interface for use by third parties in cases where I have defined some 'pure-virtual' methods - would this be distributed as a type library???
Thanks
Paul.
|
|
|
|
|
Anonymous wrote:
At the moment I am trying to work out whether you can have a static method/property in an interface (equivalent to static function in a C++ class).
Because static member functions are not put in the VTable for functions of a class, I would suggest that you do not declare a static method directly in your interface that you would like to expose. However, There should be no problem if the way that you choose to implement a function in your interface that calls a static method, this should accomplish the same goal.
class X
{
...
static HRESULT H_function ();
...
HRESULT static_function ()
{
return H_function();
}
};
A bit contrived, but hopefully it explains the point.
Anonymous wrote:
is it possible to publish a non-implemented interface for use by third parties in cases where I have defined some 'pure-virtual' methods - would this be distributed as a type library???
You can publish any interface that you would like. Putting the definitions in a type library simply makes it accessible to languages that pragmatically read the type library to gain access to the objects inside, so this would be an acceptable way of doing it.
Checkout my Guide to Win32 Paint for Intermediates
|
|
|
|
|
|
Has anyone had to get the chart1 gif from an xsl file? I know if you manually perform a SaveAs and choose Webpage, you will create a directory whether you choose "Entire Workbook" or "Republish:chart". From there you can just access the gif. I need to know how to grab that COM object and perform the SaveAs. Or am I making this more difficult than it has to be?
Thanks,
Lilian
|
|
|
|
|
Hi Hello any one can send me how to use dom in xml
|
|
|
|
|
|
dom in XML?
can u be a bit more specific?
bryce
|
|
|
|
|
Hi Hello any one can send me how to use dom in xml
|
|
|
|
|
Hi Hello any one can send me how to use dom in xml
|
|
|
|
|
http://www.codeproject.com/useritems/msxmlcpp.asp
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
How to register com component
|
|
|
|
|
In command prompt:
regsvr32 filepath
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
from the command line
regsvr32 yourdll.dll
do unregister
regsvr32 yourdll.dll /u
though i like to have a batch file in my project which is run as a post link command
Bryce
sounds like we need a tool to do it from windows ?
|
|
|
|
|
Testing message
|
|
|
|
|
testing worked...isn't it great when that happens?
bryce
|
|
|
|
|
I have created a MSXML object as following C++ code shows:
CComPtr<ixmldomdocument> spXMLDOM;
HRESULT hr = spXMLDOM.CoCreateInstance(__uuidof(DOMDocument));
if ( FAILED(hr) ) throw "Unable to create XML parser object";
if ( spXMLDOM.p == NULL ) throw "Unable to create XML parser object";
CComBSTR str(L"<xmldata><xmlnode><xmltext>Hello, World!");
hr = spXMLDOM->loadXML(str, &bSuccess);
But it doesn't load the str and the value of bSuccess is FALSE
Please help.
Thanks in advance.
|
|
|
|
|
I want to output a recordset to client in COM, I did as following:
[id(7), helpstring("method GetStudentInfo")] HRESULT GetStudentInfo([in] BSTR bstrStudentID, [out,retval] _Recordset *pRs);
But error report that
error MIDL2025 : syntax error : expecting a type specification near "_Recordset"
But here i think _Recordset is a type specification
|
|
|
|
|
You can pass _RecordsetPtr also as a IDispatch*. For the _RecordsetPtr problem, lookup http://www.codeproject.com/atl/atl_ado.asp.
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Hi
I want to run the sample "Simple" on remote machine.We can run as a local server or remote server.I am able to run as a local server but not able to run as remote machine.How to accomplish this?How to register the exe in DCOM?
plase help?
Thank you
Pathi
|
|
|
|
|
i do mine as an NT service
then run the exe with "/service"
eg. fromthe command line
"mynewdcom.exe /service"
bryce
|
|
|
|
|
Hi
I wrote a component and wanted to access it on remote machine.how to accomplish this?How can I register that component?Do I need to register that exe on both machines?Then How to register and call that component?(using DCOM)
Please help me
Thank you
Sai
|
|
|
|
|
run the exe as with "/service" onthe machine which you want to use as the server
you can connect to it (assuming you have the permissions set etc)
by using CoCreateInstanceEx
see the dcom articles here on codeproject
bryce
|
|
|
|
|
Hello all,
I'm using BeforeNavigate2 event to get the Post data as per MSDN article:
HOWTO: Handle Data from a Post Form When Hosting WebBrowser Control (Q256195)
But I'm unable to get the the BSTRs from the Post Data SAFEARRAY.
Here's my BHO's Invoke implementation:
if (dispidMember ==DISPID_BEFORENAVIGATE2)
{
if(pDispParams->rgvarg[1].vt==(VT_BYREF|VT_VARIANT) && pDispParams->rgvarg[2].vt ==(VT_BYREF|VT_VARIANT) && pDispParams->rgvarg[2].pvarVal->vt!=VT_EMPTY)
{
ATLTRACE("\nGetting POST Info");
CComBSTR szTemp,szPostData;
long plLbound, plUbound;
CComVariant varHeaders(*pDispParams->rgvarg[1].pvarVal);
varHeaders.ChangeType(VT_BSTR);
CString strHeaders(OLE2T(varHeaders.bstrVal));
//got the header data
CComVariant var(*pDispParams->rgvarg[2].pvarVal);
SAFEARRAY *psa=NULL;
psa= var.parray;
SafeArrayAccessData(psa , (LPVOID*)&szTemp);
//next two lines yields an Unhandled
//Exception when there is valid Post data??
// SafeArrayGetLBound(psa , 1, &plLbound);
// SafeArrayGetUBound(psa , 1, &plUbound);
CComBSTR str;
szTemp.CopyTo(&szPostData);
SafeArrayUnaccessData(psa);
ATLTRACE(OLE2T(szPostData));
//output always ""
}
}
Dunno what is going wrong. DO I need to preallocate a SAFEARRAY?
My Postdata html pages are nothing out-of-the-ordinary.Just a simple textbox that passes a string thru HTTP POST.
Any help will be great.
TIA.
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Can anyone point me towards the part of the Outlook object model, where I can find the number of new emails in a folder-
Regards
Ben
Vacancy for signature; Apply within.
|
|
|
|