|
Hello,
No, it's not the ActiveX download. With a proper configuration I avoided all ActiveX dialog boxes.
No I get a security alert for any kind of file that is not HTML like JPEG, GIF, MP3. In that case the browser normally ask if you want to download them, but I disabled this kind of download in IE configuration, so instead of a dialog box asking if I want to download the file I get a security alert dialog box telling me that my level of security is too high to allow the download. And I want to get rid of this security alert dialog.
Thanks,
R. LOPES
Just programmer.
|
|
|
|
|
In that case I suggest hooking into the Invoke method and canceling any DISPID_FILEDOWNLOAD requests.
If you need to support older browsers that don't support that DISPID you'll either have to filter by extension or do API hooking to get the header info similar to this tool http://www.blunck.info/iehttpheaders.html
Todd Smith
|
|
|
|
|
Thanks ! I will take a look.
Regards,
R. LOPES
Just programmer.
|
|
|
|
|
hello,
I would like to type a shortcut on my dialog and that it executes a particular routine I have coded (ie set the focus on a particular input control). I have no menu on my dialog window .
How should I do this ?
I have created a accelerator to set my shortcut, linked the accelerator to my code using the class wizard, but when I launch my appli, nothing happens when I press my shortcut ...
What is missing ? Is it the correct way to do this ?
Thanks in advance
DD
|
|
|
|
|
I did a quick search for "dialog AND accelerator" in MSDN and came up with the following:
Q222829
HOWTO: Using Accelerator Keys Within a Modal Dialog Box
which should give you exactly what you want. Classwizard won't help you much though...
I don't remember the last time I used CW!
Iain.
|
|
|
|
|
Yes, seems to be exactly what I need.
I an going to try it immediatly
Thanks for help.
DD
|
|
|
|
|
yes, it works but ... what happens when I defined several keys combinations in my accelerator, as it can be considered as a table of keystrokes.
I loaded my accelerator table in the OnInitDialog() :
m_hAccelTable = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR1));
These special keystroke can be recognized in the override routine :
BOOL CDialogDlg::PreTranslateMessage(MSG* pMsg)
if (m_hAccelTable) {
if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg)) {
return(TRUE);
}
}
return CDialog::PreTranslateMessage(pMsg);
}
What I understood is that, when ::TranslateAccelerator recognizes a keystroke existing in accelerator, it send a WM_COMMAND message.
Then, using class wizard, I created a routine corresponding to dialog IDR_ACCELERATOR1-WM_COMMAND message:
void CDialogDlg::OnAccelerator1()
{
GetDlgItem(IDC_EDIT3)->SetFocus(); //special keystroke => set focus here
}
It works, but how can I perform different actions depending on keystroke?
Can I get the keystroke or is there any way to distinguish them?
Should I have several Accelerator and load them all and perform the ::TranslateAccelerator on each of them?
Could you still give me some help on this?
Thanks in advance
DD
|
|
|
|
|
Real life slowed my reply.
You can set various key combinations in the accelerator, each associated with a command value.
e.g.
ALT-Q => IDC_Q
CTRL-j => IDC_J
In your dlgs message map you would have
ON_COMMAND(IDC_Q, OnQ)
ON_COMMAND(IDC_Q, OnQ)
(I never use class wizard, as it runs into too many limitations, e.g. ON_COMMAND_RANGE())
If you are only using the accelerator for settings focus on other controls, you can just
put a static control before them in the tab order with one of the keys underlined
(i.e. Qeue: _______. When you press Alt Q, the dialog tries to put focus on the
static control, which then puts in on the next control with the WS_TABSTOP style.
So you may not need the accelerator after all!
Iain.
|
|
|
|
|
Thanks for answer on accelerator and the good idea the trick of the static control !!
I will use it !
Bye
|
|
|
|
|
If incoming TCP connections are made to one port, say 1000 and I want the actual connections to be made to another port.
Is it forward incoming connections on one port to another one on the same machine?
The two listening ports are on two different processes. Is it possible to create an app to do it without the target application not being programmed specially?
Once the forwarding is done, the forwarder should not be in the loop. ie, the connection when forwarded exists directlt between the target application and the client.
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
|
A much easier solution is just to write a little program that listens on one port, and writes everything it receives to target port. Its a pretty standard concept (a proxy), and if you do a search on google for 'tcp tunnel' then you'll find lots of programs that will do it for you
|
|
|
|
|
|
|
What is it about the slider control that it wants to stay in the last place it was at on a window. I close the window and when I go back even thought I do a SetPos(0) it is still hanging around the last place it was left.
Any ideas on how to make it move back?
Thanks,
Jim
|
|
|
|
|
Recheck your code. Otherwise, call Invalidate().
Kuphryn
|
|
|
|
|
Not like I want a new control or anything. I just want to Derive the CAsyncSocket class in a DLL. Then I want to override the virtual members (all the "on..." functions) and add some of my own, like pre-parse buffers and such.
My purpose is to load the DLL in Visual Basic. It seems a heck of a lot more work, in the long run, to write and existing object and a new object for each other, instead of writing one that I can use in place of the two.
What do I need to do (#include, list in compile command-line, etc.) to make it compile properly as a DLL.
Then, how do I instantiate one in VB so I can go about using it?
--M.Pemrich
----------------------------------------------------
Just kinda lost everywhere. And as if lost wasn't lost
enough... I got a book on the subject...
|
|
|
|
|
Somebody out there may well correct me, but I don't think you can call a conventional C++ class from VB without cracking the mangled names and passing the this pointer across.
However it's not all bad news. .NET allows you do use (and inherit) classes across threade boundaries, so you can quite happily use a C# class derived from an MC++ class in a VB.NET app.
Chris Maunder wrote an article on the subject you might find of interest:
Cross language inheritance in .NET[^]
Anna
www.annasplace.me.uk
"Be yourself - not what others think you should be" - Marcia Graesch
Trouble with resource IDs? Try the Resource ID Organiser Add-In for Visual C++
|
|
|
|
|
hi,
maybe a dumbquestion...
i want to know wenn a key is pressed in my dialog and witch key is pressed. how do i do it?
thanks in advanced...
Willem
[]D [] []D []
|
|
|
|
|
If you go into the Class Wizard under the message maps tab you can select WM_KEYDOWN or WM_KEYUP from the messages section. Once selected add a function to the event and edit the code in the function. The function takes in a parmeter called nChar.
convert nChar to a regualr character by using something like
char myChar;<br />
myChar = char(nChar);
then to find what key was pressed you can do simple comparisons like
if (myChar =='A')<br />
{<br />
}
Michael Shuster
Good Judgement comes from experience; Experience comes from bad judgement.
|
|
|
|
|
tracking WM_KEYDOWN should do it. There's much information about it on MSDN.
|
|
|
|
|
Hi, if tried it and it didn't work, maybe i should add that i want to override the input of inputbox to make my user interfase more keyboard-based.
[]D [] []D []
|
|
|
|
|
Howdy'
I have a UI with a ControlBar ( CSizingControlBar ) that contains a dialog and sub dialogs ( panels ).
The Panels need to be aware when they get the focus.
I tried handling WM_SETFOCUS, WM_ACTIVATE and WM_NCACTIVATE, and I don't receive the messages.
I now handle WM_LBUTTONDOWN to "simulate" the wanted behaviour, but I don't like it, and wandered if I'm missing something ?
Thanks.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
CString m_test;
sBuffer[2] = "\xE8";
m_test.Format("0x%x", sBuffer[0]);
when i display on the edit box, i get this output
0xffffffe8
it looks like it sign extend the value, any other way to solve it so that i can get 0xe8 instead of 0xffffffe8
regards
afender
|
|
|
|
|
m_test.Format("0x%02x",sBuffer[0]) could work. Haven't used a CString for a while though.
Have a look at boost::format at http://www.boost.org[^] if you like your type safety.
Ryan
They read good books, and quote, but never learn
a language other than the scream of rocket-burn.
Our straighter talk is drowned but ironclad;
elections, money, empire, oil and Dad.
|
|
|
|