|
Dear all,
Does anyone know whether a MFC program can get the URL at the activating
Internet Explorer or not? If yes, how can I get the URL?
Thanks a lot!
Vickie
|
|
|
|
|
http://codeguru.earthweb.com/ieprogram/enumIE.html
good luck,
Dror
|
|
|
|
|
I have a dialog based app and when I call ShowWindow(SW_HIDE) it hides the window and removes the taskbar button. I need a way to keep the taskbar button there even though the window is hidden.
Any ideas?
Thanks
Peter Papanikolaou
|
|
|
|
|
instead of hiding the window, remember it's position and move it offscreen.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
The problem with your solution is, what if a user has multiple monitors?
You might be moving the window right onto another screen, not exactly what you had in mind.
|
|
|
|
|
I have two monitors myself, it is possible to enumerate them and thus make sure you move the window outside their bounds. But I admit your suggestion of minimising is more obvious, more elegant and generally less of a hassle.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Why don't you just minimize it instead?
|
|
|
|
|
minimize only
or
what about taskbar-tray icon?
|
|
|
|
|
I have a dialog based app and when I call ShowWindow(SW_HIDE) it hides the window and removes the taskbar button. I need a way to keep the taskbar button there even though the window is hidden.
Any ideas?
Thanks
Peter Papanikolaou
|
|
|
|
|
With CRecordSet and Memo AssertionFailed when
CString > 255 characters and < 65535 characters into Memo
The memo type get max 65535 characters in Access.
Why??
|
|
|
|
|
There's a new feature in VC6 that adds a length param to RFX_Text - it defaults to 255. Class wizard doesn't know about it.
You might try revising the DoFieldExchange code to add this fourth parameter:
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Long(pFX, _T("[ID]"), m_ID);
RFX_Text(pFX, _T("[Name]"), m_Name);
RFX_Text(pFX, _T("[Notes]"), m_Notes, 32768);
|
|
|
|
|
Hello all,
I've written a dialog based application that uses several bitmap images on them. I wrote the application with a high resolution (1280 x 1024). Now I'm testing the application on machines with lower resolutions and all of the bitmap pictures don't correctly line up with the components on the form! Shouldn't the images increase/decrease with changes in the screen resolution at the same rate as other form components? It makes the form look really unprofessional, so I would like to figure out a fix for this. Thanks in advance!
--Tale
|
|
|
|
|
No, bitmaps do not automatically scale. How are you placing them ? In your OnPaint, or in a bitmap holder static ? Either way, it would appear you need to write some code to size them according to the size of the other objects on your dialog.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I'm placing them using a static control. Can you explain the best way to resize the bitmaps? What method do I adjust the bitmaps in?
--Tale
|
|
|
|
|
Hello, can anyone help a beginner in c++? I want to create a database using DAO, accessing data from Microsoft Access. I'm using visual 6, and Microsoft Access 2000. I've done the tutorials using stdreg32.mdb but obviously I want my own data, fields, tables etc. But everytime I create a new database saved as .mdb and I try to create my own exe using the appwizard it just won't accept it, I've tried registering it, I tried the stdreg.exe program. I just keep on running up against walls. Can anyone help me. Please.
Crusty
|
|
|
|
|
Crusty,
I think you will have much less headaches when you do not create a 'bound' MFC application, app created with app wizard that connects to a DAO database.
You will be better off creating and handling your own CDAODAtabase, CDAORecorset, CDAO..., objects. This way you have control what you want to connect to and what to use at run time. Also the CDAODatabase object contains abilities to create a Access database.
Peter
|
|
|
|
|
First, I'm sorry for my English.
Now, I have really big problem for me!
I have two kind of source.
First one is coded with C(which one uses singlethread), and second one is coded with C++( MFC )--(which one uses Multithread).
What I did to make one application, I just open new project with Visual C++, and making a dialog box, some buttons, and just include C codes.
And, I had many Errors! So, I added some statement to use C code in MFC ( extern "C" ... )
But, and then I had real problem.
That is different kind thread can not be use for one application......
So, this is my problem.
How can I solve this problem?
Or, is there any way to make one application with two kind of codes?
please answer me..
|
|
|
|
|
Every C statement in existance is valid C++, so I'd suggest this was not the problem. You should probably put up some code or an example of the sort of errors you are having, it's impossible to give specififc advice without specific problems to solve.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Er, with the addition of stronger type checking of parameters to functions in C++. This can result in a lot of casting patches when compiling C code in C++.
|
|
|
|
|
Hello!
I'm developing a very simple application (using MFC) which all it does is show a splash screen, launch and configure the Internet Explorer UI (I'm using IWebBrowser2 to do that). Now my problem is that i need to eliminate IE's accelerator keys, so that the user can't insert a URL pressing CTRL+O. I would also like to disable IE's right-button pop-up menus. As far as I can see the IWebBrowser2 interface doesn't provide
this kind of functionality.
Can you please, give me some advise on how can this be done?
Thank you very much!
Luís Teixeira
|
|
|
|
|
Hello!
I'm developing a very simple application (using MFC) which all it does is show a splash screen, launch and configure the Internet Explorer UI (I'm using IWebBrowser2 to do that). Now my problem is that i need to eliminate IE's accelerator keys, so that the user can't insert a URL pressing CTRL+O. I would also like to disable IE's right-button pop-up menus. As far as I can see the IWebBrowser2 interface doesn't provide
this kind of functionality.
Can you please, give me some advise on how can this be done?
Thank you very much!
Luís Teixeira
|
|
|
|
|
You have to implement an object that intercept the events from IWebBrowser2. This interface is DWebBrowseEvents(2). This object - I call it sink dispatcher - must implement the interface IDocHostUIHandler. This interface has a method called TranslateAccelerator. Implement this interface leaving all other interface specific method to return E_NOTIMPL ( = "do default") and TranslateAccelerator returning S_OK ( = "let me do it, do NOT do the default"). For disabling popup menus, you have also to implement the ShowContextMenu method (of the same interface) by simply returning S_OK instead of E_NOTIMPL that will let IE to handle the context menu. But first of all you have to get the IWebBrowser2 object (this is simple, since you are telling that the project is MFC) and to call Advise to let your dispatcher object to do the job (that is, in more cases, to return E_NOTIMPL ).
So: I suppose you have a dialog where the WebBrowser control is incapsulated. I can tell you how to eliminate also the resources and to create dynamically the whole stuff.
1) Create a window. [optional, but maybe you want a toolbar, a status bar etc.]
2) Create a dialog (encapsulated in that window, if you did (1)).
3) Implement an interface derived from DWebBrowserEvents2 (let's call it ISinkDispatcher);
4) Implement an interface derived from IOleClientSite, IOleInPlaceSite (optional) and IDocHostUIHandler (for you, mandatory);
5) in OnInitDialog of your dialog, do this (the OLE API way, I don't use MFC a lot):
BOOL
WebBrowser_OnInitBrowser(HWND hWnd)
{
IStorage *pStorage = (IStorage *)NULL;
ILockBytes *pLockBytes = (ILockBytes *)NULL;
IWebOleClientSite *pWebOleClientSite = (IWebOleClientSite *)NULL;
IOleObject *pOleObject = (IOleObject *)NULL;
pWebOleClientSite = new IWebOleClientSite(hWnd);
LPWEBDIALOGDATA lpWebDlgData = (LPWEBDIALOGDATA)GetWindowLong(hWnd, DWL_USER);
lpWebDlgData->pWebOleClientSite = pWebOleClientSite;
CreateILockBytesOnHGlobal(NULL, TRUE, &pLockBytes);
StgCreateDocfileOnILockBytes(pLockBytes,
STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_READWRITE, 0, &pStorage);
OleCreate(CLSID_WebBrowser, IID_IOleObject, OLERENDER_DRAW, NULL,
pWebOleClientSite, pStorage, (LPVOID *)&pOleObject);
pWebOleClientSite->m_pIOleObject = pOleObject;
pWebOleClientSite->m_hWndOwner = hWnd;
pWebOleClientSite->ConnectEvents();
pWebOleClientSite->Show();
pOleObject->Release();
pStorage->Release();
pLockBytes->Release();
return TRUE;
}
(The error handling is for you).
6) ConnectEvents should get the IConnectionPointContainer interface of the IWebBrowser2 object, and to FindConnectionPoint with iid = DIID_DWebBrowserEvents2. If succeeded (= have IE installed ) you can create here your ISinkDiapatcher object and call IConnectionPoint's Advise passing your dispatcher. Something like this:
HRESULT
IWebOleClientSite::ConnectEvents()
{
HRESULT hr = E_NOINTERFACE;
IWebBrowser2 *pWebBrowser = (IWebBrowser2 *)NULL;
hr = m_pIOleObject->QueryInterface(IID_IWebBrowser2, (LPVOID *)&pWebBrowser);
if(SUCCEEDED(hr))
{
hr = pWebBrowser->put_TheaterMode((VARIANT_BOOL)1);
hr = pWebBrowser->put_RegisterAsBrowser((VARIANT_BOOL)1);
IConnectionPointContainer *pCPI = (IConnectionPointContainer *)NULL;
hr = pWebBrowser->QueryInterface(IID_IConnectionPointContainer , (LPVOID *)&pCPI);
if(SUCCEEDED(hr))
{
hr = pCPI->FindConnectionPoint(DIID_DWebBrowserEvents2, &m_pConnectionPoint);
if(SUCCEEDED(hr))
{
m_pSinkDispatcher = new ISinkDispatcher;
hr = m_pConnectionPoint->Advise(reinterpret_cast<IDispatch*>(m_pSinkDispatcher), &m_dwCookie);
if(SUCCEEDED(hr))
{
m_pSinkDispatcher->SetClientSite(this);
}
}
pCPI->Release();
}
pWebBrowser->Release();
};
return hr;
}
(Don't forget: if you have a ConnectEvents, do also a DisconnectEvents on dialog close).
In few moments I'll post a sample about this on CodeTools. If these lines above are quite complicated (and I agree), maybe reading sample, building and debugging on your own can be more helpful that these aglomerated lines...
All the best,
Sardaukar
|
|
|
|
|
How to determine the cursor shape. I am interested in a function that returns a CONSTANT of some kind. If not is there an API fuction that returns a bitmap, or a Windows image handle?
|
|
|
|
|
GetCursor.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hiya
Does anyone know anything about addins for Outlook Express? I've read about doing it using COM for Outlook 2000 but I can seem to find much about how to do it for Express. Any ideas anyone?
Noodle
|
|
|
|