|
I can advise the Microsoft author "Beck Zaratian"... Book names is "Programmer's Guide". I can sale mine? if you want?
What is this¿
|
|
|
|
|
And so you suggest a title you're selling out?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
50$ + cargo expenses!
What is this¿
|
|
|
|
|
|
So.. Might i leaving the preference to you... Actually, there is 1 sample in this book care about COM. Maybe you know, have only "TowerCtrl" sample. When I saw ur forum msg.. i acted without thought... But this book explaining all about the ActiveX programming using ATL or MFC of course as introduction. Sorry friend. Actually this is a development kid what about the Microsoft System Engineering. I'd like to sale it. If you want to build a career on the Software Development I can sale to all of them as development kid.(50$) Because I am feeling sorry with buying it. If you obstinate for COM pls take a look at the http://www.amazon.com by searching as "developers workshop ATL/COM"... You will be able to see many section care about ATL/COM..
Yours sincerely.
-- modified at 14:41 Friday 2nd November, 2007
What is this¿
|
|
|
|
|
Hi all.
How can I get the coordinates IHTMLLIElement (Highlights, Latest releases, Using your computer, ..) at www.microsoft.com
code:
pDoc2 - pointer to the document frame containing element
pElement - pointer at the element
Text - text links
void CExplorerWindow::GetLinkRect(CComPtr<ihtmldocument2> pDoc2, CComQIPtr<ihtmlelement,&iid_ihtmlelement> pElement, BSTR Text, LPRECT Rect)
{
long Top = 0;
long Hight = 0;
long Left = 0;
long Width = 0;
CComPtr<idispatch> pDisp = NULL;
if (pWebBrowser2)
{
pWebBrowser2->get_Document (&pDisp);
if (pDisp)
{
CComPtr<ihtmldocument2> pDoc = NULL;
pDisp->QueryInterface (IID_IHTMLDocument2, (void **) &pDoc);
if (pDoc)
{
CComPtr<ihtmlframescollection2> m_frame = NULL;
pDoc->get_frames(&m_frame);
if (m_frame)
{
long len = 0;
m_frame->get_length (&len);
if (len)
{
CComQIPtr<ihtmlelement> pEl ;
if (SUCCEEDED(pDoc2->get_body(&pEl)))
{
CComQIPtr<ihtmlbodyelement> pBodyElement ;
pBodyElement = pEl;
if (pBodyElement)
{
CComQIPtr<ihtmltxtrange> pTxtRange;
pBodyElement->createTextRange(&pTxtRange);
if (pTxtRange)
{
if (pTxtRange->moveToElementText(pElement) == S_OK)
{
VARIANT_BOOL ok;
if (pTxtRange->findText(Text,wcslen(Text),0,&ok) == S_OK)
{
CComQIPtr<ihtmltextrangemetrics2> pTextRangeMetrics2;
pTextRangeMetrics2 = pTxtRange;
CComQIPtr<ihtmlrectcollection> ptrRectColl;
CComQIPtr<ihtmlrect> ptrHTMLRect;
if (pTextRangeMetrics2->getClientRects(&ptrRectColl) == S_OK)
{
long Len;
ptrRectColl->get_length(&Len);
if (Len)
{
VARIANT VarInd, VarDisp;
VarInd.vt = VT_I4;
for(int i = 0; i < Len;i++)
{
VarInd.lVal = i;
ptrRectColl->item (&VarInd, &VarDisp);
ptrHTMLRect = VarDisp.pdispVal;
long Top = 0;
long Right = 0;
long Left = 0;
long Bottom = 0;
if (ptrHTMLRect)
{
ptrHTMLRect->get_left (&Left);
ptrHTMLRect->get_top (&Top);
ptrHTMLRect->get_right (&Right);
ptrHTMLRect->get_bottom(&Bottom);
//!!! Left, Top, Right, Bottom - 0
}
SetRect(Rect, Left, Top, Right, Bottom);
}
}
else
{
pElement->get_offsetHeight(&Hight);
pElement->get_offsetWidth(&Width);
pElement->get_offsetTop(&Top);
pElement->get_offsetLeft(&Left);
IHTMLElement* pParentElement = NULL;
while (SUCCEEDED(pElement->get_offsetParent(&pParentElement)))
{
if (!pParentElement) break;
long ParentLeft, ParentTop;
pParentElement->get_offsetTop(&ParentTop);
pParentElement->get_offsetLeft(&ParentLeft);
Top += ParentTop;
Left +=ParentLeft;
pElement = pParentElement;
pParentElement->Release();
}
}
ptrRectColl.Detach();
}
}
}
}
}
}
}
else // no frames
{
CComQIPtr<ihtmlelement2> pElement2(pElement);
CComPtr<ihtmlrect> BoundingRect;
if (pElement2)
{
if (SUCCEEDED(pElement2->getBoundingClientRect(&BoundingRect)) && BoundingRect)
{
BoundingRect->get_top(&Top);
BoundingRect->get_left(&Left);
}
else
{
Top = 0; Left = 0;
}
}
pElement->get_offsetHeight(&Hight);
pElement->get_offsetWidth(&Width);
SetRect(Rect, Left, Top, Left + Width, Top + Hight);
}
}
else //m_frame == 0
{
CComQIPtr<ihtmlelement2> pElement2(pElement);
CComPtr<ihtmlrect> BoundingRect;
if (pElement2)
{
if (SUCCEEDED(pElement2->getBoundingClientRect(&BoundingRect)) && BoundingRect)
{
BoundingRect->get_top(&Top);
BoundingRect->get_left(&Left);
}
else
{
Top = 0; Left = 0;
}
}
pElement->get_offsetHeight(&Hight);
pElement->get_offsetWidth(&Width);
SetRect(Rect, Left, Top, Left + Width, Top + Hight);
}
}
}
}
if (IsRectEmpty(Rect)) Beep(200,100); - only if pElement == Highlights, Latest releases, Using your computer, ..
}
|
|
|
|
|
I am trying to extract the words and punctuation from a word document. I am having a heck of a time finding thorough documentation on the strings to pass (Ex: L"Document", L"Words", L”Open”, etc.) and the patterns to use in the calls. The code I am using has been extracted and tweaked from the MS support site examples. What I have found is a good start except it all stops short of showing how to grab the words from the file. This code runs but it does not actually pull the words from the file in the line:
AutoWrap(DISPATCH_PROPERTYGET|DISPATCH_METHOD, &rVal, pDoc.pdispVal, L"Words", 1, parm[0]);
The Code:
HRESULT AutoWrap(int autoType, VARIANT *pvResult, IDispatch *pDisp, LPOLESTR ptName, int cArgs...) {
// Reduced code...
// Get DISPID for name passed...
hr = pDisp->GetIDsOfNames(IID_NULL, &ptName, 1, LOCALE_USER_DEFAULT, &dispID);
// Handle special-case for property-puts!
if(autoType & DISPATCH_PROPERTYPUT) {
dp.cNamedArgs = 1;
dp.rgdispidNamedArgs = &dispidNamed;
}
// Make the call!
hr = pDisp->Invoke(dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT, autoType, &dp, pvResult, NULL, NULL);
return hr;
}
int main(int argc, char* argv[]){
// Initialize the OLE Library...
OleInitialize(NULL);
// Set WordApp = CreateObject Word.Application
{
CLSID clsid;
CLSIDFromProgID(L"Word.Application", &clsid);
HRESULT hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER|CLSCTX_INPROC_SERVER, IID_IDispatch, (void **)&rVal.pdispVal);
// WordApp . DisplayAlerts = 0
rVal.vt = VT_I4;
rVal.lVal = 0;
AutoWrap(DISPATCH_PROPERTYPUT, NULL, pWordApp.pdispVal, L"DisplayAlerts", 1, rVal);
VariantClear(&rVal);
// WordApp . Documents . Open wordPath , 0 , 1
AutoWrap(DISPATCH_PROPERTYGET|DISPATCH_METHOD, &pDoc, pWordApp.pdispVal,
L"Documents", 0);
parm[1].vt = VT_I4;
parm[1].lVal = 0;
parm[2].vt = VT_I4;
parm[2].lVal = 1;
AutoWrap(DISPATCH_METHOD, NULL, pDoc.pdispVal, L"Open", 3, parm[2], parm[1], parm[0]);
// Set pDoc = WordApp . Documents 1
parm[0].vt = VT_I4;
parm[0].lVal = 1;
AutoWrap(DISPATCH_PROPERTYGET|DISPATCH_METHOD, &pDoc, pWordApp.pdispVal, L"Documents", 1, parm[0]);
// Get count of words in document
AutoWrap(DISPATCH_PROPERTYGET|DISPATCH_METHOD, &pWords, pDoc.pdispVal, L"Words", 0);
AutoWrap(DISPATCH_PROPERTYGET|DISPATCH_METHOD, &rVal, pWords.pdispVal, "count", 0);
long endVali = rVal.lVal;
i.vt = VT_I4;
for(i.lVal=1; i.lVal<=endVali; i.lVal++) {
VariantCopy(&parm[1], &i);
parm[0].vt = VT_I4;
parm[0].lVal = 1;
AutoWrap(DISPATCH_PROPERTYGET|DISPATCH_METHOD, &rVal, pDoc.pdispVal, L"Words", 1, parm[0]);
wcstombs_s(0, buf, 5, rVal.bstrVal, 512);
::MessageBoxA(NULL, buf, "Word ", 0x10000);
VariantClear(&rVal);
}
}
AutoWrap(DISPATCH_METHOD, NULL, pDoc.pdispVal, L"Close", 0);
AutoWrap(DISPATCH_METHOD, NULL, pWordApp.pdispVal, L"Quit", 0);
// Close the OLE Library...
OleUninitialize();
}
Can someone help debug this code or at least tell me where I can find documentation that show the hierarchy of calls/strings to pass in order to get the information needed from the Word2003 document? Thanks in advance for your help!
wtg3
|
|
|
|
|
I have an ActiveX control for embeding in web page with opbject tag.
Now two problems:
1. I want to load data from internet location(like http://myserver/data.txt) from within ActiveX.
2. Get an IStream object of the data stream
Thanks
|
|
|
|
|
Try to use IBindStatusCallback interface.
|
|
|
|
|
Hai all
I'm using the active desktop Interface to get the current destop item count using the function GetDesktopItemCount(&count,0);
But on my desktop there is more than 10 things and the count value got by GetDesktopItemCount() is '1'.Why is it so.
Please reply.
My OS is XP.
Thanks in Advance
Robs
|
|
|
|
|
The scenario I have is, I have a COM+ application configured with a Role name "Users". I have added "BUILTIN\Administrators" and "myuser" to role "Users". User "myuser" is not a member of "BUILTIN\Administrators".
Now If the application runs under currently logged-in user, IsUserInRole() retuns true for user "myuser".
If the application is running under "myuser", then IsUserInRole() returns false for user "myuser", however if I remove "BUILTIN\Administrators" from role "Users" then IsUserInRole() returns true for user "myuser".
Could anybody please explain this behaviour of IsUserInRole()?
Thanks in advance
Cheers,
Suresh
|
|
|
|
|
Hello,
I'd like to know if it's possible for a JavaScript executed by the browser to send information to a browser helper object (BHO) also running in this browser?
The reason is that I'd like to store the login information (the login functionality is implemented in JavaScript) in my BHO instead of a cookie.
Is something like that possible? By the way, a server-side session based solution is not possible in my case.
Thanks,
Constantin
|
|
|
|
|
|
Use QueryInterface to discover whether the class implements IProvideClassInfo . From there you can discover the type information of the class.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Thanks, but not all objects implement this interface. I need reliable method wich will be suitable for all objects!
ISQ 469907496
|
|
|
|
|
vippavlo wrote: Thanks, but not all objects implement this interface. I need reliable method wich will be suitable for all objects!
You cannot do that!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Why do you need this functionality? If you can share the problem you are trying to solve, folks here can possibly tell you a better solution.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
it's very long story...
i want to save progID in XMLDOM attribute when i have only pointer to interface and than create object using this progid from XMLDOM file.
ISQ 469907496
|
|
|
|
|
vippavlo wrote: it's very long story...
I'll leave it for tomorrow, heading home in few minutes
vippavlo wrote: i want to save progID in XMLDOM attribute when i have only pointer to interface and than create object using this progid from XMLDOM file.
What about COM DLLs that support only DispInterface?
Is this so called pointer passed to you by external application or it's created in your own application?
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
/*What about COM DLLs that support only DispInterface? */
What you mean??
ISQ 469907496
|
|
|
|
|
|
It's you sorry me, maybe i said somthing wrong? because i dont know english perfect - my grammar is bad
I'm know perfect what is mean "IDispatch" ))) I don't understand your question, what you whant to tolk with this words about DDL's - what's problem with DDL's??????
I was not read you last sentence sory ....
It's a component for SDK - it save program settings to XML file and one of parameters can to be an interface and i put into XML properties of this object and want to put ProgID for in future create object using this ProgID.
Now i have this code and it work without some p'roblems, but if some other compiler, VisualBasic for example, generate type lib with another way.... it will not be working.....
Where m_spObj - its smart pointer CCOmPtr, for example...
CComPtr<itypeinfo> spTypeInfo;
UINT uiCount = 0;
GUID guidOfInterface;
hr = m_spObj->GetTypeInfo( 100, LOCALE_SYSTEM_DEFAULT, &spTypeInfo );
TYPEATTR *pattr1 = NULL;
hr = spTypeInfo->GetTypeAttr( &pattr1 );
guidOfInterface = pattr1->guid;
CComPtr< ITypeLib > spTypeLib;
hr = spTypeInfo->GetContainingTypeLib( &spTypeLib, &uiCount );
uiCount = spTypeLib->GetTypeInfoCount();
CLSID clsidOfCoclass;
for( UINT i = 0; i < uiCount; i++ )
{
CComPtr< ITypeInfo > spTI;
hr = spTypeLib->GetTypeInfo( i, &spTI );
TYPEATTR *pattr = NULL;
hr = spTI->GetTypeAttr( &pattr );
if( pattr->typekind == TKIND_COCLASS )
{
clsidOfCoclass = pattr->guid;
}
if( pattr->typekind == TKIND_DISPATCH )
{
if( guidOfInterface == pattr->guid )
{
CComBSTR bsCLSID;
ProgIDFromCLSID( clsidOfCoclass, &bsCLSID );
m_bsProgIDName = bsCLSID.Detach();
spTI.Release();
spTypeLib.Release();
spTypeInfo.Release();
return S_OK;
}
}
spTI.Release();
}
spTypeLib.Release();
spTypeInfo.Release();
return hr;
ISQ 469907496
|
|
|
|
|
vippavlo wrote: It's a component for SDK - it save program settings to XML file and one of parameters can to be an interface and i put into XML properties of this object and want to put ProgID for in future create object using this ProgID.
Now i have this code and it work without some p'roblems, but if some other compiler, VisualBasic for example, generate type lib with another way.... it will not be working.....
I think you should be allowed to insist that such objects support an appropriate IPersist interface. I recall that the plain IPersist interface has just one method which returns the class ID.
The reason that you can't use the type info for this is because there can be any number of COCLASSes in the type library that implement the interface. There is no provision for doing what you want in that case.
Nathan
|
|
|
|
|
Hi All
I need to know how i can to have the all id controls (HTML Controls) in the Page by using javascript
how can help me
thanks for any body help me
Thaer
|
|
|
|
|
Please do not cross post. Choose appropriate forum.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|