keroed1's Q&A profile
Windows Forms Using an icon for the assembly file AND the form
Hello, when I want to add an icon to my application, I need to set it as the assembly icon in the project properties and then again in the form where it should appear. If I only set it in the project, the .exe file has the icon displayed in Explorer and the application's taskbar item also shows the icon, but when switching tasks with Alt+Tab, it's missing; not sure about the form title bar itself right now. When I only set the icon for the form, then it's displayed everywhere but not with the .exe file itself. So, to get this icon everywhere, I need to insert it twice, resulting in the double filesize, regarding the icon size. I've tried to use a resource file, but I couldn't add one to my project settings because the Designer only lets me ...Show All
Visual C++ C2440 with Generic type
I'm extemely puzzled by this compiler error, because I cannot see a rational explaination for why it should occur. public ref class Class1 { }; generic<typename T> where T: Class1, gcnew() public ref class Gen { public: Gen() { } T value(bool condition) { if( condition ) return gcnew T(); else return nullptr; // Error: C2440 } }; public ref class test { public: test() { Gen<Class1^> gen = gcnew Gen<Class1^>(); Class1^ x1 = nullptr; Class1^ x2 = gen->value(false); } }; // C2440: 'return' : cannot convert from 'nullptr' to 'T' Try the following if(condition) return gcnew T(); else return static_cast<T>(static_cast<Objec ...Show All
Visual C++ VC++ 2005 redistributable
Hi, I'm trying to get an MFC application compiled with VC++ 2005 to run on a machine with VC++ 2005 express. There seems to be a problem with the manifest (which I don't fully understand despite reading the info on msdn). The original error in the event log when I tried to run it said Microsoft.VC80.CRT not installed so I installed the platform SDK and also copied over the atlmfc directory from the development to target machine. I also downloaded the VC++ 2005 redistributable and installed it. When I installed it, I didn't get any confirmation that the installation was successful, the installer appears to quit after displaying the progress bar. Is this the correct behaviour Now I no longer get any messages in the event log but when I try ...Show All
Windows Forms recover file
I create a installation msi file and it work fine. However, some of my clients need delete part of the files from disk. And when they do this, next time when they run the application, the application will automatically try to recover those files back. Is there any way to avoid this recover process Thanks ...Show All
Visual Studio Express Editions progress bar....please help
can anyone please help with this progress bar Dim i As Integer Dim TrackLength As Integer = 100 Dim TrackPosition As Integer = 0 Dim TrackPositionPercentage As Integer = 1 Bar1.Value = 1 If TrackLength > 0 Then TrackPositionPercentage = CInt (TrackPosition / TrackLength * 100) For i = 1 To 100 Bar1.Step = 1 Next (i) End If Hi, Did you enable the timer It is better to use the PerformStep method of the ProgressBar in order to increase its value. Here is a sample code of a ProgressBar: http://msdn2.microsoft.com/en-us/library/system.windows.forms.progressbar.aspx Greetz, Geert Geert Verhoeven Consultant @ Ausy Be ...Show All
Visual Studio Express Editions Visual Studio express C++ forms controm template
Hello, I'm trying to make a new forms control project but the template is missing in the new project screen. Maybe it's normal but I don't know, so I'm looking for an answer. If it should work what should I do to recover this problem Thank you in advance. Bye. In most cases, the missing templates/priject types are limitations in the Express edition. You might find them in larget editions. The folks at http://forums.microsoft.com/MSDN/default.aspx ForumGroupID=2&SiteID=1 might be able to confirm. Thanks, Ayman Shoukry VC++ Team ...Show All
.NET Development MSHTML DOM node -> MSXML Document
Hi list! I'm working in Javascript on a page with a well-formed HTML table. The page is foo.html. I can do var node = document.getElementById( 'tableid'); which returns the MSHTML DOM node. However, now I want to perform XSLT on this node's html. Problems I'm having: 1) innerHTML returns (as we all know) not-well-formed code that I cannot load into an empty MSXML document (loadXML complains about the lack of quotes/form). 2) importNode from MSHTML DOM to MSXML DOM gives Type mismatch. 3) Looping across the entire element's DOM tree and reconstructing a well formed xml string "works" but it's really slow. 4) I could uplaod innerHTML to a web service running W3C tidy, but that requires a server request, and I don't want to require ...Show All
SQL Server Identifying a table update / insert / delete
How to find out that a table has changed. For example if a table has 50K rows, and if any update, insert, or delete was made it should be captured without using any trigger. Is it possible to get such information from any of the system table or DMVs This will not help, b'coz it also means that the sps that uses the existing tables should be modified. Someone pointed out that there is an existing system table where the updates, insert, delete row count are maintained. Is there any such info that is available with SQL 2005 ...Show All
Visual C++ Using the Visual Studio buttons
Hi guys I have been working on a project in Microsoft Visual Studio 2005 Pro and now that its complete i wanted to optimize its looks but when i compiled the project and started my project.exe file all the buttons on it looked like those in visual c++(you know, those grey ones) although they should be white in color.(like those in Visual Studio 2005) Is there any way to use the visual studio 2005 pro buttons Thanks ah thanks for the replies guys but thats not exactly what i meant. What i mean is that sometimes when i make a really small app(with only one button) and then compile it then the color of that button is white(the default Visual Studio 2005 Pro style) but if i make it bigger for ex if i add more stuff to the app like more ...Show All
.NET Development XML Validation Bug .NET 2.0
Hello, In my recent experience with .NET 2.0 i faced a bug in of xml validation in .NET 2.0. I created a xsd that contains an simple element (of type xsd:int ) in one of its complex type, I passed few invalid alphabets and try to validate it, and it gets validate w/o any problem, Although the same xml file I passed to XmlSpy 2004, it threw validation exception. I know there in no problem in my code because the same thing worked for xsd:datetime type, when i passed invalid characters it threw exception (event ValidationEventHandler raised). here is my code string schemaloc = ConfigurationManager.AppSettings["SchemaAgentRegistration"]; string targetNS = ConfigurationManager.AppSettings["AgentTargetNS"]; agent.getDO ...Show All
Visual Basic LEFT string function
This is how you would use the LEFT function in VB6 ... str1=LEFT("This is a typical string",4) Can you still use the LEFT string function in Visual Basic 2005 I can't seem to get it to work. Hi, Terry, MS.VB is essentially already imported, as is the System.Windows.Forms namespace. Consequently, adding an import won't help you here -- they're just two imported namespaces which happen to have conflicting members (as might happen with any arbitrary imported namespaces). However, you can set up an alias like: Imports VB = Microsoft.VisualBasic and then the call would be VB.Left, which is a lot easier to type. (You can substitute whatever you like for "VB" ...Show All
.NET Development I'm fairly certain I'm losing my mind....
For the past 3 days, I've been spilling my brains all over my keyboard in an effort to do something that should be ridiculously simple.... What's really driving me crazy is the fact that I've done it before... Here it is: I have a datatable in MS Access. In an effort to copy all of it's records to a table in SQL that I can access and better manipulate, I created an SQL Database in my Visual Basic program and made a comparable SQL Table. I gave all the columns identical names and comparable data values as the columns in the Access table. Now, I just want to copy the records from the Access table directly into the new SQL table. Here's the catch. I'm doing all of this through the DESIGN interface because the last line of ...Show All
Visual C# SQl server authentication issue in C#
Hi Guys, I have a tool written in C# which connects to a remote SQl server 2005. Its working fine while I use "Integrated Security". However, I want to login the database using another credential instead of using the currently credentials associated with the tool. The reason for this was because not all the users using this tool have permission to access the database. So, I need sort of impersonation to allow any user using this tool to connect to the database. Is there any simple and efficnet way to do this Thanks. Hi the username & password in the connectionstring needs to be the same as an sql server user (with sql server authentication) if you want to use the domain accou ...Show All
Visual C# Sharing Session betweem asp and asp.net
Hi, I have a problem on sharing session variables between an asp page and asp.net. Both are hosted on the same IIS. How can i access asp session variables from asp.net web page Thanks a lot. Hi Paola, You should go to: How to Share Session State Between Classic ASP and ASP.NET http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnaspp/html/converttoaspnet.asp Good Coding! Javier Luna http://guydotnetxmlwebservices.blogspot.com/ ...Show All
Windows Forms Drag and Drop between my application and windows explorer
Hello Gurus, I have an application developed in C# ,drag and drop option implemented within the appication. In fact, I am able to drag the files from external windows explorer and drop em on my application. Now I want to drag the files from my application and drop em on external windows explorer or desktop and my application should be able to copy them. Could you please give me some suggestions or sample code that does similar thing BTW, I am using Visual Studio.NET 2003 version. Thanks, Sathish Kumar You just need to create DataObject instance of type DataFormats.FileDrop. From http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c87c.aspx : //put the file path is a string array ...Show All
