Henrik Berlin's Q&A profile
Visual C# Refresh Start Menu
Hi Everone, I'm going nuts on this one!! I'm trying to refresh the Start Menu and the Favorites folder after deleted the MenuOrder key in the registry, forcing it to reorder folders and icons alphabetically. The code below really doesn't do anything and I can't figure out how to take next troubleshooting step. Could some one please help a poor man ;-) using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace ReOrder { class Program { [ Flags ] public enum SHCNE : uint { SHCNE_RENAMEITEM = 0x00000001, SHCNE_CREATE = ...Show All
Windows Forms Design Time Reflection
Hello. I'm creating a custom control with desing time support. For a property MyItems that is a collection of BaseItem's, I need to allow the user to add as many items he wish on a form I created (all in design time). The problem: I have a number of classes that derived from BaseItem, and I want that the user will be able to select from a combobox all optional elements by using reflection of some sort, so that we I create a new BaseItem derived class, I don't want to change the combobox. How can I do it Hey Eli, You can iterate over all the types in an assembly and check inheritance and all with IsAssignableFrom and IsSu ...Show All
Smart Device Development copy and paste function
can someone provide me code for copy n paste method (in vb.net) i hv check on msdn but i cannot understand! Hi Albert_Khor, The following code snippet shows the copying and pasting of a string to and from the clipboard using NETCF V2: Private Sub Button1_Click( ByVal sender As System. Object , ByVal e As System.EventArgs) Handles Button1.Click Dim str As String Dim iDataObj As IDataObject str = "" Clipboard.SetDataObject( "Hello" ) iDataObj = Clipboard.GetDataObject() Str = iDataObj.GetData(Str. GetType ()) MessageBox.Show(Str) End Sub Cheers, Anthony ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Converting a ray into object space
Hello, I have been stuck on trying to convert a ray into object space, for simple collision detection, I have tried multiplying the coordinates of the ray with the objects inverse matrix ( x = x*_11 + y*_12 + z*_13, y = etc..) but that does not seem to work. There should not be any problems with detecting the collision as I am usuing the D3DXIntersect() function with this ray and the objects mesh. The current code I am using is: D3DXVECTOR3 vPos = pGlobal_Game->pData->objData[iID].Pos3d - pGlobal_Game->pData->objData .Pos3d , vDirPos = pos3d - pGlobal_Game->pData->objData .Pos3d, vDir; iID being for the object th ...Show All
Visual Basic Updating Main Form Control from a thread or a class.
First of All i am using Vb.Net 2003 well! guys here is the scnario. i have created a set of classes. that are as follows: 1-Database 2-Browser 3-Responser now Responser is what is using these other two classes no.1 and no.2. i am calling a method from class 3. in my Main Form as a thread. and then this thread works so that main form won't effect. but i want to update my main form accordingly so that user can see what is happening, and don't think that nothing is happening. how can i update my Caller(Main Form) from the that thread of else what Technique or Application design i can use to perform this task. Hi, Take a look into Contro ...Show All
Visual C# How to create a setup project for the C# application?
It seems visual studio express edition only supports ClickOne mechanism. I want to ask what other functions do visual studio 2005 standard version support(what about more advanced versions) And how to create a setup project for the C# project. Thank you! you can have a overview of the differences between the different Visual Studio versions on this page http://msdn.microsoft.com/vstudio/products/compare/default.aspx ...Show All
SQL Server Starting job on remote server
I've read that you can run a job on another server as long as you have a link server from the source to the destination server. I've search for hours online and read nearly everything in SQL Server Books Online pertaining to the sp_start_job function without success. I can't find one example on how to accomplish this. I want to run a job called Job1 on Server1 from Server2 with a link server on Server2 to Server1 called ServerConn. The link server works fine grabbing data from Server1; so I know the link server works. I am having problems on the server part of the sp_start_job function. use msdb exec sp_start_job @job_name = ' ...Show All
Visual Basic Strong named VB6 Component
Hi! I have the following problem: I have an VB6 application. Now I want to write AddOns in C# using my VB6 types via Interop. I want all my DLLs have strong names. Is that possible Exspecially the Interop.VBA.dll My VB6-DLLs are referencing Interop.VBA.dll. I tried to generate Interop.VBA.dll for my own with tlbimp with the file msvbvm60.dll. But an error occurs: "TlbImp error: System.Runtime.InteropServices.COMException - StrongName-APIs cant find compatible CSP." What can I do I need my C# component registered. And so all my COM components and there dependencies! Thanks a lot for your help! Best regs, Robin ...Show All
Smart Device Development Visual Studio 2005 Beta 2 - Emulator problem
Hi! I've got a problem and wonder if anyone else has it (and has resolved it ) My problem is as follows .. I create a new device application and try to run in in emulator.. the emulator starts just fine, but it won't connect to it! At all! The error is "Connection failed. The system cannot find the path specified." Thanks in advance, Tadej I had the same problem so from a previous tip for vs.net 2005 beta 1 I added the service Virtual Machine Network Services to my network connection. I still got the same error so then I saw this tip and deleted the CoreCon directory and it worked fine. (I tried removing ...Show All
Windows Forms Determine Source Control of Drag Drop Operation
Hello: I have a MainForm with 2 treeViews and 1 listView. I allow drags from treeView1 and the listView1. TreeView2 only allow drops. I would like to determine the source control from where the drag started in the DragDrop eventhandler. Is this possible basically: after drop if treeView1 is the sourceControl > do this if listView2 is the sourceControl > do this Thanks in advance. {C# VS2005} I found a little work around but I would still like to know if there is a method to do a definite test of who the originating control is. The workaround in this scenario is to create a TreeNode from the e.Data.Get ...Show All
Visual Studio 2008 (Pre-release) Use of unassigned local variable 'fact'
We can't write this: Func<Decimal, Decimal> fact = n => n == 0 1 : n * fact(n-1); because the compiler says: "Use of unassigned local variable 'fact'". Should it be possible I guess. Currently we have to write this instead: Func<Decimal, Decimal> fact = null; fact = n => n == 0 1 : n * fact(n-1); Then we are able to call fact(5). Single word - exceptions. Expression after equals sign can throw in middle of contruction while reference to fact was not assigned yet. ...Show All
Visual Studio Team System Connecting to a datasource that is a very, very large database with many tables
In our setup we would like to connect to an IBM DB2 datasource. We do have an OleDB for DB2 installed and we can connect just fine. But then the datasource connection tool goes after the DB2 datadictionary to show all the tables and it dies after having been busy with this for a really long time. The problem is that our data dictionary contains all the tables in all the databases and we have easily several thousand tables per database. So this is not working. I know my database name and I know my database table, but I have no way of setting this up through the "Add Data Source" facility. Is there another way I can do this ...Show All
.NET Development Creating Lazy Collections
I'm working on writing generic lazy collections, but I'm stuck on how to best do this. It seems inheriting from List<> or Dictionary<> is not a good option, as none of the relevant methods are virtual. I don't see any abstract generic collections, so it seems that my best bet is to wrap a List<> or Dictionary<> in my LazyList and LazyDictionary, while implementing the same interfaces that bout List<> and Dictionary<> implement. Does this make sense, or am I missing something Google didn't turn up much of anything in terms of code examples; neither did codefetch{. Have a ...Show All
Visual Studio Express Editions Visual Basic 2005 Express Edition and VSTO for Office tools
Just a quick question, am totally new to developing and am looking to enhance my Infopath Forms with the tools. I have VB 2005 EE and after installing the tools i cannot seem to find any use for them in VB or Infopath. I am clearly making a stupid mistake and as a complete novice i have no idea of where to go from here. Cheers Adam Just to make it seem like somone is interested in replying to this rather than just viewing it i thought i would create some interest by replying to it myself. Can anyone help me Or am i asking something like how do i get my goldfish to use the bike i got him ...Show All
Visual C++ using ATL macro to change LPSTR to LPCWSTR
Hello, I'm making a 3D game and realized I would have to face many problems and maybe trying to "reinvent the wheel" on my own, if I wanted to implement SETTINGS -(for graphics mode) in my game. So I am going for DXUT framework or engine by Dx team or what it is called to simplify my life. But I am facing some problems, because it is using UNICODE and I need to change LPSTR to LPCWSTR so I use macro A2W(lpstr) and include this for it #include <AtlBase.h> #include <AtlConv.h> But then I have a compile error: fatal error C1189:#error : Need to include strsafe.h after tchar.h bec ...Show All
