Hi, I have a program which creates a named pipe in one thread and then launches another to call ConnectNamedPipe. Now at some point in the initial thread it will be required to shutdown, so I have tried calling DisconnectNamedPipe followed by CloseHandle but this does not seem to free up the thread that is listening on ConnectNamedPipe and it remains blocking. Anybody know of a solution to this
Ceri
Posts
-
Named Pipe Closing Problem -
CreateNamedPipe and CreateFile on Win98Hi, I have a server app that uses CreateNamedPipe using a NULL DACL so that everyone has permission to read/write to it. I then have a client that uses CreateFile to read and write to the pipe. In XP this works on remote machines no problem, the server can be running on one machine and the client on another and the CreateFile returns a valid handle. On 98 CreateFile returns access denied, which eludes me because the pipe is created with a NULL DACL. Can anybody shed some light on the issue. Thanks
-
A question about reading non-data CDsWhat OS do you want compatiblity with? You can use SPTI in NT and use ASPI in 9x SPTI Have a look for opening CDRom drives using CreateFile, you can read sectors other than data using DeviceIoControl and IOCTL_CDROM_RAW_READ ASPI If you using ASPI then you can use many of the read commands defined in the SCSI 3 specification. READ_CD being your best bet. Regards, Ceri
-
Capturing mouse clicks on a custom Win32 controlHave you specified the SS_NOTIFY style when creating the window?
-
GetDIBits and 98 ProblemHi I have a problem where I cannot use GetDIBits on 98, works fine on XP. I read somewhere that in 98 the width and height have to be divisable by 4 so I even tried that with no avail. Here is a snippet which works in XP but doesn't in 98. Has anybody got any clue why it's not working in 98
... HDC hBmDC = CreateCompatibleDC(NULL); HBITMAP hB = CreateBitmap(16,16,1,24,pPixels); bmiInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); // get pixels from the original bitmap con verted to 24bits int iRes = GetDIBits(hBmDC,hB,0,16,NULL,&bmiInfo,DIB_RGB_COLORS); ...
Thanks -
Kernel32.dllWhat are you trying to acheive? Like somebody has already stated, kernel32.dll has to be linked tightly to a compiled win32 executable. Stubbing kernel32.dll I would imagine would be almost impossible.
-
Help me: need strategy for CrashLogsHi, In this situation I would use the SetUnhandledExceptionFilter API to set up an exception filter and then within your exception filter function you can use MiniDumpWriteDump to write a dump of your problem service. You can then open the mdmp file up in VS.NET press F5 and you will be at the point where your program crashed. Hope this helps Ceri
-
Named Pipe access problems across networkHi, I have created a Named Pipe with a security descriptor that contains a NULL DACL to allow everyone to access the pipe on a server application and have also created a client application to connect to it. All works fine if client and server are on the same machine but i get a 0x0000052e Logon failure: unknown user name or bad password. When using a remote client. Anybody shed some light on this will be appreciated. Ceri
-
To draw something over a Browser Hosted application WindowIf your using an IE window try looking at the DOM. There are many articles on the web using DOM from a C/C++ program
-
Named Pipes access accross networkNo, that is incorrect. That's true if you specify NULL for the lpSecurityAttributes to CreateNamedPipe. I am creating a security attribute structure but the DACL for the security descriptor is NULL - see below
SECURITY_ATTRIBUTES saPipeSecurity; PSECURITY_DESCRIPTOR pPipeSD = NULL; // security inits memset ( ( VOID *) &saPipeSecurity, 0, sizeof ( SECURITY_ATTRIBUTES) ); // alloc & init SD if ( ! ( pPipeSD = ( PSECURITY_DESCRIPTOR) ( malloc ( SECURITY_DESCRIPTOR_MIN_LENGTH)) ) ) return FALSE; if ( ! InitializeSecurityDescriptor ( pPipeSD, SECURITY_DESCRIPTOR_REVISION) ) return FALSE; // set NULL DACL on the SD if ( ! SetSecurityDescriptorDacl ( pPipeSD, TRUE, ( PACL) NULL, FALSE) ) return FALSE; // now set up the security attributes saPipeSecurity.nLength = sizeof ( SECURITY_ATTRIBUTES); saPipeSecurity.bInheritHandle = TRUE; saPipeSecurity.lpSecurityDescriptor = pPipeSD; HANDLE hPipe = CreateNamedPipe("\\\\.\\pipe\\PipeTest",PIPE_ACCESS_INBOUND ,PIPE_TYPE_BYTE,PIPE_UNLIMITED_INSTANCES,4086,4086,20000,&saPipeSecurity);
-
how to convert files to BMP format (Win32)What do you mean you are working in Win32. You must be using some kind of compiler C, C++, VB to use the Win32 API's.
-
Named Pipes access accross networkHi, I have created a Named Pipe with a NULL DACL security descriptor to allow everyone to access the pipe on a server application and have also created a client application to connect to it. All works fine if client and server are on the same machine but i get a 0x0000052e Logon failure: unknown user name or bad password. When using a remote client. Anybody shed some light on this will be appreciated. Ceri
-
IHTMLElement & put_innerHTML update problemTried the UpdateWindow and I also but a Sleep up to 1000ms and it still only updated 5 times then stoped unless I moved the mouse. Oh well who cares, it works now. Thanks for your help
-
IHTMLElement & put_innerHTML update problemDone a postmessage with a custom message and it worked fine. Thanks. I think that is a bit silly mind, I think that the message loop is a little slow. Although it's OK in this case. Ceri
-
IHTMLElement & put_innerHTML update problemI will try that. Another thing that I have noticed though is that it does update the first 5 or 6 times but then after that it doesnt. No matter what the update rate is 1 a second or 10 times a second it only updated 5 - 6 times.
-
IHTMLElement & put_innerHTML update problemHi, Yes i already tried that and it didn't work. If you think that being in a tight loop will be a problem how else could you do something that needed to be updated often. Another thing that i forgot to mention is that this happenes in a different thread than the IE Windows message loop. Ceri
-
IHTMLElement & put_innerHTML update problemIt's a C++ MFC app that I am developing in. Basicly the loop snippet looks something like this; pElem is a pointer to an IHTMLElement iProg is an integer that contains a progress bsText is a formated BSTR that contains the string to put in the innerHTML [code] do { iProg = GetCurrentProgress(); ... //string formating to put number into BSTR. e.g. "10%" pElem->put_innerHTML(bsText); }while(iProg != 100) [/code] The code works except that the display only updates when I move the mouse over the embedded IE control
-
IHTMLElement & put_innerHTML update problemHi, I am updating the innerHTML of a page element to show a progress, the progress string inside the DIV element only updates when I move the mouse over the IE window. if it's idle it does not update. Does anyone know a problem to this solution. Thanks Ceri
-
IHTMLElement & put_innerHTML update problemHi, I am updating the innerHTML of a page element to show a progress, the progress string inside the DIV element only updates when I move the mouse over the IE window. if it's idle it does not update. Does anyone know a problem to this solution. Thanks Ceri
-
Getting Call Stack infoHi, Thanks for the reply. This is no good to me for 2 reasons. 1. I am not using MFC 2. If i where then i dont want to output it, i need to actaully do something with the stack frames. I have managed it now by using __asm blocks and using the esp pointer. Not sure i you can help with this question. Do you know how to get the module name or HMODULE that is mapped for a particualt section of memory. e.g. A module is loaded at address 0x01000000. There is a function in that module at address 0x01000123. How can I determine which module that 0x01000123 is inside Many Thanks Ceri