|
Hello,
Not sure if this question belongs here...
I have a web server (a service) that acts as a proxy to translate web pages from English to Swedish.
In order for this to work, I need to set the appropriate values of proxy server and port and activate "Use a proxy server" in IE->Internet Options->Connections->LAN Settings->Advanced.
Now, activating and deactivating frequently will become a pain in the ass jumping to the options dialog all the time, so I figured I could create an IE toolbar button that would do this programmatically.
This turned out to be more complicated than I thought... I can change the options programmatically (at IE runtime) but the changes don't seem to be reflected appropriately. I was trying to simulate the [de]activation behaviour of IE when doing it manually, but something seems to be missing.
Manually my proxy kicks in just fine, but not programmtically... all options are set and visually it all looks fine.
Has somebody dealt with this or does anyone know how to do this?
ANy pointers to material on this would be appreciated,
TIA,
/Tommy
|
|
|
|
|
Tommy Svensson wrote:
Has somebody dealt with this or does anyone know how to do this?
what exactly are you changing??? Are you just setting the value in teh registry or are you going about it a different way?
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
Brian Delahunty wrote:
what exactly are you changing??? Are you just setting the value in teh registry or are you going about it a different way?
I'm changing the values (ProxyServer and ProxyEnable) in the registry (HKCU/Soft/MS/Windows/CurrentWindows/Internet Settings). To be sure things are really changed I'm also calling InternetQueryOption and InternetSetOption with values set from the registry.
The reg settings are notified to IE through
SendNotifyMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0x1F,
reinterpret_cast<LPARAM>(_T("Software\\Microsoft\\Internet Explorer")));
But this doesn't seem to be sufficient. Maybe I need to tell IE (or someone else) about these changes in a different way?
Ohhhh, I really REALLY need this to function!
Thx,
/Tommy
|
|
|
|
|
The work around would be to make the change and then launch a new browser instance with your current URL and close the existing instance.
You might try something like COMspy to see what the IE container is doing when you hit apply. Somehow it must be causing IE to re-init without closing down. BTW its the container that's doing the action and not the IE control which is being hosted.
Todd Smith
|
|
|
|
|
Here's the answer... FINALLY!!!
http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/wininet/tutorials/options.asp
And now it all works! Thx to all who have helped out!
/Tommy
|
|
|
|
|
I would like to initialize my static const variables as part of the declaration in the header (I am using VS7) - this seems to work fine for ints, but not for LPCTSTRs. For example:
class CFoo
{
static const int m_nStatic = 1; // This works
static const LPCTSTR m_pszStatic = _T("Hello, world!"); // This fails
static const char* m_pszStatic2 = "Test"; // This fails
};
In the above sample, I get the following errors when attempting to initialise the strings:
error C2864: 'm_psz...' : only const static integral data members can be initialized inside a class or struct
Obviously I can initialize the static strings outside of the class, i.e.:
LPCTSTR::CFoo m_pszStatic = _T("Hello, world!");
But I have always found this method cumbersome. I am a big fan of Scott Meyers Effective C++ book(s) and he cites example code that will initialise strings in the class declaration so could this be an MS compiler-ism? Perhaps there is a pragma?
Phew, for a minute there I lost myself.
|
|
|
|
|
Robert Edward Caldecott wrote:
could this be an MS compiler-ism?
Don't think so. Here's what Holy Book of C++ Standard says in 9.2, paragraph 4:
"A member-declarator can contain a constant-initializer only if it declares a static member (9.4) of integral or enumeration type"
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
OK. I have found I can initialize strings in the header and use the new MS __declspec(selectany) attribute to avoid errors if the header is included elsewhere in the project:
class CFoo<br />
{<br />
static LPCTSTR s_psz;<br />
...<br />
};<br />
<br />
__declspec(selectany) LPCTSTR CFoo::s_psz = _T("Yeeha");
This will have to do.
Faith. Believing in something you *know* isn't true.
|
|
|
|
|
I have developed a chat application and now I want to integrate voice chat in my application...but I have no idea how to start...can anybody help me in doing this?
Thanks in advance
Deepesh
|
|
|
|
|
Example : http://www.codeproject.com/internet/voicechat.asp
Donno if its good enough but u can try it.
U can achieve the same with directX
|
|
|
|
|
I have already gone through that code but I am still not able to understand the concept that how to implement it.
Anyway thanks for the reply..if you have some idea then plz tell me.
Deepesh
|
|
|
|
|
http://www.codeproject.com/internet/voicechat.asp[^] Might help you out
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
Do you know what Socket Notification Sink is ?
Sometimes, when my applications crashes, the message box that shows the fatal error has Socket Notification Sink as the title. When I run Spy++ and look at windows, under my app process is
Socket Notification Sink member....???
Thanks.
Celebrate Mr. Cesilko!
|
|
|
|
|
I've started a workspace without winsock support, but now, few weeks later, I want to add it.
Is it still possible, and how do I do it?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Project -> Add to project -> Components and Controls
and you'll find Windows sockets under C++ components. This is the easiest way in your case.
|
|
|
|
|
tnx
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Hi,
when is the last reliable possibility to send data to another application at the end of the program ? Destructor of FrameWnd, or destructor of CWinApp ??
Thanks
Celebrate Mr. Cesilko!
|
|
|
|
|
CYourApp d'tor will be called after frame window is destroyed, because application object is global and frame window is created dynamically.
Of course, when application destructor is invoked you don't have any documents/views/frames.
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Going through some files from another programmer, I found that he always put a using namespace std; in his public headers. Trying to limit the scope of the using I tried to move the using clause inside the class declaration
class C
{
using namespace std;
}; but it results in a compilation error on VC6.0 sp5. But it shouldn't!? Anyone have an idea here?
(I finally qualified every single item from the std namspace.)
|
|
|
|
|
Niklas Lindquist wrote:
But it shouldn't!?
Why?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I suppose, since you may limit the scope of using to within any other scope, like functions, other namespaces, limited scopes with a { and a corresponding }, it should be possible to us it within a class declaration. That was at least what I thought. Why may I use it within, what seems to be any other scope, but not within a class or struct declaration?
|
|
|
|
|
Niklas Lindquist wrote:
Why may I use it within, what seems to be any other scope, but not within a class or struct declaration?
Well, you can't use it because C++ Standard forbids it explicitly:
"A using-directive shall not appear in class scope, but may appear in
namespace scope or block scope." (C++ Standard, 7.3.4).
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Thank you. I feel better now
Do you have any idea why it is has been forbidden? I can't see any clear reason. Does it introduce any problems, and if so what?
|
|
|
|
|
Niklas Lindquist wrote:
Do you have any idea why it is has been forbidden?
I was able to find some discussions on that using Google newsgroup search, but none had satisfactory answers. If you accidentally meet Bjarne in the pub, ask him and let us all know
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Will do!
Thanks for the help.
|
|
|
|