Bernd Omenitsch's Q&A profile
Audio and Video Development Chapter playlists
Has anyone written any code to do chapter playlists yet Suppose I have one title/.MAP file with many chapters in it and I want to allow the viewer to pick a playlist that plays only a few of those chapters, automatically skipping over some chapters in between. Right now I'm catching the chapter system event, checking which chapter just finished, then jumping to the chapter that comes next in the playlist. Since script execution timing varies, I'm having a lot of problems with this method. I am going to experiment with Event s in the title's ScheduledControlList next, but I was wondering if anyone here has a better idea of how to implement this. Yeah, that sounds like a bug - if you jump within the title, ...Show All
Visual Basic CopyFile
Hello I am trying to copy four files. It doesn't seem to work though. Here's the code: Dim DirectoryPath As String = "C:\" My .Computer.FileSystem.CopyFile( My .Resources.index, DirectoryPath & "index.html" ) My .Computer.FileSystem.CopyFile( My .Resources.readme, DirectoryPath & "readme.txt" ) My .Computer.FileSystem.CopyFile( My .Resources.swfobject, DirectoryPath & "swfobject.js" ) My .Computer.FileSystem.CopyFile( My .Resources.viewer, DirectoryPath & "viewer.swf" ) I mean it should work. This is the error it produces: System.ArgumentException was unhandled "Illegal characters in path." Also this comes up in the Watch 1 pane: ...Show All
Visual C# Random in BackgroundWorker
I need to generate a random number in a BackgroundWorker. The help file says this about the Random class: "To improve performance, create one Random to generate many random numbers over time, instead of repeatedly creating a new Random to generate one random number." To that end, I tried creating the Random object on my form and passing it in as a parameter to the BackgroundWorker (i.e. backgroundWorker1.RunWorkerAsync(myRandom) ). Now, though, when I try to step thru the BackgroundWorker's code if I view the locals window the debugger hangs and quits. This is apparently related to "Function Evaluation" (or "Func Eval" for short). How can I get good random numbers in a BackgroundWorker PS: ...Show All
Windows Forms OpenWord problem
private bool OpenWord() { try { wordApp = new ApplicationClass(); tname = (object) templateFileName; wordApp.Visible = false; //wordDoc = wordApp.Documents.Open(ref tname, ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref ...Show All
Visual Studio 2008 (Pre-release) Bug - DLinq Serialization Exception - image / byte[] with SingleOrDefault
Hi Guys, I've been writting a system for retrieving icons from a database using Dlinq. With this code I get an exception thrown on the query.SingleOfDefault(); Anytime... Seeing as I'm doing so much testing for you guys, what are the chances of EMIS getting a license to deploy the Linq CTP on site (i know its a long shot) :) It would only be for our internal CRM software, we wouldn't be deploying it to client sites. ...Show All
Visual Studio Team System Adding a previously deleted directory
Hi, We've come up with an interesting issue with TFS that I'm hoping to find a workaround for. We had a directory named 'Core' (with a number of sub directories) in source control which was deleted. Sometime after this a directory with the same name, and existing at the same position in the directory structure, was added rather than undeleting the old directory. This has caused the old deleted directory and previous structure to not be viewable in Source Control Explorer - the only way to view them is by syncing back to a change before 'Core' was readded. This causes a number of problems, such as not being able to undelete the old structure (due to the existance of the new directory) and not being able to view the old source without pri ...Show All
Visual Studio Express Editions Centering image in picturebox?
Is there a way to center an image inside the picture box or for that matter align the image in some way PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage I wondered how you managed to write PictureBox.SizeMode.CenterImage = PictureBoxSizeMode.CenterImage but having tried it Intellisense lets you do it (it even prompts you) but when you have finished it shows an error and the correction suggested changes it to PictureBoxSizeMode.CenterImage = PictureBoxSizeMode.CenterImage No wonder you got confused. ...Show All
Visual Studio Tools for Office Creating a .msg file
i have a requirement to extract e-mails from an e-mail archive system and then add them to a document management system (yup - ugly !!!). The document management system likes emails in the outlook .Msg file format. is there any way of creating a .msg file and writitng it to disk (rather than sending it) so that i can get the document management system to read it in environment is vs2003 / .net 1.1 - but .net2 is close....(have it but not in production - and also have VSTools for Office 2005) thx m Outlook.OlItemType.olMailItem is not the right value for the SaveAs method's second parameter. Look at the Outlook.OlSaveAsType enumeration. Outlook stamps the sendername and sent date/time on a ...Show All
Visual Studio 2008 (Pre-release) WPF Grid - Cell background color
Is it possible to obtain access to a cell on a Grid and change it's background color No. The WPF Grid panel does have the concept of a "cell." If you want a particular row/column intersection area (aka cell) to have a particular color, put some type of panel in that area and set its Background to that color. ...Show All
Visual Basic File Server in VB?
How can I set up a File Server in Visual Basic, so that when I navigate to 'http://<my ip>/files/example.txt' it corresponds to a file on my disk robinjam, Do you mean to create a web service that provide the file opening and down loading function I suggest you to create a Web Service firstly and register file server settings in your operating system, then program the customer's request in your project. Don't forget to add the server reference before you compile all the project files. ...Show All
.NET Development Instantiating Remote Object as a new Process
Hello, I have a question regarding remoting objects and their instantiation on the server side. Can remote object be instantiated as a new process on the server side my remote object takes up heavy-duty calculations and i want for each of the clients that connect to the server to have a new process for their instantiated remote object on the server. Currently the server has one process on which many clients run, but i want to seperate each client's remote object process as well. any input would be greatly appreciated! When you say "heavy duty calculation" does that mean your app is CPU intensive A new process is not necessarily going to get you any performance adnantage. A separate process i ...Show All
.NET Development Abortable thread with return value
Hello, There are two possible solutions that would work for me here... Requirements are as follows: I want to run a task in the background. The task returns a value, which I need to collect. I also need to be able to abort the task. I can use Thread.Start, and then Thread.Abort if I need to stop it, but I can't find a way to get a return value by this method. Alternatively, I can use BeginInvoke, which makes it easy to get a return value using EndInvoke, but then I can't seem to find a way to abort the thread. Either method would be fine. Any suggestions Thanks, Nick Dan, The answers have been interesting, but miss the point somewhat. Probably because I didn't take the time to explain ...Show All
Visual Studio Express Editions .NET is driving me nuts, what's going on?!
Hello there... Here is my situation. I wrote a prgramm for communication with a measuring instrument via rs 232. I wrote the programm in MS VB 2005. On the PC, running Windows XP SP2 was .Net 1.1 and .Net 2.0 installed. By using VB 2005 the code of my app. was obivously written in .Net 2.0, wasn't it After a new installation of Win XP SP2 on the same(!) PC i installed VB2005 with .Net 2.0. What happend My app is not working any more In VB 2005 I got the error message: System.InvalidCastException in MS.VisualBasic.Dll. Typconversation seems to be the problem. My released EXE file, which was released under the "old", well running system, does not work on the new one eather! Where is the problem ! I am lucky having a backup with No ...Show All
Smart Device Development How to Load a GIF File into a Bitmap Object?
Hi all, i have a GIF file that is created from a Bitmap object outside CF using: Bitmap bitmap = new Bitmap(640, 480); bitmap.Save("temp.gif", ImageFormat.Gif); If i copy this temp.gif to the emulator and try to load it using: Bitmap bitmap = new Bitmap("temp.gif"); i get an ArgumentException. However, if i save it as a BMP, i.e.: Bitmap bitmap = new Bitmap(640, 480); bitmap.Save("temp.bmp", ImageFormat.Bmp); and load it: Bitmap bitmap = new Bitmap("temp.bmp"); it loads ok. Is it possible to load a GIF in CF If so, how TIA and Regards, Edwin It is possible to load GIF if your device includes appropriate GIF decoder. It appears your device does no ...Show All
.NET Development Number of thread in a ThreadPool
I have a C# 2003 windows service running on Windows Server 2000 machine, 1 processor. The application uses ThreadPool to handle requests from concurrent users. From MSDN: "The thread pool has a default size of 25 threads per available processor." 1. Does this mean I can utilize all 25 threads If there is a System.Timers.Timer in the application, does it run on a thread from the same ThreadPool, and therefore do I have only 24 (or, 23) threads left 2. Is the number of threads for a ThreadPool the same for Windows Server 2003 3. If we move this application to another server (with more processors), will I have to configure the application somehow so that it uses all processors for better scalability, or will the O ...Show All
