|
Take a look at Using Standard Objects[^] and below. Intend the "Worksheets" instead of "Documents" there.
With best wishes,
Vita
|
|
|
|
|
Thanx! This seems to be really usefull info.
|
|
|
|
|
Hi All,
When I try instantiating a component from within a queued component (c# .net BTW), the component won't instantiate and the message moves to the dead queue.
If I remove the code and just print a message box it works,
If I add the code to another non COM+ project it works fine,
I reckon it's a security thing, I'm getting an unspecified error!!!
Any help would be appreciated.
Thanks,
Cian
|
|
|
|
|
Hi,
I am trying to do drag and drop to explorer with my own IDataObject implementation.
I tried the MFC class COleDataSource at first. It was quite convenient yet not good enough because it does not support IAsyncOperation. That made the main thread freeze during the D&D operation. So I tended to implement IDataObject by myself.
However, none of the samples I found did delayed rendering with IDataObject, neither is there any documentation over that topic. I post the question on MS groups but got no response.
A google search only hit 14 pages. Only 1 out of that 14 pages helped a little
http://www.parsian.ath.cx/books/0-7897-0844-2/ch14.htm
Seems like OLE is using a hidden window to handle the render request. But how do I do the same thing by myself?
Can anybody throw me some light?
Thanks a lot
|
|
|
|
|
;PDear all,
I am developing an application for Windows NT/2000/XP in which I want to create a folder whose size should not exceed 5MB. And should promt for error if data exceeds 5MB
Is there any way to fix size of folder ?
( I know that there is ICopyHook for this but i donot know much about ATL COM)
Please comment!
|
|
|
|
|
Ideally, you would implement ICopyHook in an ATL/COM object and use the callback in conjunction with shell folder notifications. this should work for your application.
|
|
|
|
|
Can you send some sample code for this ??
|
|
|
|
|
I've been getting this error from time to time:
ASP 0177 The component is configured to use synchronization and a thread has timed out waiting to enter the context.
Is anybody familiar with this error message?
Would appreciate any help
Thanx!
|
|
|
|
|
;PDear all,
I am developing an application for Windows NT/2000/XP in which I want to create a folder whose size should not exceed 5MB. And should promt for error if data exceeds 5MB
Is there any way to fix size of folder ?
( I know that there is ICopyHook for this but i donot know much about ATL COM)
Please comment!
|
|
|
|
|
I am new to COM. I have been trying to incorporate the WebBrowser control into an MFC program. I have been using as an example and article from MSDN -http://www.microsoft.com/mind/0798/webbrowser.asp.
In this example VBScript is used. I have been trying to use JavaScript instead. I am unable to change a value with a COM method when I pass a value from Javascript;
IN VBSCRIPT:
sub get_property_value_onclick()
i=window.external.get_propert(property_name.value, value)
if i<>0 then
property_value.value=value
MsgBox property_name.value & " = " & value, 0, "Successfully retrieved property"
else
MsgBox "Cound not find value for property '" & property_name.value & "'", 0 , ""
end if
end sub
In Javascript:
function get_property_value_onclick(namevalue,value)
{
var value = "test";
var i = window.external.get_property(property_name.value,value)
if (i != 0)
{
property_value.value=value;
var strMsg;
strMsg = "Successfully retrieved property:" + property_name.value + " = " + value ;
alert( strMsg);
}
else
{
var strMsg;
strMsg = "Could not retrieve" + property_name.value + " = " + value ;
alert( strMsg);
}
}
The COM Method:
HRESULT my_application::get_property(LCID lcid,
WORD wFlags,
DISPPARAMS* pdispparams,
VARIANT* pvarResult,
EXCEPINFO* pexcepinfo,
UINT* puArgErr)
{
if (wFlags & DISPATCH_METHOD)
{
if (pdispparams->cArgs!=2)
{
return DISP_E_BADPARAMCOUNT;
}
// force to string
VARIANT arg1;
VariantInit(&arg1);
HRESULT hr=VariantChangeType(&arg1,
&pdispparams->rgvarg[1],
0,
VT_BSTR);
if (FAILED(hr))
{
*puArgErr=1;
return hr;
}
string str;
com_util::bstr2string(arg1.bstrVal,str);
// try to find element
string2variant_map::iterator it=propertymap.find(str);
if (it==propertymap.end())
{
if (pvarResult)
{
V_VT(pvarResult) =VT_BOOL;
V_BOOL(pvarResult)=FALSE;
return S_OK;
}
if (!pexcepinfo)
{
return E_INVALIDARG;
}
// raise exception
memset(pexcepinfo,0,sizeof(EXCEPINFO));
pexcepinfo->wCode =1001;
pexcepinfo->bstrSource =SysAllocString(L"WebBrowser Demo");
pexcepinfo->bstrDescription =SysAllocString(L"No entry for the key");
return DISP_E_EXCEPTION;
}
hr = VariantCopy(pdispparams->rgvarg[0].pvarVal,&(*it).second);
if (pvarResult)
{
V_VT(pvarResult) =VT_BOOL;
V_BOOL(pvarResult)=TRUE;
}
return S_OK;
}
return DISP_E_MEMBERNOTFOUND;
}
The function VariantCopy(pdispparams->rgvarg[0].pvarVal,&(*it).second);
returns a bad varibale HRESULT. Bu tit works OK in VBSCRIPT. Any idea on how to solve this?
thanks,
RAM_MR
|
|
|
|
|
I have an MFC application with an atl object. Now I want to know if a user started the application or if the application was started by the scum, so I can (amongst others) deside whether to show or hide the windows of the application. Anyone knows how to do this ?
|
|
|
|
|
Never mind, I already found what I was looking for: AfxOleGetUserCtrl().
|
|
|
|
|
Hi, I need to create a new Activex control by sub classing another Activex control. This will retain all the old functionality plus some other functions can also be added, i have tried doing it through the MFC ATL wizard, but that only create a wrapper araound it. Also MFC's ActiveX control wizard does seem to support sub classing of some MS standard controls only.
if you have a way to acheive this then please do help.
Mayank Goyal
|
|
|
|
|
Hi, I have an MFC application on which I want to put a COM interface so other applications can interface with my application. I succeeded in doing this, but now I have several object that can be created from outside my application. What I want is to provide a single object that creates the other objects. Can (and if so, how?) I shield these objects so they can not be created from outside my own application ?
|
|
|
|
|
One solution is containment. Another solution is aggregation, but only allow access to certain interfaces.
Kuphryn
|
|
|
|
|
Kuphryn, thanx for your answer, but could you elaborate your answer? How does containment work? Can you show me an example or article?
|
|
|
|
|
Concept of containment is as C++'s "has a" inheritance relationship. In other words, the outside COM object containers interfaces that will then utilize the inner object. The outsider exposes whatever functions it wants.
Kuphryn
|
|
|
|
|
Your non-creatable object should not have the class-factory. However I don't know how to make it possible in MFC.
With best wishes,
Vita
|
|
|
|
|
I found what I was looking for. I just have to remove the coclasses from the idl file, so the classes are not registered. This way external applications can only access the main (co-)class. Now the 'non-coclasses' cannot be created with CoCreateInstance anymore, instead they have to be created by calling their own static CreateInstance method.
|
|
|
|
|
I want to export data from a MFC program to EXCEL 97.
The function prototypes are in excel8.h
This is all part of excel8.olb. The only documentation I can find is for VB (vbaxl8.hlp on the MS Office distribution CD)
WHERE CAN I FIND THE DOCUMENTATION FOR THE FUNCTIONS OF excel8.h (for C/C++ not VB)
Anybody who knows COM, and OLE Automation should know...
I am just a rookie when it comes to this part of programming
Ethernal gratitude is guaranteed...
Daniela
|
|
|
|
|
I have to reply to my own post...
There is NO documentation for EXCEL Automation for C++.
It is extremely difficult using the VB documentation to get the C++ code right.
For example
range.PasteSpecial(Paste, Operation, SkipBlanks, Transpose)
In VB, all 4 parameters are VARIANTS
in the C prototype file excel8.h, the first two parameters
are of type long.
The "#define" for parameter Paste can nowhere be found
I found a pathetic way to work around my problems.
Just record a bunch of macros in EXCEL and call them from the C program
myapp.Run( COleVariant("MyMacro"),...)
//there are 30!!! optional parameters instead of the periods
Daniela
|
|
|
|
|
I am having the same problem. Augh.
If you find any good documentation please let me know.
Mardigin
|
|
|
|
|
hi there..
i am enabling mfc in an activex control and what happens is that when i debug it ..it throws an access violation in OLE32.lib..
dont know why..ne ideas?
regards
safee
|
|
|
|
|
thanks amigo..
it got resolved..
i logged on today ... sorry for keeping u waiting..
regards
safee
|
|
|
|
|
I [users] get this error when the service has run for a long time...
Any idea about this?
the event log shows..
----------------------------------------------------------------------
The COM+ Services DLL (comsvcs.dll) was unable to load because allocation of thread local storage failed.
Process Name: MyExe.exe
Error Code = 0x80070008 : Not enough storage is available to process this command.
COM+ Services Internals Information:
File: .\comsvcs.cpp, Line: 289
----------------------------------------------------------------------
After seraching in the net, I realized that I am not the only one to get this problem... There are many executables which get this error. Apparently we are all doing the same kind of process.. [like calling CoInit many times (with proper un-inits)..etc]
But, nowhere a solution is discussed... any luck here??
Thanks for your time!
|
|
|
|