|
Hi all,
Is there any way to get the handle to menu window in internet browser window?
I want to disable some menu items in File,Edit,View. I am using VC6.0 and Win2k.
Thanks in advance,
Abhishek
|
|
|
|
|
I'd like to have data file with many strings and load them at once using MapViewOfFile[Ex] and unload with UnmapViewOfFile. So I wouldn't have to allocate memory for each string on heap.
How can I use basic_string<> or CStringT attaching them to pointer to string within mapped space so they wouldn't copy that string to internal buffer?
--
Alvin777
|
|
|
|
|
|
Hi all,
Who and when IDocHostHandler::ShowUI() is invoked?.
I wish to know whether this function gets invoked before loading webpage?
Thanks in advance,
Abhishake
|
|
|
|
|
I am trying to read an html page and retrieve the value of three hidden input fields sure as:
<input name=port type=hidden value=1500>
VC++6.0/ATL/BHO -- Below is the code I am working with to read in the value (1500) but it is not working. I think i am missing something.
HRESULT hr;
TCHAR sPort[25];
IDispatch* pElemDisp = NULL;
IHTMLInputHiddenElement* pElem = NULL;
IHTMLElementCollection *pElemcoll;
// Get the WebBrowser's document object
CComPtr<IDispatch> pDisp;
HRESULT hr = m_spWebBrowser2->get_Document(&pDisp);
if (FAILED(hr)) return false;
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTML;
spHTML = pDisp;
_variant_t tagName("input");
_variant_t tagNamePort("port");
BSTR* pValuePort = NULL;
spHTML->get_forms(&pElemcoll);
hr = pElemColl->tags( tagName, &pElemDisp );
if ( SUCCEEDED(hr) )
{
hr = pElemDisp->QueryInterface( IID_IHTMLInputHiddenElement, (void**)&pElem );
if ( SUCCEEDED(hr) )
{
hr = pElem->get_value(pValuePort);
if ( SUCCEEDED(hr) )
{
//Set port
_stprintf(sPort, _T("%s"), (LPCTSTR)pValuePort);
m_sPort = (int)sPort;
}
pElem->Release();
}
pElemDisp->Release();
}
//at this point m_sPort is NULL not 1500
I think I may not be handling the Element Collection object correctly. Any pointers as to where i am going wrong?
Thank you for any help you can give..
|
|
|
|
|
Have you stepped through with the debugger? Which line in there is failing?
If you just look at m_sPort after it's done, you can't tell which call fails.
Once you figure that part out, you need to fix your string handling. You don't pass a BSTR* to get_value() , you pass the address of a BSTR so that get_value() can store the return value in it:
BSTR bsValuePort = NULL;
hr = pElem->get_value ( &bsValuePort );
SysFreeString ( bsValuePort ); Then, casting a BSTR to a LPCTSTR will do you no good in an ANSI build. Nor will casting a char array to an int . Assuming m_sPort is a CString , You can just write:
m_sPort = (LPCWSTR) bsValuePort; and let the CString constructor do the conversion.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
You cannot stop me with paramecium alone!
|
|
|
|
|
I have a problem on building the "Hello World" project after converting it to Visual Studio .NET 2003. The build log:
Build Log ------- Build started: Project: HelloWorld, Configuration: Debug|Win32 -------
Command Lines Creating temporary file "f:\Samples\WebFeatures\HelloWorld\Debug\RSP000001.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLOWORLD_EXPORTS" /D "_WINDLL" /FD /EHsc /MTd /Fp".\Debug/HelloWorld.pch" /Fo".\Debug/" /Fd".\Debug/" /W4 /c /ZI /TP /Bv /Bt /Wp64
.\HelloWorld.cpp
]
Creating command line "cl.exe @f:\Samples\WebFeatures\HelloWorld\Debug\RSP000001.rsp /nologo"
Creating temporary file "f:\Samples\WebFeatures\HelloWorld\Debug\RSP000002.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HELLOWORLD_EXPORTS" /D "_WINDLL" /FD /EHsc /MTd /Fp".\Debug/HelloWorld.pch" /Fo".\Debug/" /Fd".\Debug/" /W4 /c /ZI /TP /Bv /Bt /Wp64 /Bv /Bt /Wp64
.\StdAfx.cpp
]
Creating command line "cl.exe @f:\Samples\WebFeatures\HelloWorld\Debug\RSP000002.rsp /nologo"
Output Window Compiling...
Compiler Passes:
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe: Version 13.10.3077.0
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\c1.dll: Version 13.10.3077.0
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\c1xx.dll: Version 13.10.3077.0
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\c2.dll: Version 13.10.3077.0
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe: Version 7.10.3077.0
D:\Program Files\Microsoft Visual Studio .NET 2003\Common7\ide\mspdb71.dll: Version 7.10.3077.0
HelloWorld.cpp
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsocket.inl(26) : error C3861: 'FreeAddrInfo': identifier not found, even with argument-dependent lookup
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsocket.inl(42) : error C3861: 'FreeAddrInfo': identifier not found, even with argument-dependent lookup
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsocket.inl(52) : error C2039: 'GetAddrInfo' : is not a member of 'operator``global namespace'''
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsocket.inl(52) : error C2660: 'ATL::CSocketAddr::GetAddrInfo' : function does not take 4 arguments
time(D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\c1xx.dll)=11.947s
Results Build log was saved at "file://f:\Samples\WebFeatures\HelloWorld\Debug\BuildLog.htm"
HelloWorld - 4 error(s), 0 warning(s)
Anyone has the experience in this kind of problem please give me some advice.
Thanks in advance.
Regards,
Hoa
|
|
|
|
|
Make sure you have included:
Ws2tcpip.h
and have added
Ws2_32.lib to the linker
|
|
|
|
|
Thanks Jörgen,
It worked for me, again thanks.
Abhishake
|
|
|
|
|
Hi All,
I am trying to Implement a "Simple Object" interface through ATL Object Wizard. But i am wondering there is no option of
IObjectWithSite (IE object support) in the ATL Object Wizard dialog, I am using VC6.0.
Is this option avaiable only with VC7.0 because i know lot of people talk about that, also MSDN doc listed this interface in the
support list for simple object.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcurfattributesatlsimpleobjectwizard.asp[^]
Also I have another question.
If i derived a interface from two interfaces (IObjectWithSite ) and (IDocHostUIHandler). the complier gives me following
error
I have following code
<br />
class ATL_NO_VTABLE CtempInterface : <br />
public CComObjectRootEx<CComSingleThreadModel>,<br />
public CComCoClass<CtempInterface, &CLSID_tempInterface>,<br />
public IConnectionPointContainerImpl<CtempInterface>,<br />
public IDispatchImpl<ItempInterface, &IID_ItempInterface, &LIBID_TESTTHISLib>,<br />
public IDocHostUIHandler
{<br />
};<br />
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1827) : error C2259: 'CComObject<class ctempinterface="">' : cannot instantiate abstract class due to following members:
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" ctempinterface=""> >::CreateInstance(void *,const struct _GUI
D &,void ** )'
Can anyone help me?
Thanks
Abhishake
|
|
|
|
|
It means you have not implemented at least one of the interfaces member functions. If you have done that already, make sure your functions share the same type signature as defined in the interface. Remember that void function(int x) is not the same function as void function(long x).
The compiler should tell you which function that aren't implemented. Look closer at the error output.
--
Meine Welt ist monoton und minimal, doch ganz total!
|
|
|
|
|
Havent we had enough of this abomination? I have ceased to use ATL for my components. (As if this was not enough, along comes ATL server).
|
|
|
|
|
Mome on, people, nothing to see here, it's just a troll...
Perl combines all the worst aspects of C and Lisp: a billion different sublanguages in one monolithic executable. It combines the power of C with the readability of PostScript. -- Jamie Zawinski
|
|
|
|
|
I certainly haven't. Was it too hard for you to understand how it works?
--
Meine Welt ist monoton und minimal, doch ganz total!
|
|
|
|
|
ATL is more than a beauty!!! I hope you must take rest for 2-3 days and come back on your codes, this happens usually when we dont get results , EITHER ourself or on CP!!!
ENJOY
Balkrishna Talele
|
|
|
|
|
with respect to my previous query, i decided to use the WMPplayer control to implement the server-client. that will mean that the activeX control will be passed as a parameter from the client to the ATL COM server interface. Now i have problem compiling the IDL file generated by the ATL wizard because of the the activeX control parameter. what files or lib must i #include or import to make the compiling of the IDL file possible? i ever tried using ADO and i needed to include the msado.dll file. thanks. would be great if anyone can direct me a book or website which lists such information for my ease in future.... thanks a million in advance.
|
|
|
|
|
Hi!
With CreateFromFile() I am able to open an excel file in my ole
container application.
I want to embed excel sheet in my container applicatio and want to
display contents of a file, but i dont want to use CreateFromFile(), I
just want to pass raw data as input.
Which function shall I use,CreateFromClipboard() or CreateFromData().
I am running in Win2k and have office2k.
Thanks
Anshu
|
|
|
|
|
You are talking about MFC functions, right ?
If you want to paste object from clipboard then use CreateFromClipboard, otherwise CreateFromData.
All the CreateFromClipboard is doing is getting data object from the clipboard and passing it to "CreateFromData".
Edward.
|
|
|
|
|
Thanks for the response.
Yes I am talking about mfc functions.
What I want to do is,display the .xls file in the container without using CreateFromFile().I want to read the file with CreateFile() and then send that data to display in the container.I hope u got my problem.
|
|
|
|
|
Hi everybody,
How do I support COM+ services (not the old version, MTS) in an ATL 3.0 project?
I don't plan to use ATL 7.0 or Visual Studio .NET.
Regards,
Roozbeh.
Dear friends!
I mean which libraries, I must include in my project. for example when you create an ATL 3.0 project with the server type of 'Dynamic Link Library' you have the 'Support MTS' option and choosing it, causes to include proper libraries in the project. But I want to include new COM+ libraries instead of the old version MTS libraries.
thanks.
|
|
|
|
|
When you say 3.0, I assume you mean VC6?
Should be no problem. You can optionally implement additional interfaces like IObjectConstruct etc so you can see things like constructor strings, but it's not really any more difficult than writing COM components. However, you might want to look closely at your design, to see where you can benefit from stateless objects and JIT activation.
Steve S
|
|
|
|
|
(I dunno, these people that edit questions afterwards...)
AFAICR, 'use MTS' just adds some mts related libs (mtx,mtxguid and a delayload for mtxex.dll), does an mtxrereg of your DLL after a build.
I believe MTS only supports apartment threading, but someone who knows these things will be along to correct me in a while), whereas COM+ can handle free threaded stuff quite happily, and in fact, apartment threading will cause bottlenecks.
There are no libs per se (and yes, where I am, we have lots of COM+ stuff written using VS6...)
Steve S
|
|
|
|
|
I want to expose a user defined data type (struct) to clients using ATL. I also wanted this struct to be a parameter to one of my methods. Is there a way in which I could do this?
SDE
|
|
|
|
|
If your class is foo and the structure is public or accessible to the calling object:
class foo
{
public:
struct myStruct
{
int a;
int b;
} myStruct;
void UseFooStruct(myStruct s);
}
class bar
{
public:
void UseFooStruct(foo::myStruct s);
}
|
|
|
|
|
I think I must have phrased it wrong. I know what you mean. But what I wanted is to expose the struct to one of my interfaces, then be able to pass the struct from Visual basic to My VC++ COM object. Is this possible?
SDE
|
|
|
|