zille's Q&A profile
.NET Development 2146233079 automation error while createobject on interop assembly (only second time)
Dears, I have the following bizar problem. I've created a .NET assembly (dll) that can be created from COM (vb6 in my case). When I create the object the first time, everything goes fine. But the second time, I get an error on the CreateObject (-2146233079 automation error). I was unable to retrieve any more information from the error object in vb. I registered the .NET assembly using regasm (I tried both with and without the /tlb option). The .NET assembly simply queues the items it receives and spawns another thread that consumes the items. The spawned thread exits gracefully, and all calls to the DrillBackDotNetDispatcher return to vb. The second creation of the object is made after both the last call to addItem has returned and the t ...Show All
Visual Basic Stop application from terminating on form close
I am working on an application with a notify icon. I want the application to continue to run even if the user closes the form. Is there any way to make this work I haven't tested this with a notify icon but t his should do it: Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If e.CloseReason = CloseReason.UserClosing Then Hide() e.Cancel = True End If End Sub Note that you want to check the CloseReason property so that your app will shut down properly in other circumstances. ...Show All
Visual Studio Express Editions String to number
Is there a quick way to convert the string "2.334.654,23" to the number 2334654.23 I have tried decimal.parse but does not like the format of the string (it works with 2,334,654.23). Thanks, Antonio Just tell parse that it's OK with a leading sign by adding the: Globalization.NumberStyles.AllowLeadingSign flag to the parse method. For more flags that you can specify, check out http://msdn2.microsoft.com/en-us/library/system.globalization.numberstyles.aspx . Best regards, Johan Stenberg ...Show All
Windows Forms .msi file for project was deleted. How do I re-generate it ?
I have a setup project for a windows service. I tried adding the .msi file to the installation and it appeared as if this was succesfull as a new node under the project tree was displayed showing the new .msi file. Unfortunately when I click on this node it now tells me that the file was deleted. Plus after searching for the .msi file, it appears to no longer exists So somehow it must have been deleted. Is there a way to re-generate this .msi file ...Show All
Visual C# How to configure the window size for console applications
Hi, for a Console application I'd like to change the default console windows that is started by the studio in debug mode (not just 80x24). Where to setup this in VStudio2003 Thanks I believe it is in the registry: HKCR\Console\WindowSize. It will affect ALL console windows, not just the ones launched by VS. Careful editing it, the high word sets the number of lines, the low word sets the number of columns. The default is 0x00190050 for 80x245. ...Show All
Visual Studio 2008 (Pre-release) sample service doesn't work on Windows XP 64
Hello, I tried to make a windows service that hosts a WCF service. Naturally, I've tried the sample first. It crushes raising an error: System.ServiceModel:Incorrect function at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen() at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener) at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback) at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.DatagramChannelDemuxer`2.OnOuterListenerOpen(ChannelDemuxerFilter filter, IChannelLi ...Show All
Visual Basic How do I... ?
My question is a little hard to word, so I'll just use an example: Say that I click a combo box and 7 items appear. The items are: O Class B Class A Class F Class G Class K Class M Class Note: These are the 7 main star groups. There are also 6 labels: Temperature, Star color, Mass, Radius, and Luminosity, and Hability Zone What I want is: if I choose O class, a textbox (or something) next to Mass should read 60. I have not yet learned the Visual Basic, but I should get this one out the way right now. If you do not understand the question well, please tell me. Sincerely, Mirai Naza Spidermans_DarkSide wrote: Hi, Presuming you have the items in ...Show All
Gadgets ActiveX for Sidebar best practices
I am interested in further exploring the possibilities of using/developing an ActiveX object for use in a Sidebar gadget but havent done anything like this before. What are the best ways of proceeding with this Can i use Visual Studio 2005 to create an ActiveX object i tried using ATL project, i was able to compile it but not to register it Thanks for your responses; to clarify I have formatted my Vista system just in case, I use Visual Studio 2005 and follow Bruce’s Tutorial Part1 and Part2 I compile the DLL and use regsvr32 TestActiveX.dll in the command prompt (Running all as Admin) I get notification that the DLL is registered successfully. Next I use the following HTML: <HTML> <S ...Show All
Visual C# how do i access a Connection String in the app.config file
I've a Data Access Layer that needs to get the Connection String from the app.config file. Tried using : this .connectionString = ConfigurationManager .AppSettings[ "connectionString" ]; but when I run the app the connectionString is null the setting in the app.config file is name = " HDRDB.Properties.Settings.HDRDBConnectionString " connectionString = " Data Source=NTS14;Initial Catalog=HDRDB;Persist Security Info=True;User ID=hdrd_dba;Password=password " providerName = " System.Data.SqlClient " sorry if this is simple but its my first C# app ee Try using: this.connectionString = ConfigurationManager.ConnectionStrings[" HDRDB.Proper ...Show All
Visual Studio Team System build failed
I've loaded my exiting database schema into a new project but the build is failing. ("Build Failed" in the bottom left right hand corner). I have 0 errors and 5 cross server warnings. The schema explore just shows the 5 yellow "!" as would be expected. What I'm I missing I don't have the "Treat warnings as errors" checked in the project properties. Paul ps im new to VS for DBP ...Show All
Visual C# ASP.NET form using C# question from a youngling
I have a small dilemma and I hope someone can point me in the correct direction. I have a current web form, written in JSP, in which a user searches a library of files (PDF, Excel, Word, etc.). Once the results appear a user should be able to click on a link and open (in another window, not showing the Address of the file (URL)) the file in it's associated program (such as Adobe Acrobat opening a PDF file, Excel opening an .XLS file, etc.). I am doing my first C# project and am not sure which .NET namespaces to use. If someone can point me in the direction, send a link to an example, I would be most grateful. Also, I am not sure what this function would be called, so I hope I am posing this question in the correct place. Thank you in advan ...Show All
SQL Server how to save xml document in database table?
I have a db in Sql Server Express 2005. Into this db I have a table with an XML field and I want to save an XML document into this field through SQL. Any suggestion to do this operation Thank you Mirko There is a nice article about XML fields and SQL server. http://www.developer.com/db/article.php/3565996 However there is a problem on that article I'll paste the insert statements here: INSERT INTO Document (Description, DocumentStore) VALUES('Bruce''s poem', N'< xml version="1.0" > <Document Name="Poem"> <Author>Bruce</Author> <Text>The cat/is flat.</Text> </Document>') INSERT INTO Document (Description, DocumentStore) VALUES('Code ...Show All
Software Development for Windows Vista How to configure monitors using DirectShow?
Hi, I need control two monitors that I will write two different video images into either monitor. I found a function SetMonitor() in DirectShow. I am still confuse at which interface should I select, IVMRMonitorConfig, or IVMRMonitorConfig9 Now, I tried to use IVMRMonitorConfig9 like follows: HRESULT hr; IVMRMonitorConfig9 *pMonitorConfig = 0; hr = pMonitorConfig->SetMonitor(1); //display image at the 2nd monitor //but there is run error here: "access 0x000000" pMonitorConfig->Release(); Should I use CoCreateInstance() function to initilize it and how to write the parameters in it Thanks a lot. Hi, everyone, I can control my video file to play in the ...Show All
SQL Server Derived Table Alternative
I have an application that has two different database backends, one is SQL Server Compact Edition and the other is SQL Server. The reason is because the application may run at home on one of our sales agent's computers or here in the office. I have a query that uses a derived table and works just fine in SQL Server, however when I run it in the compact edtion (having the exact same table structures) it will not run. My question is...does the Compact Edtion or the Mobile Edition allow derived tables. If not is there a way to work around this I will happily give an example if it will help. Thank you, Adam I guess if we can provide some feedback to the team for future versions having derived/nested ...Show All
Visual Studio 2008 (Pre-release) no service contract, just message and endpoint
Is it possible to create a client that is late bound to a WCF service That is, this client is given only a Message object, and an endpoint to send it to. Assume request/reply over http. Almost every ChannelFactory<> example I see uses the service interface, which I will not have. Also, if this is possible will I have to set the SoapAction property manually I wish this were something which could be derived from the Message itself. The use case here is something like WS-Eventing. I do not want to use a publish subscribe system which requires the subscriber to implement an entire event interface just to subscribe to one event (topic). Thanks. Thanks, that is helpful. Is there anyway in WCF to set ...Show All
