smartpi's Q&A profile
Visual Basic using File.WriteAllText vrs a StreamWriter
My question: VB 2005 now offers different methods to write/read a file, such as the File.WriteAllText, the My.Computer.FileSystem.WriteAllText and the StreamWriter. Can anybody explain when is it better to use which method, which one is more efficient in term of memory/processor use and performance time Thanks!! File. WriteAllText() and My.Computer.FileSystem.WriteAllText() are only shortcuts, they still use StreamWriter internally. If all you want to do is quickly write a small piece of text to a file, use WriteAllText(), but if you want more control on how the file is written, such as when to open and close the file, use StreamWriter. When you have a large amount of text to write, us ...Show All
.NET Development StackOverflowException in ServicedComponent cannot be caught
I got a serious problem with a ServicedComponent: A ServicedComponend running in a server sided COM+Application had an endless recursive loop - a bug obviously. It took hours to figure that one out because even narrowed down to a few lines of code to find the spot that causes the problem the only exception I got from the COM+Application was something like "COM+ Surrogate crashed..." and an exception like this: Unhandled Exception: System.Runtime.InteropServices.COMException (0x800706BE): The remote procedure call failed. (Exception from HRESULT: 0x800706BE) at System.EnterpriseServices.IRemoteDispatch.RemoteDispatchNotAutoDone(String s) at System.EnterpriseServices.RemoteServicedComponentProxy.Invoke(IMessage reqMsg) at ...Show All
Game Technologies: DirectX, XNA, XACT, etc. What one has to do if he has a great game and would like to sell it on X360 Live Aarcade?
I think that GSE is a great idea. But i'm also pretty sure that there is someone out there already who has so magnificent game idea that it would be worth selling on x360 LA. What is needed in order to achieve this Does the one have to compete with big companies Does he/she/they have to buy a devkit Is that even possible for an individual What are the fees What else has to be met All right, so do you represent microsoft's official opinion here If you do, then thanks for the reply even though it is quite cryptographic and not too specific. But I understand that some things are just not to be said to public. If you don't then I'd like to hear it from someone from microsoft who ...Show All
Windows Forms Open Window in new IE window?
Greetings all, This might insult someone's intellligence, but how do I detect if an instance of IE is already open ...and if there is a window open, open in a new window Thanks for any help, Adamus The problem is not resolved. None of the solutions work. I need a solution during a page_load event that will detect if an IE instance is open...and if so, open a new window. ...and a VB.net version would be preferable. Thanks, Adamus ...Show All
Visual C# Add Node existing XML file
- < RadioBar > < Genre_Genre_Country > Genre_Country </ Genre_Genre_Country > - < Genre_Genre_Country > < Title > KPIG presents Cowboy Cultural Society Radio - an American tradition since 2002 </ Title > < url > http://205.188.215.232:8028 </ url > </ Genre_Genre_Country > - < Genre_Genre_Country > < Title > Classic Heartland - Classic Country, Western, Bluegrass, Alternative Country [Dial-up] </ Title > < url > http://130.166.72.1:8008 </ url > </ Genre_Genre_Country > Genre_Genre_Favorites ...Show All
Visual C# Running two services in same VSTS project
Hello... I have created two c# windows services in the same VSTS project. They each have their own installers, and installs fine in the windows service list. I have attached a debugger to the main(), here is the code: static void Main(string[] args) { ServiceBase[] ServicesToRun; // More than one user Service may run within the same process. To add // another service to this process, change the following line to // create a second service object. For example, // // ServicesToRun = new ServiceBase[] {new Service1(), new MySecondUserService()}; // ServicesToRun = new ServiceBase[] { new NetworkWatcher(), new LocalRunner() }; Debugger.Launch(); ServiceBase.Run( ...Show All
Visual Basic Using a dll created in .NET in VB6
Hi other time I created a dll in VB .NET that is gonna be used in an VB6 application, I used the Type Library Exporter to reference it in the VB6 application (the tbl file). Now i technically can enter to the methods of my dll. The problem comes when I run my VB6 application, in the point of calling every method, sends an error like 'Runtime Error "91": Object Variable or With bolck variable not set' and I dunno why is this happening. Every suggestions are welcomed Can you post relevant parts of your code Where is the assembly located relative to the application Have you registered the assembly for COM interop (with Regasm or Visual Studio) ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Save projects under new filenames?
XNA Game Studio doesn't have a command to save projects under new filenames or make copies of projects. For example, create a new project while going through a tutorial from a web site. Is it possible to save projects under new filenames or make copies of projects You don't necessarily need to do that within XNA Game Studio. You can just navigate out to the project on your computer and copy the entire project and paste it into a new folder. Now you can work away on your copy and rename it how you want from within the IDE. There isn't any method that I'm currently aware of saving solutions/projects and all their associated files and classes in a new location with a new name all at one time from within the I ...Show All
.NET Development Load native DLL
hi, i have a problem.I try to load a native DLL( a c++ dll) using Assembly.LoadFrom(string dllname), but i keep getting these error: "Could not load file or assembly 'C://testdll2.dll' or one of its dependencies. The module was expected to contain an assembly manifest." What i want to do is load the dll dynamically and during runtime(late binding)... here's my DLL code: ####################################### testdll2.cpp #include <windows.h> #include <iostream.h> #include <stdlib.h> #include <stdio.h> #define IN_DLL #include "testdll2.h" int DLL_DECL printString(char InText[]) { printf("[printString] This is in the DLL\n"); printf("[printString] %s\n", InText); return 1; ...Show All
Visual Studio Express Editions run method from a different class - oop issue :-(
I'm struggling to get my head round OOP properly - please help! On my Form1 i have a button. this button calls a method "launchmMenu()" which is written within "public partial class Form1 : Form" now my head is hurting I read that post, can see how it relates to getting to variables, but can't see how i can use it to call the method ! raising an event from the other class sounds more like what i need - can anyone point me in the right direction of how to do this please ...Show All
.NET Development ASYNC XML calls via a C# Class?
I've read all about how to make async XML calls via a webpage with the async="true" page directive. But, what I am trying to do is make the same type of async calls via a class that the page calls; or another web service calls. Any clues or pointers on how to perform this Regards, Joe I don't think the XML parsing APIs in .NET directly support asynchronous reading with a setting. HttpWebRequest / HttpWebResponse however allow you to make asynchronous requests and you can then feed the response stream you get to an XML parsing API. ...Show All
Visual C++ Mouse Coordinates
Hi, I'm trying to write a simple app that just show the mouse coordinate in a Static control when the mouse is moved over picture box, I have a dialog app with a PictureBox and a Static Label (It has an OK and Cancel too) - I've created a control variable and a class to deal with the MouseMove event on the picture, but when I come to access the Static control in the MouseMove event I run into problems. Originally I tried using getDlgItem and casting it to a CStatic and setting the window text on the MouseMove event, this caused the app to crash (Not quite sure why) Then I tried to create a control variable for the Label, this belongs to the dialog box so isn't available to the MouseMove event which is handled in the class I created for the ...Show All
Visual Studio Express Editions Button Click within a for each loop
Fairly new to VB express. Is it possible to have a button click event from within a for each loop on a form i.e. the button being clicked refreshes the form and moves on to the next iteration of the loop Any suggestions welcomed. I hope this helps or sheds some light: Dim myOtherArray() As String = { "Bob" , "Beth" , "Conrad" , "Grant" } Dim i As Integer = 0 For i = 0 To 3 Label1.Text = myOtherArray(i) 'MessageBox.Show(myOtherArray(i)) Me.someButton .PerformClick() 'this will click the button specified, replace "someButton" with the name of the button you want to click Next is this what you are after my apologies for being ...Show All
Visual FoxPro Visual foxpro 9 watch hang
I was testing a program with debug and watch window . I enter a function in the watch windw than a window like passward with no title apears and evry think is bloked. I have to end forcely by task manager. Since than evry time I start watch window I get the same window and bloking situation.I uninstald Visual fox pro and I reinstald it. The same think. I uninsald Visual FoxPro and I deleted all the directory from program file . I reinstald Visual FoxPro 9 and the same think happends. I posted a screen copy of the event to www.bluejeans.lx.ro if you want to see it. What can I do In the watch window I tested this UPPER ( ALLTRIM ( INPUTBOX (DVDLOGIN_LOC,DVDLOGINCAP_LOC))) it permanently genereit an ...Show All
Visual Studio Express Editions BindingSource.Filter Not Working Correctly
Could someone show me a way to make this code actually work correctly; Private Sub ComboBox2_TextChanged( ByVal sender As Object , ByVal e As System.EventArgs) Handles ComboBox2.TextChanged Me .InventoryTableAdapter.Fill( Me .InventoryDataSet.Inventory) Dim ProductLine As String = Me .ComboBox2.Text.ToString Me .InventoryBindingSource.Filter = "NormalStock='Yes'" Me .InventoryBindingSource.Filter = "PartProductLine='" & ProductLine & "'" Me .DataGridView1.DataSource = Me .InventoryBindingSource End Sub I know the two bold lines need to be joined as one, but I have tried several simple version with no effect. All I can find is using multiple text ...Show All
