|
I believe the issue is related to the fact that the file handle can't be closed by a thread other than the one that created it.
In your case, the ZwClose is being used inside an asynchronous procedure.
By the way, I do'nt understand why you defer that in a KTIMER in the name of "avoiding a locked file".
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
WS_OVERLLAPED 0x0L
WS_POPUP 0x80000000L
I don't really understand the differences between them. They both can have border, min/max button, or sysmenu. The only different feature I can read from msdn is popup cannot be a child window. so is that all these two are different?
Can I take the popup window this way? popup window is overlapped too, coz all window is overlapped(WS_OVERLAPPED = 0x0L),the 31th bit of the window style is set to 1 to indicate that it mustn't be a child window, but it can be an owned window.so they are different only when they are being owned?(I don't know child window can be said " being owned" either, coz being owned and being a child are totally different. )
|
|
|
|
|
WS_OVERLAPPED creates a window with a frame border, WS_POPUP creates a similar window but without the frame border. You can test this by creating a very simple Win32 application and try the various styles to see the different effects.
Unrequited desire is character building.
|
|
|
|
|
That's what I would've done (test it)... but I had no idea as to the difference...
|
|
|
|
|
I have tested a lot. Turns out having the WS_POPUP(0x80000000) bit on doesn't mean adding a feature to a window,but means eliminating a feature from a window. That feature is the title bar. If missing WS_POPUP we normally have no way to create a window without caption bar,however POPUP window still can be forced to have title bar if combined with WS_CAPTION,that's it changes back to a OVERLAPPED window again.Popup window cannot be a child window too.I think overlapped window, popup window and child window are mutually exclusive, only because overlapped window is the value 0x0, so if we use WS_OVERLAPPED | WS_CHILD doesn't affect the success to creating the window.But the msdn says WS_OVERAPPED is a top-level window which means WS_OVERALPPED conceptually cannot be a child window too.
|
|
|
|
|
Albert Holguin wrote: I had no idea as to the difference
Nor me; I just ran a quick test to see it. I have to admit that the description in MSDN is very poor for anyone trying to learn about the differences.
Unrequited desire is character building.
|
|
|
|
|
Richard MacCutchan wrote: the description in MSDN is very poor
...that happens a lot...
|
|
|
|
|
Hi all,
I am trying to write a file in binary mode using _tfopen_s function.
My problem is i have to write it first then i have to close it and then after some time i need to open it and write contents at the end of it and then close it again.
i am using these lines to do this
_tfopen_s(&fileptr, File_Path, _T("wb+") );
fwrite ( buffer1, 25, 1, fileptr );
fclose(fileptr);
and
_tfopen_s(&fileptr, File_Path, _T("ab") );
fwrite ( buffer1, 25, 1, fileptr );
fclose(fileptr);
but my problem is when i am trying to open that file it is not opening
Is there anything that i am doing wrong in writing the file.
thanks in advace
|
|
|
|
|
Check the return value of the open that fails, it's an error code, it probably can shed some light on the issue.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Error checking is like a cataract operation!!!
|
|
|
|
|
Hello there,
I am using a MDI application in MFC to display images...
I want to use the double-click event to make the child window appear in full-screen mode and double-click again to put back in to the previous size.
Any suggestions to do this?
Thanks in advance!!
|
|
|
|
|
|
|
Instead of using a CView, then I would just open a CDialog and resize it so it fills the entire screen. Then you can implement whatever event-handling on CDialog to make it close again. Depending on the situation then you can choose between a modal or modeless CDialog.
If you insist on using a CView, then you might consider making it always on top within the MDI app. How to Keep an MDI Window Always on Top[^]
|
|
|
|
|
Hi all, I am working on class to wrapp unmanaged pointer. I am just confused, whether pinning of value struct is needed in C++/CLI, i.e. whether if I will not do it, it can cause some problems.
In C#, I am not able to fix structs:
Point pntA = new Point(10, 25);
Point pntB = new Point();
unsafe
{
fixed (Point* ptrA = &pntA, ptrB = &pntB)
{
ptrB->X = ptrA->X;
ptrB->Y = ptrA->Y;
}
}
but, I can simply use address-of operator:
Point pntA = new Point(10, 25);
Point pntB = new Point();
unsafe
{
Point* ptrA = &pntA, ptrB = &pntB;
ptrB->X = ptrA->X;
ptrB->Y = ptrA->Y;
}
What is confusing me is that pin_ptr lets me pin structures as well as use address-of operator:
generic <typename T> where T : value struct
T GetValueA(void* ptr)
{
T val = Activator::CreateInstance<T>();
pin_ptr<T> valPtr = &val;
memcpy(valPtr, ptr, sizeof(T));
return val;
}
generic <typename T> where T : value struct
T GetValueB(void* ptr)
{
T val = Activator::CreateInstance<T>();
memcpy(&val, ptr, sizeof(T));
return val;
}
My questions are:
Is pinning needed in C++/CLI functions to fix value struct
before using its pointer in unmanaged function?
Are value structs allocated in the unmanaged heap?
Thanks all,
Dusan
modified on Wednesday, August 3, 2011 12:22 PM
|
|
|
|
|
I think you are asking at the wrong message board, try the Managed C++/CLI[^] one.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Aha, OK, thanks, I have overlooked that one...
|
|
|
|
|
It happens...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Hi all,
Can you tell me how to get the msn status by programming, any program language is ok, such as c/c++/java or asp/asp.net/php etc.
What I want is: enter a msn address, such as 'test@hotmail.com', and then the program can return the current status of that account(just online or offline is ok).
Thanks in advance.
Joul
|
|
|
|
|
Try one of the HttpWebRequest[^] calls.
The best things in life are not things.
|
|
|
|
|
thanks, but i don't know where i can get the msn status? can you give me some hints?
joul
|
|
|
|
|
I'm not sure what you mean by "msn status", the best you can do is send a web request and if it fails you can check the web response to try and ascertain why. Take a look at some of the links I found for more information.
The best things in life are not things.
|
|
|
|
|
Take a look around this[^], maybe it has what you need.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Lighter Joul wrote: Can you tell me how to get the msn status by programming
1. Define what you mean by that - exactly. Presumably by doing some sort of online interaction.
2. Determine exactly what protocol is needed to achieve that.
3. Create code that implements that protocol.
Last step is the only one that has anything to do with code.
|
|
|
|
|
The leader says the size of header part of Tcp protocol can be changed to increase transfer speed. What ways do you use to increase transfer speed? Especially some different transfer tools is using at the same time.
|
|
|
|