Hello!! I have created an XML document programmatically using DOM and MSXML4. As one of the data items I have added byte data which is actually a processed guid. Now combination of characters generated as GUID and stored as byte format in the xml document, is shown properly. But for some combination when I open the document it says "An invalid character was found in text content" and the document fails to display any data. This happens in Windows 2000 and I have seen this once or twice in Windows 2003. The "corrupt" file opens without any problem in Windows XP. I am using encoding UTF-16. IE Versions I am using are: In Windows 2000 6.0.2800.1106 – SP1 In WinXP 6.0.2900.2180 – SP2 Can someone help!!! Sandeep
Sandeep Shetty
Posts
-
Invalid character error in XML file -
MSCS cluster questionHello!! I am running an application in a MSCS cluster node. I want to get the name of the virtual cluster name and not the cluster node name. GetComputerName returns the cluster node name (the machine in which the applicaton is run). I want to get the cluster name (virtual cluster server name), or the name of the cluster which is exposed to the outer world. I created an generic resource through the Cluster Administrator. I chose the option "Use Network Name for Computer Name" in the resource properties. The resource was created and indicated that it was offline. When I brought it online (through a menu option in the context menu) my application executed and picked up the virtual cluster server name and not the cluster node name. This is excatly what is required. But the application takes the virtual cluster server name only when it is run from the cluster admin and when it is executed manually (by double clicking the application) the application again takes the cluster node name. So bottomline, how to obtain the virtual cluster server name of the cluster just as you get the machine name from GetComputerNaame() when you run the application independently. Sandeep
-
MSCS Cluster QuestionHello!! I am running an application in a MSCS cluster node. I want to get the name of the virtual cluster name and not the cluster node name. GetComputerName returns the cluster node name (the machine in which the applicaton is run). I want to get the cluster name (virtual cluster server name), or the name of the cluster which is exposed to the outer world. I created an generic resource through the Cluster Administrator. I chose the option "Use Network Name for Computer Name" in the resource properties. The resource was created and indicated that it was offline. When I brought it online (through a menu option in the context menu) my application executed and picked up the virtual cluster server name and not the cluster node name. This is excatly what is required. But the application takes the virtual cluster server name only when it is run from the cluster admin and when it is executed manually (by double clicking the application) the application again takes the cluster node name. So bottomline, how to obtain the virtual cluster server name of the cluster just as you get the machine name from GetComputerNaame() when you run the application independently. Sandeep
-
C++ class for CSV database.hello!!! I want to sort some data in CSV format. It would be like data in a table.I also want to sort a column. Is there any C++ classes available which does this? thanks..
-
Accessing VRAM from user applicationThank you for your answer. I am now able to get the total video memory which is free and total video memory in the system by using function IDirectDraw::GetCaps(). I am now able to get the pointer of the surface by using DDSURFACEDESC2 structure and IDirectDrawSurface::Lock(). I have locked the surface using the function IDirectDrawSurface::Lock(), and then went on to write data in the surface till total memory. i.e. I am filling the total video memory with my data. The data is also seen on the screen. But after the screen is completely filled, the screen can be refreshed again by pressing alt+tab and again ALT+TAB (or if the screen is refreshed by some other event). My question is if I have locked the surface how does the screen get refreshed? I have written the data in blocks of 4 KB. I am reading the data back and then comparing it. If I increase the size of data to be written from 4K to 5K then my compare fails. Even if I increase the data size to 8k (to see if it has to do something with page size) then too, the compare fails.. Can anyone tell me why 4096 so special? I also need advise on feasibility of following: While writing data on whole of VRAM can I show the data written on anypart of VRAM on the screen in a window? Can anyone help me out? Regards, Sandeep
-
Accessing VRAM from user applicationHello!! Thank you for your reply. I have one more question. Does DirectDraw allow the application to get the whole of the VRAM or just a part of it? Can the full VRAM be tested by writing data to it and then reading it back? Sandeep
-
Accessing VRAM from user applicationHello, I have some queries 1. Is it possible to directly access Video RAM from User Application? 2. If not, How to read/write data directly to Video RAM ? When searched, I found that certain IOCTLs ( like IOCTL_VIDEO_MAP_VIDEO_MEMORY ) available for Video RAM access. But It seems that these IOCTL are being used by the video driver. Can we have access to these IOCTLs and How? Can you provide some clue as to how we can go ahead. Regards Sandeep
-
RTC data (date time) retreival problemHello!! Thank you for your answer. But I am not using statements like "out 0x70, 2". I am using the macro WRITE_UCHAR_PORT and READ_UCHAR_PORT and pass 0x70 and 0x71 as parameters. I do not think we have to claim addresses and the macro does require on its own. I cam across a small article at site http://www.pcprofile.com/timepiece.HTM#overview There is some problem in chip set INtel 810. Can you please on this? Hope I am on the right track. Please give your suggestions. regards,Sandeep
-
RTC data (date time) retreival problemHello All, I have written a driver which retreives the RTC value. I have used WRITE_UCHAR_PORT and READ_UCHAR_PORT macros. They operate on port 0x70 and 0x71 respectively to get the RTC value. They are run in a loop of 12. I get the value properly if run once. But when the values are retreived continously , over a time it gives all the values as ff. i.e. the date and time value which are retreved are all 'F's. The driver does not give any error. I.e. the driver is correctly binded and everything seems to be properly executiong apart from the fact that the values reteived for date and time is all 'F's. Can it be the case that RTC is busy updating some registers (at the time of giving error values - all F's ) so invalid values are retreived by the driver. The driver is able to retrieve correct values for once or twice but only during a long run it gives problem. Could there be some problem in the hardware or am I missing something. I am running the driver in Windows XP home OS and on Intel chipsets. Can you please suggest as to what could be the problem. Any help would be highly appreciated. Thanks and regards, Sandeep
-
Retrieving System information in Windows 98Hello!! I want to retrieve the number of services (and their names) which are running in the system. I can do this with EnumServiceStatus() for OS NT-onwards. Can anyone please tell me how it can be done for Windows 98. I also want to get the DeviceDriver information. The same information which is got by, EnumDeviceDrivers() and GetDeviceDriverBaseName() apis for OS Win NT onwards. I want the same info for system with Win 98. i.e.. I want the dlls and the sys file (or vxds) which are loaded in the system with Windows 98 OS. Have a nice day Sandeep
-
Enabling disabiling Hibernate support programatically.Hello!! We can enable or disable Hibernate support by using the setting in the control panel-> Power options-> hibernate tab. when this check box is checked the system makes a file hiberfile.sys in the operating system root dir and reserves memory. if the check box is unchecked the system deletes the file. I want to do this programatically. I have used the function NtCallPowerInformation() using SystemReserveHiberFile, but this is not working. Can anyone tell me if it is working at their end and if I am missing something or there is some other method to do this. Thanks in advance.
-
Retrieving Stand-by and HIbernate TimeHello!! There is a setting in the control panel -> Power Options-> Power schemes tab, for setting Standby and Hibernate time. i.e. after what unit of time the system should go into stand-by state and similar combo box is also present for hibernate state. I have tried to use the API GetCurrentPowerPolicies(). In this, a structure is filled for POWER_POLICY->MACHINE_POWER_POLICY. In that, according to MSDN, values for stand-by and hibernate should get filled , but it does not. I am getting the time for disk spindown and video time out and also the Power Scheme, but I am not getting the standy-by and hibernate time. Can anyone of you tell me how to obtain the standby and hibernate time. Thanks in advance.
-
Getting Stand-by and Hibernate TimeThere is a setting in the control panel -> Power Options-> Power schemes tab, for setting Stanby and Hibernate time. i.e. after what unit of time the system should go into stand-by state and similar combo box is also present for hibernate state. I have tried to use the API GetCurrentPowerPolicies(). In this a structure is filled for POWER_POLICY->MACHINE_POWER_POLICY. In that accoding to MSDN values for stand-by and hibernate should get filled , but it does not. I am getting the time for disk spindown and video time out and also the Poer Scheme, but I am not getting the standy-by and hibernate time. Can anyone of you tell me how to obtain the standby and hibernate time.
-
Tapi - (1 server n-clients)Hello! I want to establish data sessions between 1 server and n-clients. The data communication would be progressing between 1 server and n-clients simultaneously. i.e.one server and many clients.i.e. N client machines would be connecting and communicating with 1 server machine. Once the connection is established, server would be accepting the data sent by the clients and then the same data would be again sent back to the same client who sent it to the server, through modem. The application should have the capability to do data transmission and receive simulnateously with n-clients. The application is supposed to run on Win 98,WinNT, WIN 2000 and Win XP. I am using C programming and TAPI 2.0. I do not want to use COM/DCOM. Can you please tell me if it is possible to build an application of n-clients and 1 server using language C, TAPI 2.0 and without COM/DCOM. I already have built an application for data communication between single client and single server. Data transmission is done through the COM port to which the modem is connected. While programming for 1-server 1 client I have made use of async comm by using CreateEvent(), ReadFile(), WriteFile() (for communciation between COM ports), WaitforSingleObject() and GetOverlappedResult(). The configuration I am using is : There is a modem connected to the server machine and there are n (say 4) client machines. Each client has a modem connected to it. The data communication is via the modem through the COM port to send and recieve data (data communication--> client to server back to client). If suppose, the server is waiting for connection and a client connects to the server, the connection is established and the data communication is started. Now another client attempts to connect to the server, will that client be able to connect to server ?? (as the first client is still holding the line and busy in data communication). Do I have to have some other specialised hardware so that other clients may also connect to server simultaneously. (same as in EPBX systems). or do I need to have some software which will help me connect n-clients to 1 server. Could you please guide me amd give some idea about how to go about solving this problem. Your advise would be of great help to me. Thanking you. With Regards, Sandeep Shetty
-
TAPI ProblemHello!! I am building a TAPI application in which there is one server and many clients.i.e. N client machines would be connecting and communicating with 1 server machine. Once the connection is established, server would be accepting the data sent by the clients and then the same data would be again sent back to the same client who sent it to the server, through modem. The application should have the capability to do data transmission and receive simulnateously with n-clients. The application is supposed to run on Win 98,WinNT, WIN 2000 and Win XP. I am using C programming and TAPI 2.0. I do not want to use COM/DCOM. Can you please tell me if it is possible to build an application of n-clients and 1 server using language C, TAPI 2.0 and without COM/DCOM. I already have built an application for data communication between single client and single server. Data transmission is done through the COM port to which the modem is connected. Can anyone please help and advise as to how I could go on to build a n-client 1 server TAPI application. Any help would be higly appreciated. Thanks Sandeep
-
Disabling the "windows key"Hello!! I have a window which covers teh full screen.. I do not want the image on the window to be disturbed. It will be disturbed if teh user presses the windows key i.e. the key which activates the start menu.. Can I disable this key.. In short the user should not be able to disturb teh image by pressing this key.. Please advise how??? Sandeep
-
Battery Discharge problemHello!! Can anybody tell me how can I discharge a Battery quickly on a LapTop... Can a graohics application with complex calculations discharge a battery or can playing a Video CD help in discharging the battery at a quick rate.. Please advise.. Sandeep
-
COM PORT PROBLEMThanks for your reply.... I tried opening the COM port by CreateFile() and validated it by using GetFileType(). It was successfull and it seems that the handle we are getting is valid one. Following is the code we tried with setting COMM properties but WriteFile() gives an error. hHandleForWaitEvent = CreateEvent(NULL, FALSE, FALSE, NULL); overlapped.Offset = 0; overlapped.OffsetHigh = 0; overlapped.hEvent = hHandleForWaitEvent; hHandleForCOMPort = CreateFile("COM2", GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, //CREATE_ALWAYS, //NULL, FILE_FLAG_OVERLAPPED, NULL); if(GetFileType(hHandleForCOMPort) != FILE_TYPE_CHAR) { MessageBox(NULL, "INVALID_HANDLE", NULL, 0); } sprintf(str1, "HANDLE of com port = %d", hHandleForCOMPort); MessageBox(NULL, str1, NULL, 0); //Get comm properties GetCommState(hHandleForCOMPort, &SerialDCB); GetCommProperties(hHandleForCOMPort, &commprop); GetCommMask(hHandleForCOMPort, &fdwEvtMask); GetCommTimeouts(hHandleForCOMPort, &commtimeouts); //Set COM TimeOuts commtimeouts.ReadIntervalTimeout = 3000; commtimeouts.ReadTotalTimeoutMultiplier = 0; commtimeouts.ReadTotalTimeoutConstant = 0; commtimeouts.WriteTotalTimeoutMultiplier = 0; commtimeouts.WriteTotalTimeoutConstant = 0; SetCommTimeouts(hHandleForCOMPort, &commtimeouts); //fAbortOnError is the only DCB dependancy in TapiComm. //Can't guarentee that the SP will set this to what we expect. SerialDCB.fAbortOnError = FALSE; //SerialDCB.BaudRate = 115200; //SerialDCB.ByteSize = 8; SetCommState(hHandleForCOMPort, &SerialDCB); strcpy(str1, ""); //write it to COM port bResult = WriteFile(hHandleForCOMPort, 'A', 1, &dwBytesWritten, &overlapped); if(bResult == 0) { MessageBox(NULL, "WriteFile() failed", NULL, 0); //dwLastError = GetLastError(); sprintf(str1, "Return value of GetLastError() = %d", GetLastError()); MessageBox(NULL, str1, NULL, 0); if(dwLastError != ERROR_IO_PENDING) MessageBox(NULL, "dwLastError != ERROR_IO_PENDING", NULL, 0); else MessageBox(NULL, "dwLastError == ERROR_IO_PENDING", NULL, 0); } MessageBox(NULL, "SUCCESS", "SUCCESS", 0); /*************************************************************/ :( :(
-
COM PORT PROBLEMHello!! Thank you very much for your help , but the problem persists.. I have double checked and the error I am getting is because of the WriteFile() iteself.. I cannot open the COM port by CreatFile() because the connection is established and hence if tried to open the COM port it gives error "Access denied".... Please help..
-
COM PORT PROBLEMThanks for your mail.. I have managed to print the device name (modem name) connected to COM1. So I think I am getting a valid handle to the COM Port. Do I have to use "Overlapped" structure at the sending end as well as the receiving end.. i.e. for WriteFile() as well as ReadFile().. and would there be a problem if the code with the use of "OverLapped" stucture give any problem if the code is run on WIn 98 or WinNT.. I want to make the code OS independent it should run on atleast WIn 98.Win NT,Win ME,Win 2000 and Win XP. Please help