|
Thanks a lot for your reply.
|
|
|
|
|
|
Hi all...
I am installing hook on Internet Explorer window, by using
SetWindowsHookEx(WH_GETMESSAGE, GetMsgProc, (HINSTANCE)g_hInstance, dwThreadID);
Where 'dwThreadID' is of IE. Then in the hook proc(GetMsgProc), I load another "MFC dll", by using LoadLibrary(). This "MFC dll" sinks events of IE using AfxConnectionUnadvise.
When I am done, I try to free this "MFC dll" module by using FreeLibrary()... It frees the library successfully, but after freeing the library IE crashes.
Does anyone have idea why it could crash IE?
Any help would be kindly appreciated...
Thanks
|
|
|
|
|
|
YEs i m calling UnhookWindowsHookEx, and even freeing al deleting all the objects instantiated in loaded dll, i m even unadvising the event sink...
|
|
|
|
|
Did you use from breakpoint?
|
|
|
|
|
hi
I am showing tooltip by sending
SendMessage(hwndch,TTM_TRACKACTIVATE,(WPARAM)(BOOL)TRUE,(LPARAM)(LPTOOLINFO)
&ti);
message to Tooltip control.
When I want to close this, I am sending
SendMessage(hwndch,TTM_TRACKACTIVATE, (WPARAM)(BOOL)FALSE, (LPARAM)
(LPTOOLINFO)&ti);
But How to close this tooltip without sending 2 nd message?. Is there any option which create tooltip with Close Icon(x) in it so that I can close using that icon.
Is there any other options.
I am doing it in Win32 based Application.
Thanks
|
|
|
|
|
|
Hi out there.
I am looking for a gzip wrapper that truly works with UNICODE?
I've found wrappers that compile UNICODE but -- don't actually file names that contain extended chars... (very annoying)
Anyhow, is there a great free library or even a pay library that just plain works?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
|
CGZIP is bad.
It compiles UNICODE, but it doesn't support UNICODE path names (with funny characters)... It downgrades pathes to ANSI before opening the files...
tsk tsk tsk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
|
Most wrappers would just wrap zlib, which doesn't have unicode support. It's not particularly difficult to change fopen to _tfopen, char* to TCHAR* etc, just have to watch out when you allocate space for strings to * sizeof(TCHAR). Tedious though as zlib seems to have lots of unnecessary casts but it shouldn't take more than an hour of your time. I just modded a copy and it seems fine.
|
|
|
|
|
Thanks for the input...
It's all a big hairball, I have to say.
For various reasons, I ended up using the code from the zlib website.
http://www.zlib.net/zlib_how.html[^]
CGZip was a mess, and it's sample program kept getting stack overflows. (no time to deal with that)
The only other messy part -- was trying to get the code to spit out a gzip header instead of a zlib header. I was trying to get it to work with GZIPInputStream...
Anyhow, thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Hi,
I had got an error as "Invalid handle specified" while trying write to a serial port(COM1)using WriteFile().
But the handle to serial port is seems to be valid.
One by one step I had followed is below.
Step 1: Create a connection
HANDLE hSerial = CreateFile( "COM1",GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL ,NULL);
Step 2: Configure the settings
DCB db;
memset( &db,0,sizeof(db));
db.DCBlength = sizeof(db);
if( ! GetCommState( hSerial, &db ))
{
return;
}
if( ! SetCommState( hSerial, &db ) )
{
DWORD dw = GetLastError();
return;
}
Step 3:
DWORD dwWritten;
OVERLAPPED or;
if( WriteFile( hSerial, "Write", 6, &dwWritten, &or ))
{
AfxMessageBox( "Write Success!!!");
}
Step1 and Step2 are successfully executed.
But step3 returns an "Invalid handle specified" error.
What may be prob?
Thanx in Advance.
-- modified at 0:33 Friday 11th August, 2006
|
|
|
|
|
What is the value of hSerial at this point (check with your debugger) ? It should be something else than 0xFFFFFFFF
|
|
|
|
|
Try to zero out or before using it.
ZeroMemory(&or, sizeof(OVERLAPPED));
Then set the hEvent member to your handle (hSerial).
Or an easier way: Use a ready made serial communication class. There are quite a few here at CP.
-- modified at 3:15 Friday 11th August, 2006
|
|
|
|
|
oops!
That was the problem.
Thanx you very much.
|
|
|
|
|
I'm glad to help you.
But i would suggest you to use a ready-made serial comms class. It's not easy to handle two different overlapped structures (one for read, one for write).
And if you don't use overlapped, then your reads will hang until there is data to read.
A serial comms class will take care of that problem for you.
|
|
|
|
|
I decided to use non-overlapped communication.
I had made a worker thread for reading the serial port hoping that the blocking issue get solved.
But from the worker thread if I call ReadFile() using the same handle,
it do not wait, even if there is no data in the serial port.
why this happens?
Plz help..
-- modified at 7:04 Friday 11th August, 2006
|
|
|
|
|
Well, I'm not sure what happens.
My suggestion is to read about ReadFile at MSDN.
Or, as I said before... Use a ready-made serial comms class...
That way, you won't have to reinvent the wheel.
Serial comms ain't easy to handle.
I'm leaving for the weekend now.
|
|
|
|
|
I use a pop up window to display the flash. when i close the pop up window, the flash haven't stoped. how can i stop the flash?
I try to use CDialog::OnDestroy(); but i can't work
-- modified at 23:33 Thursday 10th August, 2006
|
|
|
|
|
call EndDialog(1);
or Send api for postquitmessage(...)
|
|
|
|
|
Do you have any code for close popup window?
|
|
|
|
|
I want to set the window/dialog size by user controling the mouse not by the program. Any setting needed in the dialog properties? Thx
|
|
|
|