|
Hi
I'd like to disable refresh (F5) command in CHTMLView and CDHtmlDialog application.
I created mixed class CDHtmlView wich is derived from CHTMLView and has event sinking from CDHtmlDialog.
I try to catch key down message in DHTML_EVENT_MAP:
DHTML_EVENT(DISPID_HTMLELEMENTEVENTS_ONKEYDOWN,NULL,OnAllKeyDown)
But the OnAllKeyDown function is never called.
How to disable page refresh ????
|
|
|
|
|
I found
DocHostUIHandler::TranslateAccelerator
and return S_OK
very simple ))
|
|
|
|
|
Isn't CAxWindow the ATL equivalent of CWnd? it's just in MFC I was able to call InvokeHelper, but in CAXWindow this isn't available to me.
Can anyone offer any advice?
|
|
|
|
|
When I call GetFileSize in debug mode it returns the correct value of 516. In realease mode it returns some HUGE value
DWORD numBlocks = GetFileSize(hOriginal, NULL)/64;
What could be the problem? I'm a bit stumped.
And when God, who created the entire universe with all of its glories, decides to deliver a message to humanity, He WILL NOT use, as His messenger, a person on cable TV with a bad hairstyle.
|
|
|
|
|
i'll guess that hOriginal is NULL
-c
Being just contaminates the void. --Robyn Hitchcock
|
|
|
|
|
Hmmm, why would it be NULL only in DEBUG mode though?
And when God, who created the entire universe with all of its glories, decides to deliver a message to humanity, He WILL NOT use, as His messenger, a person on cable TV with a bad hairstyle.
|
|
|
|
|
how are you setting hOriginal?
Being just contaminates the void. --Robyn Hitchcock
|
|
|
|
|
Like so
HANDLE hOriginal = ::CreateFile(m_EncryptedFilePath,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
Sorry for the delays, I have a darn slow connection over here
And when God, who created the entire universe with all of its glories, decides to deliver a message to humanity, He WILL NOT use, as His messenger, a person on cable TV with a bad hairstyle.
|
|
|
|
|
are you testing hOriginal for NULL ?
if GetFileSize fails, it returns 0xffffffff, which, when divided by 64, will give an apparently huge number.
try calling GetLastError after your GetFileSize call.
-c
Being just contaminates the void. --Robyn Hitchcock
|
|
|
|
|
Chris, thanks for the help, you certainly pointed me in the right direction. However, the problem was a bit indirect.
m_EncryptedFilePath = "c:\file1.abc".
Now, in debug mode, all is well as I have said. But in release, hOriginal becomes NULL, meaning the file does not exist. (The file does exist).
So I just now tried to change
m_EncryptedFilePath = "C:\\file1.abc" and lo and behold it works.
Frankly, I don't know why. I'm aware that '\' is an escape sequence but then why does it work for my DEBUG code?
If you have any idea on why this is so (even though the prob itself is solved) I'm all ears.
Regards
Senkwe
And when God, who created the entire universe with all of its glories, decides to deliver a message to humanity, He WILL NOT use, as His messenger, a person on cable TV with a bad hairstyle.
|
|
|
|
|
uggh, spoke too soon, still won't work when I pass in the file name as a command line param.
Thanks for the help Chris, I appreciate it
It'll come to me in the morning
Senkwe
And when God, who created the entire universe with all of its glories, decides to deliver a message to humanity, He WILL NOT use, as His messenger, a person on cable TV with a bad hairstyle.
|
|
|
|
|
Turns out that your guess is correct, I tried the following...
DWORD numBlocks = GetFileSize(NULL, NULL)/64;
and sure enough I got the exact same huge number as before. I'm still stumped as to WHY it's NULL in RELEASE mode but not in DEBUG mode. Could be access rights or permissions.
And when God, who created the entire universe with all of its glories, decides to deliver a message to humanity, He WILL NOT use, as His messenger, a person on cable TV with a bad hairstyle.
|
|
|
|
|
I am creating my own framework (some already know), but there is one problem handling the WM_CREATE message.
This is my code
EWindow::EWindow(EString caption, EControl *parent, UINT menu) : EControl()
{
this->hInstance = hInstance;
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)OldControlProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = NULL;
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCTSTR)menu;
wcex.lpszClassName = caption.GetString();
wcex.hIconSm = NULL;
RegisterClassEx(&wcex);
EString wndclassstr = caption + "___";
hControl = CreateWindow(wndclassstr.GetString(), caption.GetString(), WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, parent->GetHandle(), NULL, NULL, NULL);
SetWindowLong(hControl, GWL_USERDATA, reinterpret_cast<long>(this));
}
As you know, the WM_CREATE Message is sent within the CreateWindow function, but this isn't cought at the right place, because I want him to do it object oriented. So, after the SetWindowLong(...) function. Does anyone know how I can fool the system, so the WM_CREATE message is sent after the SetWindowLong(...)
thanks in advance,
Sjoerd van Leent
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
I believe MFC solves this problem by using a Windows hook. In fact, if memory serves correctly, it uses WH_CBT for this very reason - WH_CBT gives you a hook into the CreateWindow function (HCBT_CREATEWND) that gets called before the WM_CREATE message is sent.
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
Now we are coming somewhere
thanks
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
Is there a way to do it without using a DLL? (Does somebody have the code, or a sample)
thanks in advance,
Sjoerd van Leent
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
Hi all,
I'm working with a database application.The database for my application is an access database.It is located on a remote machine.The database is password protected.I configured a dsn in my system and the database for that is configured by using the browse button on the 32 bit DSN dialog window.The database is placed on a shared folder in the remote PC.Both machines are running on windows 2000.
In my application i tried to open my database using the following code.But it throws exception.Can any one help me?.
CDatabase db;
db.OpenEx("DSN=regn;;pwd=employee",0);
With regards.
Shibu K.V.
Senior Research Associate.
VLSI ASIC Hardware Design Group
Electronics R&D Centre,Trivandrum
India
|
|
|
|
|
What description does the exception object contain >?
Did you check the permissions of the remote share ?
It should have permissions to write since the
lock file is created in the same place as the database.
|
|
|
|
|
try adding 'UID=admin;' to your connection string.
/=/=/=/=
Deus
/=/=/=/=
|
|
|
|
|
hi all,
I am using "mciSendString" api function to record the wave audio through
microphone.
My question is how can i capture the audio data in Integer array while recording?
Because I have to Plot the line graph(spectrum) by using these values while recording(real Time)
Please help me.
Is there any other method to Plot the graph while recording(realTime)
Thank in advance.
|
|
|
|
|
In the debug tab of your project settings, add the filename to the argumenst that would be passed through on the command line. You can then run in debug mode from VC.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
What can i do to close the current workspace?
rechi
|
|
|
|
|
i want to disable ctrl+alt+del under windows 2000 and SystemParameterInfo() is not working. here is the code
UINT _Junk;
// turn off ctl-alt-del
SystemParametersInfo(SPI_SETSCREENSAVERRUNNING,1,&_Junk,0);
// ... do stuff? like what?
// turn on ctl-alt-del
SystemParametersInfo(SPI_SETSCREENSAVERRUNNING,0,&_Junk,0);
what could be the problem, if anybody tells me.
|
|
|
|
|
it works only for Windows 95/98/Me
|
|
|
|
|
According to MSDN you shouldn't use SPI_SETSCREENSAVERRUNNING (look up SystemParametersInfo for details). Would SPI_SETSCREENSAVEACTIVE help here? - I don't think it would but it might be worth a try
If you have MSDN there, look up the article called 'HOWTO: Disable Task Switching on Win32 Platforms' - it talks about low level hooks to achive the goal. If you find an easier / better way please post a reply here for the rest of us!
Dylan Kenneally
London, UK
|
|
|
|
|