|
Hello,
I have the following problem:
I'm saving and reading certain types of SafeArrays. Until now I relied among other things to SafeArrayGetVarType. I tested things with SafeArrayCreateVector and everything worked fine. Now, few months later I begin to get safeArrays created with SafeArrayCreateVector that don't have FADF_HAVEVARTYPE set (Feature flag is 0x2000). I have some hints that something updated my OLEAUT32.dll but I don't know what. I tried to use both SafeArrayCreate and SafeArrayCreateVectorEx, and with them I get feature flag that has only FADF_HAVEVARTYPE set - as it used to be - with one discrepancy from MSDN documentation. MSDN says (SafeArrayCreateVectorEx): "The FADF_HAVEIID can be set for VT_DISPATCH or VT_UNKNOWN and FADF_HAVEVARTYPE can be set for all other types."
But when I try to add FADF_HAVEVARTYPE to vt parameter of SACreateVectorEx the array isn't created at all - if I leave vt as it was array is created and has the correct vartype set.
Does anybody know which version of OLEAUT32.dll changed behaviour of SACreateVector? And what can I do without requesting that all of my clients use SACreateVectorEx or SACreate instead of SACreateVector?
|
|
|
|
|
I created an ATL project and inserted into it a Composite Control Object.
It works fine , but need to read some info from the browser specified in the
OBJECT tag
<object>
...
...
<param name="MyValue" value="123" />
How I read the MyValue from my ATL Composite Control?
xxx
|
|
|
|
|
I created an ATL project and inserted into it a Composite Control Object.
It works fine , but need to read some info from the browser specified in the
OBJECT tag
<object>
...
...
<param name="MyValue" value="123"
<="" object="" />
How I read the MyValue from my ATL Composite Control?
xxx
|
|
|
|
|
in a COM object,the class implement some interface can have
a destruct function?
when the destruct fuction is executed?
|
|
|
|
|
Yes it can. The destructor is called when you delete the object - if you use "new / delete" operators for dynamic allocated objects or when the object goes out of scope, for local objects.For example if you implement "Release" from IUnknown like this :
ULONG MyObject::Release()
{
if( -- m_dwCount == 0 )
{
delete this; //here
}
return m_dwCount;
}
the destructor will be called at "delete this".
|
|
|
|
|
Has anyone ever used IHTMLBrowser (and everything underneath it like IHTMLDocument2 etc etc
I'm trying to strip out href's etc from a webpage... but i cant seem to get past the part of getting the elements out of an IHTMLElementCollection!!!
any help?
(i've found some stuff... but only to get the IHTMLElementCollection - so far anyways, i'm still looking)
~Timothy T. Rymer
www.digipen.edu
tim.xpertz.com
|
|
|
|
|
This help?
<br />
CComPtr<IDispatch> pDisp;<br />
if( SUCCEEDED(m_pBody->get_all(&pDisp)) && pDisp)<br />
{<br />
CComQIPtr<IHTMLElementCollection> pColl(pDisp);<br />
if(pColl)<br />
{<br />
long lCount;<br />
if( SUCCEEDED(pColl->get_length(&lCount)) && lCount > 0 )<br />
{<br />
pDisp.Release();<br />
CComVariant varName, varIndex(lCount);<br />
pColl->item(varName, varIndex, &pDisp);<br />
<br />
CComQIPtr<IHTMLElement> pElement(pDisp);<br />
if(pElement)<br />
pElement->insertAdjacentHTML(A2OLE("beforeEnd"), A2OLE(strElement));<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Ok, here's the weird thing, I CANNOT EVER get anything back from IHTMLLinkElement or IHTMLAnchorElement when i need it to.
I get:
IHTMLDocument2, in which i call "get_links" to give me
IHTMLElementCollection, which in turn, gives me NOTHING.
I'm using http://www.yahoo.com cuz we know there's about a gajillion links right there, but if i try to pick up all the tags from get_body, i'll only get back like 15 (or 11 when i tried using the CComPtr's instead...)
If anyone knows of a tutorial, or anything like that, let me know! or any article on codeproject.com - i found something on codeguru.com, but it just wasnt what i needed.
i am STUCK.
~Timothy T. Rymer
http://www.digipen.edu
http://tim.xpertz.com
http://www.ttrx.com (index is UP!)
|
|
|
|
|
Tim Rymer wrote:
IHTMLDocument2, in which i call "get_links" to give me
IHTMLElementCollection, which in turn, gives me NOTHING.
Seems that get_links returns only named links. You should try get_all, and then distinguish between them with get_tag. I know an example in VB:
A VB example
I vote pro drink
|
|
|
|
|
wurd
~Timothy T. Rymer
www.digipen.edu
tim.xpertz.com
|
|
|
|
|
How can I scroll down the html page, by vc++ code?
Thank you
Chagit
|
|
|
|
|
Hello Everybody ,
I created an Application (ATL COM EXE ) in Windows CE Platform Builder.
On executing it , i faced with an exception
"First Chance exception in ole32.dll
0xC0000005 Access Violation "
I would like to know the reason for the failure and How to solve the Problem.
Thanks in Advance
Regards
Maria
MailTo :mariajothi@sdsindia.com
Maria Jothi (Software Engineer)
MAIL-ID:maria_jothi@hotmail.com
|
|
|
|
|
Check for memory violations : bad function parameters ( when you do marshalling - NULL BSTR's and so on), bad interface pointers ( the object is destroyed but you still use some of his intrefaces). Use the ATL's debugging support - define _ATL_DEBUG_INTERFACES , _ATL_DEBUG_REFCOUNT, etc.
|
|
|
|
|
Hi,
in these cases I allways look into marshalling problems, or some wrong variant handling stuff, or wrong work with some BSTR types
Not very helpful, but this is the way I'm going when exception in ole32.dll occurs and in 95% I succeeded.
georgem
|
|
|
|
|
i'm calling m_spBrowser.Navigate() in my Lite HTML Control, and it opens up the website in a real IE Browser! How do I view the page right there in the control????
~Timothy T. Rymer
www.digipen.edu
tim.xpertz.com
|
|
|
|
|
i had the Lite HTML Control set to _SELF - which doesnt mean "itself" it means "new window"...
~Timothy T. Rymer
www.digipen.edu
tim.xpertz.com
|
|
|
|
|
Hey, i'm making a Selection Object (IHTMLSelectionObject) and i'm trying to call .createRange(IDispatch**) but it says to just pass in a IHTMLTxtRange object but it's not picking up the derived IDispatch, i've never really messed with HTML objects in general, so any advise as to why it says that I cannot pass in an IHTMLTxtRange object... i dont know.. just kinda lost really.. (i'm trying to make something where i can cycle through certain keywords and bringing up a menu on what to do with these keywords) but i want to stick with C++ and i wont be able to edit HTML tags and such as most "examples" show... I dont know.. i'm just kinda out there today so speak slowly! haha
Thanks,
~Timothy T. Rymer
http://www.digipen.edu
http://tim.xpertz.com
http://www.ttrx.com (not up yet)
|
|
|
|
|
it's cool...n/m
~Timothy T. Rymer
www.digipen.edu
tim.xpertz.com
|
|
|
|
|
haha yeah...
~Timothy T. Rymer
www.digipen.edu
tim.xpertz.com
|
|
|
|
|
yep.
~Timothy T. Rymer
www.digipen.edu
tim.xpertz.com
|
|
|
|
|
Hi,
this is not meant to make you feel more embarrased and probably you already have solved this problem. ANyway, recently, I was doing something quite similar and just comparing notes with you -
//m_spDoc is the smart pointer to IHTMLDocument2 that
//represents the current webpage loaded in the browser. I
//too am trying to get the selection text and figure out
//the element position and element tagname.
IHTMLSelectionObject *sel;
CComQIPtr < IHTMLTxtRange, &IID_IHTMLTxtRange> tRange;
CComPtr < IHTMLElement> element;
hr = m_spDoc->get_selection(&sel);
if (FAILED(hr))
return;
CComBSTR type;
hr = sel->get_type(&type);
if (FAILED(hr))
return;
if (type == OLESTR("None"))
return;
CComPtr < IDispatch> ppDisp;
hr = sel->createRange(&ppDisp);
if (FAILED(hr))
return;
tRange = ppDisp;
CComBSTR bstr;
hr = tRange->get_text(&bstr);
if (FAILED(hr))
return;
if (bstr.Length() == 0)
return;
bstrText = bstr;
Wow!! do you study at digipen or teach there? Being an amateur game coder(yeah! I fiddle around with DX too!!) it's been a dream to get to learn game programming at digipen, but somehow couldn't afford it!!
sonork: 100:18407
|
|
|
|
|
Hi,
I can pass VARIANT to this method :
STDMETHODIMP Cwr::callWRrtf(VARIANT vTempArray,BSTR* output)
{AFX_MANAGE_STATE(AfxGetStaticModuleState())
VARIANT *rgv1;
SafeArrayAccessData(vTempArray.parray,(void**)&rgv1);
...
with this VBasic client :
Dim v2(1) As Variant
v2(0) = "some string"
res = myDLL.callWRrtf(v2)
but i want to do this in VBScript. Is it possible ? How ? I tried but
it doesn't work ....
Thanks
David
David D.
|
|
|
|
|
I'm guessing you wrote your COM DLL in ATL? Obviously you're COM DLL was written as an in process Single Threaded Apartment using an interface derived from IDispatch? These are some of the rules for dealing with script code, ie, on web pages.
There's many, many, many other unwritten rules. However, a few of them are:
1) If you are passing IN string data you MUST use BSTR as your type.
2) If you want string data OUT you MUST use VARIANT. Yeah, you'd figure that BSTR* would get you what you want but the unfortunate truth is while it may work occasionally, it will get you 9 times out of 10 and when you least expect it. Even using BSTR* as your [out,retval] won't always work. Instead make it just another parameter, [in] VARIANT* and return a succeed/fail as the return value so you know if the data was any good.
So, in this case it looks like you want to use VARIANT's in both parameters though I'm not sure but data is being passed in (or out) from your VARIANT object. On the other matter, VBScript is ALL variant data. If you simply ignore the type it should work fine.
|
|
|
|
|
Hi,
I have some problems with my application and need some help on it. That is the problem: I have a macro running on a MSWord document, and this macro calls some components (DCOM) that i've made. Once Visual C++ were instaled on the machine (either if it was removed) no problem occurr. But else it causes a fatal error that closes the MSWord (Winword.exe). I think , it install some dll's that resolves this problem, but I don't know wich to install.
My components uses ATL Dialogs, where I think the problem is. I use Install Shield to install my application and if there's some way to do with this tool may be helpful.
YVS
|
|
|
|
|
Check to see if ATL.DLL was installed on these machines before you installed VC++.
If not, you need to register that DLL also when you install your application.
(This is a common problem with Windows 95)
- Greatest invention : "The Microchip!"
|
|
|
|