|
|
I am trying to hide the scrollbar(s) in a CHtmlView without success. I have tried the following:
In PreCreateWindow:
cs.style ^= WS_VSCROLL;
In OnInitialUpdate:
ModifyStyle(WS_VSCROLL,0);
and
ShowScrollBar(SB_VERT,false);
and
CScrollBar* pSB=AfxGetMainWnd()->GetScrollBarCtrl(SB_VERT);
returns NULL
as do
CScrollBar* pSB=GetScrollBarCtrl(SB_VERT);
What is the correct way of doing this?
Thank you in advance!
|
|
|
|
|
As far as a know you cannot do that, because the scroll bar belongs to the WebBrowser control . For details about hosting MSHTML you should check for IDocHostUIHandler , IDocHostShowUI interfaces ( or something like that ) in Internet Dev. SDK
|
|
|
|
|
You need to get a pointer to the internal document of the view and set its scroll to 'no'.
___________
Klaus
[www.vbbox.com]
|
|
|
|
|
Thank you for the answer.
I still don't know how to get the pointer to the internal document and set its scroll. Could you present the lines of code necessary to do that?
|
|
|
|
|
The Webbrowser control queries the
application COleControlSite for an interface
called XDocHostUIHandler.
Get the 'driller' sample from msdn which
implements this control.
If it founds it, it calls the method GetHostInfo(DOCHOSTUIINFO* pInfo );
In there, you have to put the following code:
pInfo->dwFlags = DOCHOSTUIFLAG_SCROLL_NO;
XDocHostUIHandler is good for setting other properties
of the control and also for disable or replacing the
context menu of the browser.
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
Thanks a lot. This solved my problem. I only had to orverride CHtmlView::OnGetHostInfo(). FYI, here is all the code I had to add:
HRESULT CYourView::OnGetHostInfo(DOCHOSTUIINFO* pInfo)
{
pInfo->dwFlags = DOCHOSTUIFLAG_SCROLL_NO;
// default indicates we don't have info
return S_OK;
}
|
|
|
|
|
I didn't know that CHtmlView had that fuction.
I was ready to use other way in an application,
but this is much more simple.
Thanks for mention it.
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
|
|
|
|
|
Hi,
I am trying to Blt an 8-bit surface onto the primary surface (in a windowed program), but it doesn't show up... Is it possible with DirectDraw to draw a surface with one bit depth onto another with a different bit depth?
Thanks,
Erik Hammar
|
|
|
|
|
I suggest you to check your return value from your Blt-call.
Or perhaps are you tring to flip surfaces?
-
|
|
|
|
|
Hi, I wan't to create a dynamic array of MSXML::IXMLDOMNodePtr,
I need to cache pointers to xml tags so I can keep track of them.
The problem is I can't just make it compile, I tried all kinds of arrays,
like CArray, CPtrArray and CTypedPtrArray. Using MSXML::IXMLDOMNodePtr
otherwise works fine, just declaring arrays of them is not.
Anyone knows how to declare one? It works fine using an old C-style array, that is:
MSXML::IXMLDOMNodePtr a[10];
but I would prefer a dynamic MFC array instead.
thanks, Patric
|
|
|
|
|
Have you tried the *real* array classes, i.e. std::vector ? I dunno why the others didn't work, but it might be worth trying the real thing...
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Could you post the compiler error messages?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
It's because _com_ptr_t ( the XXXPtr smart pointer you are using ) overrindes both * and & pointer operators. Use ATL's CSimpleArray instead of MFC's CArray.
|
|
|
|
|
... or use CAdapt?
___________
Klaus
[www.vbbox.com]
|
|
|
|
|
Thanks for the help, yes, the STL class vector works fine for storing IXMLDOMNodePtr, Patric
|
|
|
|
|
How would i go about implementing a RichEdit app for WinCE or PocketPC?
.NET or not .NET? MFC is the question......
|
|
|
|
|
Guys,
Is there an api that sends a file over the network between two computers using their computer names. Can someone give me guidance on how to do this.
Regards,
SAK
|
|
|
|
|
In C++, you would use CSocket class or a derivative.
One application would be the server, and listen for client(s) to connect on a given port.
The other app would be the client(s) and try to connect to a server by name and port.
Hint: if you are testing on 1 pc, hostname of "loopback" is valid.
Once a connection has been established, the client opens and Sends the file, and the server's Receive handles the incoming data packets, writing them to a file.
I suggest reading the online help on sockets.
There are also user-written wrapper classes for sockets you could examine.
|
|
|
|
|
Rick,
Thank you for the help, I was pretty sure I needed to use sockets (something I am not familiar with) but was hoping there was an API for this. Anyways, I am going see if I can learn how to use sockets. Thanks again for the response.
|
|
|
|
|
There is an API that uses the Windows File Manager (or how they call it) that can copy files or directories to a remote computer over the network, if it has a shared directory with full rights. E.g. it will copy the file to \\Destination_Comp\Directory\. If you are interested, I can tell you how it works.
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
TCHAR pszFrom[1024] = {0};
TCHAR pszTo[1024] = {0};
SHFILEOPSTRUCT shfo;
GetDlgItemText( IDC_SOURCE, pszFrom, 1024);
GetDlgItemText( IDC_DEST, pszTo, 1024);
ZeroMemory(&shfo, sizeof(SHFILEOPSTRUCT));
shfo.hwnd = AfxGetApp()->m_pMainWnd->m_hWnd;
shfo.wFunc = FO_COPY;
shfo.pFrom = pszFrom;
shfo.pTo = pszTo;
shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT;
SHFileOperation(&shfo);
This is how it works for me you can see more detailed info about SHFILEOPSTRUCT in the MSDN online reference...
If any questions, do not hesitate to ask...
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
Hello my name is Robert and I have a question about the visual c++ 6.0, I make a soft, that works
fine, but the problem is that it doesn't run under windows nt, could you tell me what can I do
to make that the soft run under windows nt.
Thanks for all.
|
|
|
|
|
The online help for each method describes which headers and libraries are required. Quite a few are different for NT than 9x.
You could create a new Build configuration for NT, and include the required libraries. That way you could still build for 9x and test.
|
|
|
|
|
OK... I had a program (originally written using VC 6.0) that, as part of its function, retrieves values from an open Internet Explorer window. However, when I compile the SAME EXACT code that works in VC6 in VS.NET, the retrieve function fails.
In the code, once I get the IE window, I check for frames:
IDispatchPtr dis;
IHTMLDocument2Ptr doc;
spBrowser->get_Document(&dis); //spBrowser is earlier declared and initialized
dis->QueryInterface(&doc);
IHTMLFramesCollection2* frames;
long num;
doc->get_frames(&frames); /* THIS IS THE PROBLEM
if (frames == NULL)
///failed
else
{
....
}
In VC6, the get_frames function returns a valid address everytime, whether it is a framesize of 1, or 2 or whatever...
However, when compiled in VS.NET, 'frames' ALWAYS ends up NULL.
What would cause this?
I am using the VS.net Beta 2. Is this a known problem that is fixed in the final release? Is there a solution??
Or is the problem something else entirely?
This was tested and confirmed using both IE5.5 and IE6.
Thanks!
Adam
cabadam@houston.rr.com
|
|
|
|