Tamila's Q&A profile
Visual Studio Express Editions arrays
Hi, what is the best way to compare and extract data from arrays with null characters, like char a[]={0x61, 0x00, 0x61}; (something like strstr, strcpy on strings) thanks MarianL wrote: what is the best way to compare and extract data from arrays with null characters, like char a[]={0x61, 0x00, 0x61}; (something like strstr, strcpy on strings) MarianL wrote: I am coding only C If these are meant to be arrays of arbitrary bytes, you might want to define a data type for them, something like typedef unsigned char byte ; How will you be keeping track of the sizes of things It looks like you want to use the counted versions of functions, comparable to strncmp()and strncp ...Show All
Audio and Video Development How play DVDs?
Hi, I'm trying to make my own application to play multimedia files using Windows Media Player. I usually play files using .url = "filename" . How can I play a DVD Try asking this question on the Windows Media Player newsgroup: p://www.microsoft.com/windows/windowsmedia/community/newsgroups/WindowsMedia/default.mspx dg=microsoft.public.windowsmedia.player&lang=en&cr=US ---------------------------------------------------------------------------- Mike Wasson, SDK Documentation This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use. (c) 2007 Microsoft Corporation. All rights reserved. ...Show All
Visual C# Marshalling issues when marshaling a struct with other structs as members in c# for ansi c extern call
Ok Any help on this would be useful. I have a c# struct [StructLayout(LayoutKind.Sequential,Pack = 4,CharSet = CharSet.Ansi)] public struct RF_INTERFACE { public ushort NumTaxes; public ushort NumEarnings; public ushort NumDeductions; public ushort NumWeeks; public RF_EMPLOYEE_ENTITY Employee; public RF_EMPLOYEE_WORKSITE EmployeeWorkSite; public RF_EMPLOYEE_TAX_ENTITY EmployeeTaxes; public RF_EMPLOYEE_EARNING_ENTITY EmployeeEarnings; public RF_EMPLOYEE_DEDUCTION_ENTITY EmployeeDeductions; public RF_EMPLOYEE_WEEK_ENTITY EmployeeWeeks; } which is a mirror of the c struct from a header file. typedef RF_STRUCTURE struct { RF_USHORT NumTaxes; RF_USHORT NumEarnings; RF_USHORT ...Show All
Visual Studio Express Editions how to make a big string array
Hi, I want to want a group of files which have different extensions, such as jpg, gif, bmp,png etc.. I am thinking to create a string array for each extension type, and then combine all these string arrays into one big string array, how can i do that below is the code to generate the arrays, then how can i continue to combine them into one big array Dim theFiles As String() = System.IO.Directory.GetFiles(FolderViewer1.CurrentFolder, "*.jpg") Dim theFiles2 As String() = System.IO.Directory.GetFiles(FolderViewer1.CurrentFolder, "*.gif") Dim theFiles3 As String() = System.IO.Directory.GetFiles(FolderViewer1.CurrentFolder, "*.bmp") Dim theFiles4 As String() = System.IO.Directory.Ge ...Show All
Visual C# bool and objects
I have an collection of objects(arraylist)...in my list is want to check to see if properties within my arraylist have changed by using a _IsDirty flag...but i get an error saying cannot convert object to bool can anyone help me out here [code languge="C#"] for ( int x = 0; x < ArrayList.Count; x++) { if (Convert.ToBoolean(Arraylist[x]) == this ._IsDirty) { } [/code] how should this be yes that looks ok. A better way would be to use the Generic List<> collection as you don't have to do any casting as you are right now....the Generic List<> will hold a type of an object (Tracking.BusinessObjects.OrderLegDetail in this case) which means you don't need to do any casting and can ac ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Drawing colored meshes using own effect
I want this easy thing to work -- but apparantly it's not that easy for me. I simply want to load a colored mesh from a file, and draw it on my screen using a custom effect. The mesh(es) load just fine in DXViewer, and also no problem when I'm using the BasicEffect to draw the mesh. The mesh is drawn at the correct position/scale, but the colors are wrong. They seem to be random, and sometimes they change during runtime. I've posted the relevant XNA code below. Of course it's incredibly rediculous to put all this code in the Draw method, but it's just to show you all the relevant code together. So here we go: protected override void Draw( GameTime gameTime) { CompiledEffect compiledEffect = Effect .CompileEffectFr ...Show All
SQL Server Grouping Question
HI there all Here is my question for the day. I am creating a report based of a table where i have employee information and hours that he has worked, I need to have the total of all hours, and also the total of Billable hours. there is a field called Billable hours. Anyways, In my layout section, I get the correct total hours, due to the groupin g which is easy. I also added a new field to my Query for the field hours with an alias of billable hours. I need to put some sort of filter for this field. so that This will add up the hours that are billable, (bullable =true.). I tried to do this with the query and I had no success. I tried thought the report layout, on the properties of that field something along the lines of =Field ...Show All
Windows Forms How to make Invoice Form
By using VB.net How I can design Invoice form Belongs Customers Thanks and waiting your replay Well it should be, if it works then it works. There are other ways about inserting data more securely and faster in SQL but I am guessing you do not want this just now. The code you have does 1 task it is meant to do - to update the field of a table with the quantity. ...Show All
Visual Studio Tools for Office Office 2007 Custom Ribbon
I have created a new project and im trying to follow Ted Pattison's "Office Developer Screencast" for creating your own ribbon. I just added Microsoft.Office.Core to the project but it won't let me add IRibbonExtensibility from the drop down selections,I have installed the latest SDK (Sept 06) and Power Toys, also the Visual Studio 2005 tools for Office Second Edition Beta, is there anything else i need namespace TestMacros { using System; using Extensibility; using System.Runtime.InteropServices; using Microsoft.Office.Core; [ GuidAttribute ( "BBF36B84-9826-49C1-883F-41F650064095" ), ProgId ( "DPPMacros.Connect" )] public class Connect : Object , Extensibility. IDTExtensibility2 , IR************** ...Show All
Visual C# Math: Round up number. eg 1234 / 50 = 6
I have a dataGrid and i wish to produce page buttons for next and back. Therfore i need to know how many pages i will need to for my data Eg, i have 1234 rows of data and each page will contain 50 rows. So 1234 / 50 = 24.68. So I need 25 pages How do i round up a number so 1234 / 50 = 25 . Thanks. Paul in this particular scenario, we would want a double division and not the truncating remainder behavior of integer division. my procedure also works and that is just my point. a Ceiling call after division obviously did not work because of integer division so one can use double division instead. there are a number of ways to solve the poster's problem and mine is just one of them, and so are the o ...Show All
.NET Development dotnet 3.0 general question
I just installed the .net 3.0 sdk on my home computer with visual studio 2005. Does installing the framework have any effect on 2.0 projects Like will i have to say in visual studio what to compile under I'm confused about if there is a compile as 3.0 option, or if everything still compiles as 2.0. Also, if it is 2.0, what do you include to use new language features like var I'm confused about this and i also want to install it at work, but i don't want to mess up any of our projects. What about raw language enhancements then like for instance "var" Do you have to include a using statement or dll for them How does it know to include it ...Show All
Visual Studio Team System Who wants a FxCop VS2005 add-in?
Hello, I have written a simple add-in for VS 2005 to enhance integration with the IDE for those who are not using the Team System version of the product. I am planning to release it to the open source community but I'm wondering whether there is much interest in doing so. Currently the add-in does the following things: Select one or more FxCop warnings in the Error List then right-click to copy C# code for SuppressMessage attributes to the clipboard. Select one or more FxCop warnings in the Error List then right-click in the code editor window to insert C# code for SuppressMessage attributes at the current insertion point. (Saves the work of copying to clipboard, then clicking back to the editor and pasting.) Double-click on ...Show All
Visual Studio 2008 (Pre-release) XBAP image resource problem on Server 2003
i've got another deployment problem with XBAP on Server 2003 (works fine from IIS on XP Pro) : this time the XBAP app is requesting an image with a pack URI : pack://siteoforigin:,,,/foo/abcd.jpg and that is loaded with BitmapFrame.Create() which throws an exception : System.ArgumentException: The mime type registered with the system does not match the mime type of the file. at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle) at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Ur ...Show All
Visual Basic control panel items
Hi there, I'd like to ask how could i retrieve the name of the items on the control panel. I know they are .cpl files and know how to run them, but how could i get the name of them thnx; Here's a 'not foolproof', 'bruteforce' way of looking at them. Imports System.io Public Class Form1 Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim fvi As FileVersionInfo = Nothing Dim files() As String files = Directory.GetFiles( "c:\windows\system32" , "*.cpl" ) For Each x As String In files fvi = FileVersionInfo.GetVersionInfo(x) TextBox1.Text = TextBox1.Text & Path.GetFileName(fvi.FileN ...Show All
.NET Development C# Checking for Hex '00' in a file
Hi I'm trying to convert from COBOL programming to C# and need to check for what I call Hex zeroes in a file. I've got the file open using open File Dialogue and can read lines of text and have also defined a string of hex zeroes as follows; int lowvalues = 0x000000; However I'm not sure how to go about searching each line read for this value My Readline is as follows. Text = sr.ReadLine(); Any replies should be aimed at the level of an 8 year old ! Thanks convert this number to string variable: string StrToFind = Convert.ToString(lowvalues); and search for it in every line: int pos = Text.IndexOf(StrToFind, 0, Text.Length);// IndexOf method finds a beginning position   ...Show All
