Answer Questions
winstonSmith VC# Express crash with form designer
Hello everyone, my first post here :) I have a problem viewing my Form in Form Designer; however, this only happens with the current project i'm working on. When I try to view my form i get the following error: One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. Error in the application. Hide at Microsoft.DirectX.Direct3D.Effect.FromFile(Device device, String sourceDataFile, Macro[] preprocessorDefines, Include includeFile, ShaderFlags flags, EffectPool pool, String& compilationErrors) at Microsoft.DirectX.Direct3D.Effect.FromFile(Device device, String sourceData ...Show All
ADG why does the console appear ?
I use Visual C# 2005 Express to build a project following the tutorial01 of the DXSDK tutorials , when I debug it,the console displays first,then the D3D basic window .But I do the same with the sample,it only displays a D3D window.So what is the matter open the project properties ,choose the application label,then change the output type with windows application. ...Show All
BhuttCrackSpackle retrieving network interface IP addresses
Hi, I need to overwrite the DSCP byte for outgoing packets on a given socket. Currently, I am enumerating interfaces with TcEnumerateInterfaces() and plan to use TcAddFlow/TcAddFilter() to add a flow with a new QOS_DS_CLASS object. However, I need to match the interface from TcEnumerateInterface to the one the socket is bound to by comparing IP addresses, and here I am running into a problem, namely that I don't seem to be able to interpret the NETWORK_ADDRESS correctly. The address I am trying to interpret is of type NDIS_PROTOCOL_ID_TCP_IP, so I casted it to a NETWORK_ADDRESS_IP structure, but the ulong representing the IP is coming back as 0xCCCCCCCC. My alternative that I haven't tried yet is to use the IPHelper API to find the interf ...Show All
SQL Server Management Studio generics: T Create<T>() where T : MyClass, new(...)
Is there a way to enforce a non default constructor And if not, why not ! I wrote a class that implements a constructor that is in need of an XmlDocument as a parameter. Several other classes inherit from this base class. Now I would like to write a generic create method that instantiates one of the child classes and sets some base properties: class MyClass { public MyClass(XmlDocument xmlDoc) { ... } public ElementName { get { .. } set{ ... } } } class ChildClass1 : MyClass { ... } class ChildClass2 : MyClass { ... } class MyClassFactory { ... public T Create<T>(XmlDocument xmlDoc) where T : MyClass, new() { T myClass = new T(xmlDoc); ... } ... } Obviously that does not work because the generic all ...Show All
Wedgetail ListView Selected Item Move to Another Control
When I select an item in the list view I'm using the SelectedIndexChanged procedure to run some code. At the end of the code I would like the cursor to be be put in TextBox TB1. When I use TB1.Focus() the system still keeps the items in the ListView Selected to have the focus. If through the code I change the selecteditem everything works. The problem is when the user clicks the item. Thanks for everyones assistance. Hi, According to what you said, it's quite nature. Because you put the code in the SelectedIndexChanged event of the listview control, only when the listview's selected item changed the code can be excuted (the textbox get focus). So, if you click the item, it does not change. That's the ...Show All
rwbogosian Caret Position SelectionStart, Simple?
This should be simple... I have a maskedtextbox on a form, and I've added an OnEnter event which I want to set the caret position to zero (it defaults to the end). From what I've read you should use the SelectionStart Property to do this, but I can't get it to work. In the debugger it seems to reflect the correct selectionStart position but even though I set the value the caret doesn't get repositioned. I've also tried setting the selection length to various numbers along with the selectionStart... Any help would be greatly appreciated. It works fine with me....... I dont know why its not workign for you. Try it in a seperate application, Use TextBox on Form and then on UserControl see behaviors. I hope this will w ...Show All
tkroll Get MAC address of client machine using C#
How to get MAC address of client machine using C# Not looking for remote machine MAC Address. In this code, I have to hardcode ComputerName, root and what does it mean cimv2. I have to run this code on unknown clients and not in position to hard code any thing. As per my requirement, If somebody execute this code in client machine then it should return MAC address without any input parameters. Kindly let me know your comments. ManagementScope theScope = new ManagementScope (" \\\\ computerName \\root\\cimv2 " ); It is asking following input parameters. :- sDomain, sUserName, sPwd. As per my requirement, I can not provide following parameters. As per my requirement, without passing any input pa ...Show All
Dwatney Some questions about functionality in VS2005
Hi, just some questions about VS2005: 1. Is there a possibility to add the //, which are added with the comment out button, at the beginning of the line 2. Is there a function which finds the missing using directives and adds them on request (Like the 'Fix imports' function in netbeans, for those who know it) 3. Is there a way to add new tabs (e.g. when opening a file) at the _end_ of the tabs row and not at the beginning Thanks for any help on any of there questions! Hello All. ctusch: Well, the short answer is nope, nope, and nope. While the VS IDE is very configurable, it's not infinitely so. I suppose they have to draw the line somewhere. HTH. Alright, thanks for the answer! ...Show All
Andrew Clark inserting theEntry.name to treeView.
Hello! i got problem when inserting entryes to treeView. How i can insert the "treeView1.Nodes.Add(directoryName, directoryName);" so it will be see only one time. its creating a rootnode named by directory for X times, and x is number of files inside the folder Here is the code: public void viewzipfile() { try { treeView1.Nodes.Clear(); ZipInputStream s = new ZipInputStream(File.OpenRead(@"d:\file.zip")); ZipEntry theEntry; while ((theEntry = s.GetNextEntry()) != null) { string directoryName = Path.GetDirectoryName(theEntry.Name); string fileName = Path.GetFileName(theEntry.Name); // need somehow make this single time, this one creates a new node foreach theEntry.name... treeView1.Nod ...Show All
Andrea Williams What database are you using?
Daer Srs. I actually would like to know what databases do you usually use.. or what would you recomend for a not very simple winapp how do you mean "what database do you usually use" Everyone has their own way/product they use. It also depends on the type of application. Please tell us the type of application you are creating. Some people use Xml to store data locally, which is ideal for a mini mini database some people use MS Access locally to store data instead of using SQL Server - this would be a better approach if you are not doing major database stuff some people use SQL Server because not only is it industry standard but because it is good at managing and processing large amounts of data, which has more poten ...Show All
Mohsen Kokabi Why is not OK to pass in a Collection<int> parameter in a Web method?
Hello there. I have a web service that contains the following web method: using System.Collections.ObjectModel; ... [ WebMethod ] public void GetUsers( Collection < int > userIds) { // Do something here } Now, I have a Windows client that web references the above web service and consumes the web method: using System.Collections.ObjectModel; ... private void GetUsersData( ) { Collection < int > myUserIds = new Collection < int >(); myUserIds.Add(1); myUserIds.Add(2); myUserIds.Add(3); myUserIds.Add(4); myUserIds.Add(5); localhost. Service myService = localhost. Service(); myService.GetUser(myUserIds); // Problem here!!! } The ...Show All
John Marsing MemoryStream instead of StreamWriter Problem
I have a method which make a file with StreamWriter and then save it to database. I want to make a new method base on this method but using MemoryStream instead of StreamWriter. 1- When I give the byte[] in constructor and then store it in database, everything is OK but When I try to use Write Method of memoryStream nothing happend!!! it means that just an empty file will store to the database!) this means that it works OK with the folowing line: MemoryStream memStream = new MemoryStream (byteArray); but if I use the folowing lines instead, it doesn't work. MemoryStream memStream = new MemoryStream (); memStream.Write (secondString,0,secondString .Length ); 2-I have used Write and WriteLine methods in ...Show All
Frank J DeFalco How to Create a URL syntax checker in C#
I would like to create a URL syntax checker so that can verify a cerrtain URL not a phish site. But I am also aware that some URL have valid syntax but is still a phish site. To answer this, I am looking for some measures on how to verify a URL and its correct DNS equivalent. I am doing a project of mine as one of our requirements and I have decided to create a web browser (already done) and I have included there 3 anti-phish tools. One of the tools is to check for URL syntax error. i have searched for such but has given me no good results that can be of any help to my project. I was hoping that some of the bright minds here could help me or enlighten me in my search. Thanks. this onBblur event is on text box n it is invok ...Show All
Yayfurby How to write Debug directive in CS file?
In aspx file, it is written as "<%@ Page Language=C# Debug="True">". In CS file, how to write it. My purpose is to get a pdb file after compilation of the cs file into dll file, so that I might trace the line number once some errors occur in web application. Thks a lot! in ASP.NET it is done by web.config file. You can specify debug version like this < system.web > < compilation defaultLanguage ="c#" debug ="true" > </ compilation > </ system.web > and release like this < system.web > < compilation defaultLanguage ="c#" debug ="false" > </ compilation > < ...Show All
Emadkb Why can't maximum length of the queue of pending connections more 5?
Although the listen function is called: SOCKET s; listen(s, 10); or listen(s, SOMAXCONN); But maximum length of the queue of pending connections is always 5. How to set a value which is more 5 Thank! Hi Mike, Here you have replied to a question that maximim backlog connections queu is 5 but in MSDN ,they have replied with maximum value as 10.Could you please clear me your source of information.I am confused which set of information is correct .For reference i am posting link of thet msdn article.You can refer that link http://msdn2.microsoft.com/en-us/library/system.net.sockets.socket.listen(VS.71).aspx Waiting for your reply Thanks Amit ...Show All
