黄达's Q&A profile
Visual Basic Incapacitating Error
I have an error that occured recently and I cannot pinpoint it for some reason. It seems to happen before my code is even executed. Below is the exception. System.InvalidOperationException was unhandled Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Index 0 is out of range.\r\nParameter name: index" Source="FFC" StackTrace: at FFC.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190 at FFC.My.MyProject.MyForms.get_Main() at FFC.My.MyApplication.OnCreateMainForm() in C:\Documents and Settings\Troy Lundin\My Documents\Visual Studio 2005\Projects\FFC\FFC\My Project\Application.Designer.vb:line 35 at ...Show All
Windows Forms How to get a scroll bar to scroll down a large programme.
How do I make a VBscrollbar scroll down my programme. I have it docked in the form but I need it to actually function. Thanks. A panel and form has autoscroll property that you can set so you don't have to add scrollbars manually. Are the contents of your program manually drawn or just widgets ...Show All
SQL Server Hidden columns/blank PDF page(s)
I have been trying for some time to create a columnar report where certain columns can be hidden as requested by the user. I have tried placing the complete column set in the report, and then hiding a subset of columns, but blank pages are produced when rendered to PDF since the report body does not appear to shrink as columns are hidden and justify themselves to the left. I have tried a table, list, and matrix to no avail... Does anyone know of a workaround, a trick, or even a hack that may accomplish what I am after Thanks. Hello Iago, I have found a work around for this problem. It’s a bit hacky, but does work. 1. Collapse all table columns to the smallest they can go so width = .125 2. Resize th ...Show All
Software Development for Windows Vista Transactions - ensuring consistency between WF and MSMQ
Apologies in advance this might be quite a complex one! I should say at the outset that I don't want someone to write my solution for me, just am trying to understand a bit more about how to achieve transactionality in WF. I'm currently trying to pilot an STP engine using Workflow Foundation to prove its suitability. Everything in the engine is driven using transactional MSMQ queues. It's essential that no information is lost, and that the workflows remain in a consistent state with the contents of the queue. These are the scenarios I'm trying to tackle at the moment: 1. A message arrives on a queue and triggers the creation of a new workflow. 2. A message arrives on a queue and is passed into a waiting workflow. 3. A workflow ...Show All
Gadgets Passing parameters to my gadget
Sorry if this has been asked before, but I couldn't find any info on it. I would like my gadgets to interact with each other. E.g., when clicking on a link inside one gadget, it refreshes the another gadget (or the whole page), and the clicked URL can be passed to another gadget to show relevant content. Is that at all possible If yes, here can I find the documents (or examples) to do that Thanks! BTW, I tried to refresh the whole page through javascript in my gadget, but it generate some "access denied" error and does not redirect at all. I assume it was intentionally block, right Unfortunately, there is no supported technique for cross-gadget communication. Gadgets must be self-con ...Show All
Visual C++ Getting app that told my app to open a file
I have an application that processes image files. It currently correctly handles not running multiple instances of itself by having the first instance create an exclusive named pipe. When a second instance gets created, the create of the named pipe fails (hence, it knows it's the second instance). At this point, the second instance sends the command-line arguments through the pipe to the first running instance which is sitting there in a thread waiting for them. Upon receipt, it processes the command-line arguments and opens any arguments that are images files. The second instance simply dies. It works great. But what I want do do now is to know which other application triggered the launch of my application (either the first or second i ...Show All
Visual Studio 2008 (Pre-release) Can't get CTP working , even though May LINQ has been working for Months...
OK. I created a database (GamesDatabase). Created a vNext Console App. Added a vNext Model Object to the solution, told it to pick it from the database. Picked my tables, everything seemed to be fine - model generated, everything builds. So I go to my console app, add a reference to the Model Object (so far I'm following along just like the SDK document says I should be doing). Now I add the following code: using (GamesDatabase gamesDb = new GamesDatabase("name=GamesDatabaseConnectionString")) { var q = from game in gamesDb.VideoGames select game; foreach (VideoGames g in q) { Console.WriteLine(g.Title); } } As per the instructions in the sample document (keep in mind that I' ...Show All
Visual C++ function argument types and cross language compability
If I want to be able to call functions from a user defined class in both C++/CLI and C# then does it make a difference if function arguments use a handle (i.e. the '^' character) or the reference syntax (i.e. the '%' character). For example: ref class A { public: A() void f1( int% i ) { ... } void f1( int^ i ) { ... } bool operator=( A% a ) { ... } bool operator=( A^ a ) { ... } }; If I wanted to create an instance of the above class in C++/CLI and then call if from an assembly in C#, which syntax would I have to use Similarly, if I wanted to create an instance of the above class in C# and then call if from an assembly in C++/CLI, which syntax would I have to use to call the functions In other words, are C++/CLI fun ...Show All
Visual Basic string array question
I’m trying to create an array from each line read from a text file. I just successfully did a similar array using Directory.GetDirectories to fill an array, but for some reason this one doesn’t work. I’m getting a Null reference error. The line “ aryFromList(i) = Line” has a squiggly line saying that aryFromList is being used brfore it has a value. BTW, I am aware that I need a "while not EOS" line for the reader, I am giving you just a portion of the code. Any suggestions would be appreciated. Dim objFS As New FileStream( “C:\test\test.txt” , FileMode.Open, FileAccess.Read)   ...Show All
Visual Basic Refference Version is incompetible
I am workin in VB.2005. and i have no. of projects in single solution say Sol1. one named DBConnectioni. this project is included in another solution say Sol2. from the same location. i built Sol2 a few times and the version of DBConnectioni.dll changed from 1.0.2502.###### to 1.0.2504.######. it was working well here. but after that i started working on Sol1. and as i try to run project it doesn't allow me the instance of any class in DBConnectioni and an exception (FileNotFoundException) is thrown with the message " File = "DBConnectioni.dll" , version = " 1.0.2202.#####" ....... could not be found (Sort of ) i dont have that version of dll now please guide me how do i solve this problem Looks like ...Show All
Visual Basic How to set Application Setting for MDI Child Form?
I would like to know is there a way to save MDI Child form setting, so that when I reopen the child form again I could get back the same setting. Example of setting that I would like to save are, child form location and its control setting e.g. a textbox.text contents. do u mind to provide some simple code on how to save it to a file, if i have a few Child forms and i would like to remember their location and its controls setting. thanks for your help. ...Show All
.NET Development When is required a system reboot for a .NET application?
Hello guys, Do you know of a checklist of what circustances may require to restart your system after installing a .NET Framework application This is my case: I have a .NET Framework application that is installed using an InstallShield basic MSI project, together with the application, a .NET windows service is also installed. Yesterday I had a customer claiming that he had found a bug in the application, and I realized that the problem was only reproduced when a previous version was replaced with a newer one (in other words, in the same Windows session the applications is uninstalled and again installed)... the service is supposed to launch an application that requires to display GUI, but even when the process is created and launch ...Show All
Windows Forms KeyDown Event, IsInputKey not working (C#)
(C#, VS 2005) - I have a form, with a few radiobuttons on it. I want to do some stuff when the arrow keys are pressed but the event isn't raised. I found on MSDN that you should override IsInputKey, but I did that and it doesn't work (IsInputKey is never called). Another problem (may have something to do with it) is that i can't find a way to stop the arrow keys from scrolling through the radiobuttons. thanks in advance no effect, none of the functions is ever called when the arrow keys are pressed. The onKeyDown event is called only on other keys, an the IsInputKey is never called (not even on other keys). ...Show All
SQL Server Time dimension
Dear All, I have created a Time Dimension using the Date Wizard in Analysis Services (in ROLAP storage mode). Now I would like to "export" it into SQL Server 2005 database relational tables and manipulate the relational tables such as generate a surrogate key etc. How do I do this TIA, John Thanks Matt for your information. How do I "export"/"transfer" the dimension into a relation table in relational database in SQL Server 2005, the destination database is not the database in Analysis Service. From there, I can do some database maipulation such as generate surrogate key etc. ...Show All
.NET Development Array.Sort causing too many GC's
The following code on a 32bit machine causes 0 GC's but on a 64bit it causes 10. int size = 100000 ; double [] keys = new double [size]; Random rand = new Random ( ( int ) DateTime .Now.Ticks ); int [] items = new int [size]; for ( int k = 0 ; k < size; k++ ) { double random = rand.NextDouble(); keys[k] = random; items[k] = k; } GC .Collect( 0 ); GC .WaitForPendingFinalizers(); GC .Collect( 0 ); int count = GC .CollectionCount( 0 ); Array .Sort< double , int >( keys, items ); count = GC .CollectionCount( 0 ) - count; Console .WriteLine( count ); ...Show All
