PDav's Q&A profile
Windows Forms very basic use of combobox
HI I create this struct to load mi items in the comboBox, so far this is the only way I know to do it. struct Elemento{ string Text; string ID; public Elemento(string text, string id){ this.Text = text; this.ID = id; } public override string ToString(){ return this.Text; } } then I use this line to load the items comboBox1.Items.Add( new Elemento (MyItemName, MyItemId)); my question is: How can I get back the value of an item I did this but it does not work Elemento MyItem; MyItem = (Elemento )comboBox1.SelectedItem ; I know Im close but there is something missing. Is this the best practice to load or use a combobox thks hi Realy no Im not using a list to do bi ...Show All
Visual Studio 2008 (Pre-release) Slider.Value and MethodParameter : type not supported
I installed the RC1 bits and get an error on my XAML code : Property 'Value' does not support values of type 'Double'. It's about the binding of the Value property of Slider from the MethodParameter of a ObjectDataProvider : < Slider.Value > < Binding Source = " {StaticResource MenuDSO} " Path = " MethodParameters[0] " BindsDirectlyToSource = " True " UpdateSourceTrigger = " PropertyChanged " Mode = " TwoWay " /> </ Slider.Value > and the ODS : < ObjectDataProvider x:Key = " MenuDSO " ObjectType = " {x:Type src:MenuManager} " MethodName = " GetMenus " > < ObjectDataProvider.MethodParameters > < system:Double > 5 </ system:Double > < system:DateTime > ...Show All
Visual Basic CreateProcessWithLogonW
I have been trying to create a 'simple' Visual Basic.net program which will allow me to run another program under a different user... basically simulate the functionality of RUNAS. I have tried using a CreateProcessWithLogonW command retcode = CreateProcessWithLogonW(g_strUserName, g_strDomain, g_strPassword, _ LOGON_WITH_PROFILE, 0&, "notepad.exe", "c:\", 0&, 0&, si, pi) And Dim myProcess As System.Diagnostics.ProcessStartInfo myProcess = New System.Diagnostics.ProcessStartInfo() Dim password As Security.SecureString password = New Security.SecureString g_strUserName = "CinAccess" g_strPassword = "test" Dim c As Char For Each c In g_strPas ...Show All
Visual Studio Tools for Office MAPI - Proper use of IMessage SaveChanges() flags?
I've read the MSDN docs for IMessage SaveChanges() method: http://msdn.microsoft.com/library/default.asp url=/library/en-us/mapi... and it says you use KEEP_OPEN_READWRITE to keep the item open after saving changes, and if that fails with MAPI_E_OBJECT_CHANGED you should retry with FORCE_SAVE. And it appears if you call SaveChanges with KEEP_OPEN_READWRITE followed later by another identical call, then you get the MAPI_E_OBJECT_CHANGED error. But in the real world of coding, if you have some complex logic it's quite likely you'll refactor code into several methods which could be setting properties and custom properties and you cannot necessarily guarantee the order of each method or whether they are called at all. In this ...Show All
Visual Basic Emails
Is there a way to send emails through outlook all the email addresses are on a server. Rather than compose the message external to your application, you can just use the System.Net.Mail namespace: Dim smtp As New System.Net.Mail.SmtpClient("smtpServerNameOrAddress") Dim msg As New System.Net.Mail.MailMessage msg.From = New System.Net.Mail.MailAddress(" sender@domain.com ") msg.To.Add(" recipient@domain.com ") msg.Subject = "The subject" msg.Body = "The message body" smtp.Send(msg) You can also use Office Interop to create and control an instance of Outlook in the background of your application. This would give you access to ...Show All
Game Technologies: DirectX, XNA, XACT, etc. I made a DirectInput (MDX 1.1) GameComponent...
I've made a quick DirectInput GameComponent that supports "legacy" controllers through DirectInput. If anyone is interested I'll figure out a place to put it so you can download it (and hopefully improve it). Let me know. That sounds pretty handy, Khass. A lot of folks seem to be wondering how to support such legacy controllers. Keep us posted! Dan ...Show All
SQL Server APPS for SSIS
Help! Does anyone know where can i find some windows or web applications using ssis for manipulations arsonist wrote: Hi, an actual application (code sample) that use or manipulate ssis, hope you can help me on this one Thanks This link should help: http://msdn2.microsoft.com/en-us/library/ms345167.aspx ...Show All
SQL Server 3 tier merge replication problem
I have a 3 tier merge replication architecture that I am having some problems making changes to. We have a 3 tier architecture with many laptop instances on the bottom tier. It is exceedingly hard to coordinate having all laptop instances online simultaneously during non business hours with users present for local administration. The requirement is to change the name of the top tier without effecting the replication from the middle to bottom tiers. I have so far renamed the top tier's instance, reconfigured publication, created a new top tier publication, and a new middle tier subscription. The top tier article has been set to delete all data in the subscriber's table when applying the snapshot. Making data ch ...Show All
Visual Basic Binding Stored Procedure Results
Hello All, Hope someone can give me a quick hand. Using Visual Basic in Visual Studio 2005. I am also using SQL Server 2005. I have the following code which, I would like to execute a stored procedure and load the results into a DataGridView control. When I run this code I do get column names and they load into the DataGridView however, no rows are populated. When I run the proc in SQL server it all works fine and returns the specified number of rows. Not sure why no rows are populating... Dim Conn As New SqlConnection( "DATA SOURCE=amr-stp-sql1;Integrated Security=True;INITIAL CATALOG=AMR;" ) Dim DS As New DataSet Dim DA As SqlDataAdapter Dim QueryStr As String QueryStr = "Execut ...Show All
Visual C++ How to combine managed and unmanaged types?
Hello. I have some managed class MyClass and unmanaged structure my_struct. And I need to create a member of MyClass of type my_struct. typedef struct { int a, int b } my_struct; public ref class MyClass { my_struct val; public : } But compiler reports me about the error: cannot define 'my_struct' as a member of managed 'MyClass': mixed types are not supported The same trouble occures when I try to declare std::map<int> as a member of MyClass. Question: what is the right way to create the unmanaged member of managed object Yes Caves, U r right. First i've tried prasad's post , but i don't know why it didn't compile. Now i've got it working.T ...Show All
Windows Forms Modeless Dialog boxes that are Always in Focus
How do you make a modeless dialog box so that it is always in focus with the parent window Like the floating menus in Photoshop, for example. Whatever I do, I haven't found a way to keep more than one window in focus at a time. Thanks, so they only make it look like they are always in focus by having it so the border colour doesn't change when they are out of focus. ...Show All
Smart Device Development Is DirectDraw supported by Windows CE?
I have a fast graphics API to support WinMobile 2003+ and I also want to support fast graphics on generic Windows CE devices (non-WinMobile). Should I be using DirectDraw for this If so, should it be provided by the hardware vendor as part of their CE operating system or can i just redistribute DirectDraw on my own. If so, where can I get this redistributable package I'm new to using DirectX. Thanks, George An article that answers all of your questions on GAPI: http://msdn2.microsoft.com/en-us/library/ms837924.aspx ...Show All
SQL Server combine 2 select count datediff
I have created two select clauses for counting weekdays. Is there a way to combine the two select together I would like 1 table with two columns: Jobs Complete Jobs completed within 5 days 10 5 ------------------------------------------------------------------------------------------------- SELECT COUNT(DATEDIFF(d, DateintoSD, SDCompleted) - DATEDIFF(ww, DateintoSD, SDCompleted) * 2) AS 'Jobs Completed within 5 days' FROM dbo.Project WHERE (SDCompleted > @SDCompleted) AND (SDCompleted < @SDCompleted2) AND (BusinessSector = 34) AND (req_type = 'DBB request ') AND (DATEDIFF(d, DateintoSD, SDCompleted) - DATEDIFF(ww, DateintoSD, SDCompleted) * 2 <= 5) ----------------------------- ...Show All
SQL Server Incorrect syntax near 'GO'. in sql 2005 management studio
update test_table set flag_enabled = 1 where name = 'xxx' GO ALTER VIEW dbo.[ABC] AS SELECT * FROM [bt_ABC] WHERE is_visible = 'N' Simple statement like the above give Incorrect syntax near "GO" error. If I remove it, I get 'ALTER VIEW' must be the first statement in a query batch. Appreciate any tips/help. Thanks, Priti UPDATE test_table SET test_table.flag_enabled = 1 WHERE test_table.name = 'xxx' GO ALTER VIEW dbo.[ABC] AS SELECT * FROM [bt_ABC] WHERE is_visible = 'N' Let me know how you get on, this might be a good case for stored procedures. hth Pace ...Show All
Smart Device Development Tracking windows mobile download site
We are preparing to distribute our Windows mobile application (cab file) via several methods including many third party sites etc. Our application has to talk to our server to register the user and update data in the application regularly. When the user first registers we would like to track the source that they downloaded the file from. We could embed in each separate cab file a unique source ID but then we would have to resign each one at $35 a pop. (We have custom builds for each device so all devices times all sites really adds up). Is there a way to add or somehow appending this kind of tracking information that anyone has done in the past I could imagine if you are doing an install via ActiveSync you could perhaps include a sec ...Show All
