andrewdobson1's Q&A profile
.NET Development Help Me! Won't Somebody Help Me? Rewrite This C++ Code in C#? What's an HRESULT in C#?
// The following example can be used to enable or disable the // backup privilege. By making the indicated substitutions, you can // also use this example to enable or disable the restore privilege // Use the following statement to enable the privilege: // hr = ModifyPrivilege(SE_BACKUP_NAME, TRUE); // Use the following statement to disable the privilege: // hr = ModifyPrivilege(SE_BACKUP_NAME, FALSE); // Use SE_RESTORE_NAME for the restore privilege. // The main function in this example enables the backup privilege. #include <windows.h> #include <stdio.h> HRESULT ModifyPrivilege( IN LPCTSTR szPrivilege, IN BOOL fEnable) { HRESULT hr = S_OK; TOKEN_ ...Show All
Windows Forms Font is not displayed with underline or strikeout
Hi I use a font with DrawString(). All works well. But when I use underline or strikeout style the font is displayed without underline or strikeout when the size is low or medium. It's ok on larger sizes. Code example: // The graphics object is mapped with millimeters and zoomed. string s = "1" ; // Font size 20F is faulty; Size 40F works well. Font font = new Font ( "Arial" , 20F, FontStyle .Underline, GraphicsUnit .World); SizeF textSize = g.MeasureString(s, font); RectangleF r = pageNumberData.DrawingRectangle(pageRectangle, textSize); g.DrawString(s, font, brush, r, pageNumberData.DrawingFormat); When I use 20F as font size (example) I get the font displayed without undeline and strikeout. ...Show All
Microsoft ISV Community Center Forums Outlook automation with encrypted signed email
Hi, I recieve a digital signed email daily which contains a zip file. I would like to know if there is a way to automate the extraction of this attachment. I have tried all standard methods but where I run into problems is with the fact the email is encrypted when recieved. It required someone to manually open the message, as it won't appear in the preview pane, before the macro can access it. It always returns nothing and fails with the following statement ... Set thisMail = myFolder.Items.GetFirst() Is there a way to automatically unlock this message in the macro or is there some other way I should be doing this Thanks in advance for any insight you can provide. Christopher New ...Show All
Visual Studio What versions of CR can create reports for CR in VS 2005?
Hello. Sorry if this question has been asked a thousand times before but I could not find an answer. I am creating an ASP.NET web application where I use the crystal reports viewer (in VS .NET 2005). The customer for the application wants to design own reports for use with the web application. Which version of Crystal Reports should the customer use in order to be able to design reports that will work with the VS .NET 2005 crystal reports viewer I have the Crystal reports 10 developer stand-alone version and I made a report using it. The report shows up ok in my ASP.NET application but is only showing the data that was saved with the report in CR 10. Is this a compatibility problem between CR 10 and the VS 2005 CR viewer or am I m ...Show All
.NET Development Callback Function for unmanged code in Callback to VB.NET 2005
Hi there I am trying to call API function for a DLL that was written in C, this function takes pointer to callback function as parameter, here goes the declaration <DllImport( "FAPI" , EntryPoint:= "_FAPIEnrollmentEx@24" , CharSet:=CharSet.Ansi, SetLastError:= True , ExactSpelling:= True )> _ Public Shared Function FAPIEnrollmentEx( ByRef deviceHandle As FAPIHandle, ByVal mode As Integer , ByRef archiveHandle As FAPIHandle, ByRef userData As FAPIUserData, ByVal timeOut As Integer , ByVal universalCallback As FAPIUniversalCallback) As Integer FAPIUniversalCallback is a delegate and it's declared as following <UnmanagedFunctionPointer(CallingConvention.Cdecl)&g ...Show All
SQL Server SQL Server vs Windows Application Project maintenance?
I'm a database newbie, trying to decide whether to create an SQL Server or Windows Application project that uses SQL Server 2005 Express. As I understand it, the advantage of an SQL Server project is that the app deploys somehow as part of the database. If that's the case, how would I handle the scenario where the database has been updating at customer site and I need to install just a new release of the software Would I be better of creating a Windows Application project and connecting to the database explicitly Thank you. - Windows Application project == A classic EXE with rich GUI - SQL Server project == a DLL that must hosted by sqlserver, the code you write runs inside sqlserver. NO GUI, only obje ...Show All
Visual Basic database report
hello, i'm using ADODB on my vb8-access. before on vb6 i use data report designer to prepare a print, but here on vb8, how can i do that, without using crystal reports i would like to design my report just like report designer, is it possible or are there any turn around for this thanks hello, i found a way to add Access data, its though ODBC DNS. i've made a connection, created my dataset, and when i run the program, i got an invalid password error. i already supplied the password on my connection. the error is on Me.RolesTableAdapter.Fill(Me.DataSet1.Roles) i'll try to post whatever happens later ...Show All
Visual Basic Cannot access file - being used by another process
I have requirement to copy the .mdf and .ldf database files used by a VB app to another directory when the app is shutting down. I am attempting to this in the Application Events shutdown event, but am getting the error "The process cannot access the file '....mdf' because it is being used by another process". Is there a way I can programmatically release any locks that may be on the .mdf and .ldf files At application shutdown time, all DB operations are complete, so I am not concerned with preventing the app from accessing the DB. Thanks for your assistance. By disposing of all of your connections to the db ...you have disconnected the application from the database files and log...however, since ...Show All
SQL Server Dymamic connection strings in SSIS...
I was reading through the following post regarding dynamic connection strings: http://forums.microsoft.com/TechNet/ShowPost.aspx PostID=812814&SiteID=17 In this posting they talk about setting up a configuration file to setup the connection string, but I am not sure how to apply that connection string to my connection manager. When I go into my configuration file, I can see the connection string, and when I go into the advanced properties of the connection manager, under the "Named ConnectionString\FileName" property, I set the property value to the name of my configuration file, but when I test the connection I get an error that the connection string property has not been initialized. Can someone please assist me w ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Turn off mouse drag in SampleFramework
I've been acquainting myself with the SampleFramework. I tried to figure out how to turn off the mouse drag feature but cannot. Any help. I have no mouse code in the main class generated. Thanks, Bubba Look in the Common directory where the sample framework lies. You will find the mouse handling code there. Be sure to make your own copy though, otherwise other samples might not work properly. ...Show All
Windows Forms Wait for event before continuing in method
I have a class that reads in a file, which may contain multiple lines. If it does contain multiple lines I create another form that allows the user to select the line that they want (it doesn't display a string, but rather I create graphics). The thing is, I need to pass the value that they have chosen back to reader class before processing. What is the best way to make it wait before continuing ie... in a method of the reader class Form2.Show() // in form 2 I have a public method that stores the value they have chosen. // Form2.GetChosen if (Form2.GetChosen == null) // this will always fire.. because GetChosen hasn't been set yet.. // how do I wait for the Form2 form closed event Maybe I am missing something easy here, but I am lost and ...Show All
Windows Forms Looking for best approach for MSMoney Look-A-Like [VB]
If you're familiar with MS Money; I am developing an application that has the look and feel of Money but different functionality. How do they do it or what is the best approach. I've read several ideas, but before I start I wanted to get additional feedback: The concept: A Customer button that opens a customer "home" page with customer specific tasks located in the spine with the results displayed in the window to the right. A Reports button that opens a Reports "home" page, again functioning the same as above. There will be several of this "pages"... I've thought of using the MDI/Child approach but the number of panes used in each group became difficult to manage. I've thought of the SDI app ...Show All
Software Development for Windows Vista Define Global EventDriven Events at the Workflow Level
Hi I created some EventDriven Events at the workflow level. I am now trying to access them through the object model but unable to see them. Can someone provide some code Thanks Nitin Mistry Canada If you are in a state machine, then you'll access them through the state machines child activites. workflow1.Activities["your event driven name here"] or workflow1.eventDriven1 If you are using a sequential workflow, then you'll need to drill down into the EventHandlingScope then into the EventHandlersActivity to get the EventDriven activity you want. worklfow1.eventHandlersActivity1.eventDriven1 These assume your standard default names for the activities, so your names may vary. If you p ...Show All
Game Technologies: DirectX, XNA, XACT, etc. DreamBuildPlay is up!!!
Now go register!! Actual contest details to come the week of Feb 5th Plese, Someone at Microsoft.... the drembuildplay site, even though the competition should be global, does not allow non-US people to register. I don't live in the U.S., so I can't choose any state, the zipcodes in my country are 6 digits long, and the telephone numbers are not in the US format. Edit: didn't see errolian's post before i posted this. P.S. did I mention I passed from neutral state, to exalted state and then down to low-morale state in about 2 minutes .... does this make me emotionally unstable ...Show All
Visual Studio Express Editions Problem with default settings for database creation in Visual C# Express
Hi I am creating an test ap and I create a database from within the Visual C# 2005 Express IDE with User Instance set. I create a dataset, drag the dataset set to GridView unto a form and run the application. Everything works fine. I add rows, save them. But, when I delete a row, and click the Disk Icon for update in the menu strip, the application blows off and throws me an exception. Why does this happen by default without writing even one single line of code Here is the exception error: System.InvalidOperationException was unhandled Message="Update requires a valid DeleteCommand when passed DataRow collection with deleted rows." Source="System.Data" StackTrace: at System.Data.Common.DbDataAdapter.UpdatedR ...Show All
