DRoden's Q&A profile
.NET Development How to marshal unmanaged structure with array of unknown size
Hello, I have an unmanaged dll with defined struct in it. This structure looks like following: typedef struct _UnamangedStruct { DWORD dwNumElements; POINT points[1]; } UnamangedStruct; Also there defined function - DWORD GetUnmagedStruct(UnmanagedStruct* pUnmanagedStruct ), that returns pointer to this struct as out parameter . I need to create managed analogue of this structure, but the problem is that real size of points array is specified in dwNumElements field and can be known only in runtime, so it is not possible simply apply MarshalAs attribute with SizeConst parameter. Is there any way to call GetUnmangedStruct function and get UnmanagetStruct structure from managed code ...Show All
Visual Studio Express Editions prank program on my friend :)
im making a program to pull a joke on my friend and i need a little help. the program's background is a picture of him and whenbuttons are clicked labels appear that say a 'smart' remark and other buttons appear. i am making it so that he has to enter a specific number in a textbox in order for the program's exit button to appear. if anyone can help to lead me in the right direction i would be incredibly grateful. thanks in advance problem: 1.) how to disable the ability for the program to be moved around on the screen. 2.) how to disable shortcuts such as Alt+F4 and double-clicking on the controlmenu .to minimize the mainform when it is maximized. 3.) how to disable Ctrl+Alt+Delete, or at least to change it to an inactive window when open ...Show All
Software Development for Windows Vista IVMRWindowlessControl9.GetCurrentImage returns black frames.
Hi, I am extracting frames from a DVR-MS file created by Vista Media Center. It works fine but sometimes IVMRWindowlessControl9.GetCurrentImage(IntPtr iDIB); returns a black frame. If I run the graph and pause the thread of my application for a second and get than the current image - it works just fine. So it looks like it needs a few ms to get the frame etc... Fyi, I am using C# and develop under Vista. Is it possible to "wait" till the current frame is available and not still a black frame Thanks, Olcay I modified my code to capture a frame every second and ran it on my Media Center computer. It chugged right along even when Media Center was Full Frame playing the same file I was capturing frames ...Show All
Windows Forms Magic Issue of ZoomFactor of RichTextBox!
I write a simply code to Repro this issue. float zoom = 1.4f; string ss = this.richTextBox2.Rtf.Replace("\0", ""); this.richTextBox1.Rtf = ss; //this.richTextBox1.ZoomFactor = this.richTextBox1.ZoomFactor * (float)0.1; this.richTextBox1.ZoomFactor = zoom; When I run these code, the richTextBox1.ZoomFactor always 1.0. And after comment out the yellow line, the ZoomFactor is right to 1.4 Do you meet this issue before, and how to explain this issue Thanks! I can't reproduce your problem, directly assigning the ZoomFactor property works for me. Your Replace() call is a bit creepy though. Under the hood, RTB still works with zero-terminated 'C'-style strings... ...Show All
Visual C# C# - How powerful?
I know C# is sort of like C++, but is it as powerful as C++ Well I would really prefer to learn C++, but it seems that is the only programming language Microsoft didnt put "Absolute beginners guides" for. ...Show All
Visual Studio Sandcastle: Getting BuildAssembler Unhandled Exception
Hi, I am new to SandCastle and am in a situation where BuildAssembly is generating the following: Unhandled Exception: System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Convert.ToInt32(String value) at Microsoft.Ddue.Tools.ResolveReferenceLinksComponent.GetTemplateParameterName(String reference, String context) at Microsoft.Ddue.Tools.ResolveReferenceLinksComponent.WriteTypeReference(String reference, Boolean showContainer, Boolean showTemplates, String context, XmlWriter writer) at Microsoft.D ...Show All
Windows Forms How to capture keypress in Windows Forms?
Hi every body How can i capture key press in Windows Forms not from a Control I want the user to press any key any where in the Form and display the keypress in label like if you write in the text box I knew that i have to setup ( KeyPreview to true in the Form1 ) and use private void Form1_KeyUp(object sender, KeyEventArgs e) { } to capture the key press. But my problem is that i did not get the value correctly in the label Pressing number 5 in keyboard will give 1. If using e.KeyCode =========================== label1.Text = e.KeyCode.ToString(); NumKey will give ===>> NumPad5 MainKey will give ===>> D5 2. If using e.KeyValue ========================== label1.Text = e.KeyValue.ToString(); NumKey will give === ...Show All
Visual C# Object Oriented Programming
Hi all. Im a C++ Programmer that just moved to C# and am having problems learning about classes and objects, i just cant seem to understand it. Im not sure whether i have the wrong book, so any advice and help on the best place i can learn OOP for C# from would be much appreciated. Thanks. cgraus wrote: Ah, OK, so you didn't do much C++ The real differerce is that C++ ALLOWS OOP, C# ENFORCES it. You can't have global methods in C#, you don't even have a global namespace. Everything is inside classes, wrapped in namespaces. http://www.google.com.au/search hl=en&q=OOP+C%23&meta = Any of these will do for starters. C# does not enforce good object oriented ...Show All
Software Development for Windows Vista Vista Certification Test Case 16 Issue
Hi, I'm just going through the certification process and was advised that my .application manifest did not show up as signed when they looked at the Properties tab in WIndows Explorer. This is correct and I found it during my pre-testing as well but I actually thought it was OK as I have signed the manifests files (.application and .manifest) using mageui. I also tested using VS2005 Project Properties signing process and it did not produce the Property tab info in WE either. I know the manifests are properly signed (as ClickOnce doesn't allow them not to be I think) as when you install you get the appropriate security dialogs with links to our certificate information. My issue is that the certification testers obviously fo ...Show All
Microsoft ISV Community Center Forums Combining Control Sources for Use in Reports
Hi All, My situation: I have two fields in a table: FirstName and LastName. I want to put them in a report, but not be seperated in to two seperate text boxes (e.g. the fields may look like this: [John ][Smith ], with padding because the text box is a pre-defined length), but rather one box (e.g. [John Smith ]. Does anyone have a suggestion as to how I could get it two together in one field for view in Print Preview in a report Thanks in advance, Mat Hi Add a text box to your report ( which will be unbound) then in control source type in, or use the builder, =Trim$([FirstName]) & " " & Trim$([LastName]) ...Show All
.NET Development Using asp.net as front end for remoting.
Hi, i have a remoting server (TCP) coded with vb.net and clients that call methods on the remoting server. Now we are planning to include web based clients - asp.net. But i have tried using the same client codes on asp.net and it dont work. So i am wondering if it is possible or there are better ways for asp.net clients to communicate with remoting servers. thank you It can be done: http://support.microsoft.com/ id=323490 ...Show All
Software Development for Windows Vista Pattern for updating custom Activity Properties without completing Activity
Hi Most activities in my workflows are human activities and are therefore event-driven. The workflow blocks at each new activity waiting for a user to click "Complete" or "Approve" in the application GUI. These activities have a number of common business-logic properties, encapsulated in a custom base class. Example properties are: TargetCompletionTime, Priority, RequiresApproval etc. The values of these properties are tracked using TrackingExtracts and custom TrackingProfiles. This allows me to query the tracking service for the current state of my activities, including the values of the custom properties. The complication is that I need to be allow my users to update the values of these activity properties at any time without closing the ...Show All
.NET Development Problem with Reading Multi Page Tiff File
Hi I am trying to read a multi page Tif file containing 20 pages from one place and storing it in to different location. But only one page of the tif file is saving to the destination location... while saving remaining pages not creating. I have tried both WebRequest Class & File Stream Class . Code WebRequest request = WebRequest.Create(" http://localhost/TiffSamples/temp128.tif "); request.Credentials = CredentialCache.DefaultCredentials; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream dataStream = response.GetResponseStream(); System.Drawing.Image img = System.Drawing.Image.FromStream(dataStream); img.Save(@"d:/temp.tif&q ...Show All
SQL Server Query about SQL Server 2005 Best practices Analyzer Tool CTP's command Line interface
I am not sure of how to use the command line option of the tool.I have tried the following: SqlBPACmd.EXE -sci scansettings.xml -d (local) -u WINLOGON mydomain\administrator password -r Limited -c -a I am getting the following error: The remote name could not be resolved:'invalidurlnamegiveninconfig' Please help me with the usage of the command line option. Have you had successful installation of BPA previously The reason is even I had few issues for the first itme to use the tool, I have uninstalled and reinstalled again (by stopping Anti-virus & Anti-spyware) on my desktop without any issues. Also check syntax is valid: Example: SqlBPACmd.EXE -sci scansettings.xml -u WINLOGON mydomain \\ administrator P@ssw ...Show All
Visual Studio Team System Date Parameter not Working in Reporting Services
I have created a report in Visual Studio using serveral parameters including a date parameter. I have set the default to come from a query that brings back the most recent data in the dataset. Everything works fine. I published the report to Reporting Services and view the report, again everything works fine, until I go to the properties to excute the report. As soon as I do this I get this error: Parameter validation failed. It is not possible to provide valid values for all parameters. (rsParameterError) My date parameter is set to have a default value that is Query Based. How do I set the date parameter to have a default value of the most recent date and not receive the error. Thanks Nancy Hi Nancy, Can you ...Show All
