Montana Jones's Q&A profile
Visual C# Interfaces or direct class access ?
We are creating a C# windows application using a layered approach ie. with Application,BusinessLogic and DataAccess Layers. We have a number of BusinessLogic classes e.g BLPerson,BLDepartment etc which in this case are basically facades for getting, manipulating and persisting data to and from a database. Previously we have accessed methods and properties of the Business Logic classes directly, but is seems that it is better practice to access them via an interface e.g IPerson,IDepartment etc. I have read and think i understand the reasons for accessing classes via an interface but in our relatively small application am struggling to see the benefits in our case. One possible benfit would be that accesing via an interface would ...Show All
Visual C++ Paint' : cannot convert parameter 1 from 'struct HDC__ *' to 'long'
Paint function in microsoft visio viewer 2003 is like this: [id(0x60020035), hidden, helpstring("hidden method Paint")] HRESULT Paint( [in] long HDC, [in] long X, [in] long Y, [in] long Width, [in] long Height, [in] long SrcX, [in] long SrcY); but when I use the following codes to call funcitons: IViewerPtr m_Viewer( _T("VisioViewer.Viewer") ); CString strFunction("D:\\Program Files\\Microsoft Office\\Visio Viewer\\1033\\SAMP_VDX.VDX"); BSTR b = strFunction.AllocSysString(); _bstr_t b1 = b; m_Viewer->Load(b1); SysFreeString(b); m_Viewer->Paint(pDC->m_hDC ,10,10,200,200,20,20); there is the following error, please tell me how to solve ...Show All
Visual Studio Team System Schema Import on SQL2K5 CLR Objects
Hi, I'm not sure if I'm asking this question correctly or not, but here goes. When I'm importing a Schema from a SQL2K5 database that has CLR(C# or Vb.Net) objects written for functions or stored procedures do they get shredded into my SQL2K5 project just as a T-SQL stored procedure would Thank you. Randy Pagels Could you expand on this a bit. I haven't tested it yet but wanted some clarification. If I have a SQL 2005 Database and I'm using CLR code in place of my T-SQL then import the schema, does it come over as CLR code So the T-SQL window is empty Thanks. Randy ...Show All
.NET Development displaying an image from the internet in a picture box / label?
Is there any way i can have a picture box and display an image in it that is hosted on the internet say for e.g. - picturebox1.image ( http://www.website.com/image.jpg ) any help or direction would be great, i would use web browser but i cant get rid of the boarders. It is possible and quite easy in fact, all you need to do is call the Load() or LoadAsync() method on the PictureBox in question and pass in the URL to the image. ...Show All
Windows Live Developer Forums GeoRSS or XML for adding many points
I currently use an array to populate about 120 push pins (and growing) on the map, and it appears slow, see http://www.fulhamusa.com/fusamap/membermap.html I tried to use the AddLayer as described in the interactive SDK, but it doesn't appear to GET the data no matter what. If someone could post a simple example with an example of the xml or georss file too that would help greatly. Thanks Not directly, but that's an interesting idea. Indirectly, you could parse the GeoRSS file yourself, pull the LatLongs and put them in an array, and then generate the polyline from that array. ...Show All
Visual Studio Team System Continuos Integration using Team Build
I made CI work using Team Build after following the microsoft article: http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/ConIntTmFndBld.asp The issue now is that it takes 12 minutes for the CI build to complete after a checkin is done. Now if somebody checks in any file during those 12 minutes, It doesn't queue the next build for that check in. Is there a work around for this I wrote up the steps I took to get CI up and running here: http://geekswithblogs.net/optikal/archive/2006/11/22/97860.aspx So far it is working great, and it queues up builds automatically if check-ins occur during a build. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Simple 3D Cube using BasicEffect -- No shading/color
I am trying to just create a cube using BasicEffect, not shaders like in the sample code for a simple cube in the help (see http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=687011&SiteID=1 ). However, I only see the cube as a flat grey hexagon -- no colors, no shading, not even the edges of the cube are seen -- only the flat grey against the background. When I run the above code, I do get a colored cube. I have an NVIDIA GeForce FX 5900XT, which does support Pixel and Vertex Shader 2.0+. I've messed with every effect method there is, so I'm not sure what I'm missing. Below is the code: using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Frame ...Show All
Windows Forms Working with a database?
When working with a database, a form and multiple user controls, should I place the DataSet, BindingSource and DataTable on the main form and refer to them, or place a copy of the DataSet, BindingSource and DataTable on each user control and refer to it as me....etc. you will have to make the properties/variables public in that case and would be bad design to do so. The idea is to expose only things other classes need to know about, or pass references of objects around classes so they dont have to "know" anything about anyone/anything else but only the objects they get and need to work with. ...Show All
Visual Studio Team System About the SP1s!
I don't understand why there are two service packs released. It says one is for Team Suite and the other is for Team Foundation Server. So I'm supposed to install both on the client machines (since all the client machines have Team Foundation Server Client installed on them) or am I supposed to install the SP1 for the Team Foundation Server on the server itself In other words is the TFS SP1 an upgrade to the server or client part of TFS Thank you, Sammy You should not uninstall your existing TFS installation - just install the service pack and it will update your server. You do not need to install the TFS SP1 on the client machines - Team Explorer is updated by the Visual Studio SP1 installer (d ...Show All
SQL Server Slowly Changing Dimension Historical Attribute causeing same row to be reinserted
I have a Slowly changing dimension that I am using to populate a dimension table. My problem is this when I run the package and any of the fields are marked as Historical Attributes it will add an additional row regardless of the fact that the incoming data and the data in the warehouse match exactly. I've tried several things to fix this problem but so far none of them have worked. Some of the things I have tried that haven’t worked are to match all the data types (which I have to do anyways) I've tried trimming the strings, I've also tried adding just one column I am using a data conversion to convert them from varchar (the source datatype) to nvarchar(the warehouse datatype) I'm at a dead end here and don't know ...Show All
.NET Development How to create events?
I am trying to create a .net remoting project which is given in .net remoting book by microsoft press. But it gives error creating events.. im unable to find which dll should i import in my project to compile it.. here is the interface. public interface IJobServer { event JobEventHandler JobEvent; void CreateJob(string sDescription); void UpdateJobState(int nJobID, string sUser, string sStatus); ArrayList GetJobs(); } and class which using it.. public class JobServerImpl : IJobServer { private int m_nNextJobNumber; private ArrayList m_JobArray; public JobServerImpl() { m_nNextJobNumber = 0; m_JobArray = new ArrayList(); } ...Show All
Visual C++ How to get Disk Number from Drive letter
I want to get Disk number from the drive letter. Suppose if i have 2 hard disks attact to my system and frist have partition C: and D: and second have E: then i want that by giving C: it should return Disk 0 and by giving D: it would return Disk 1. As in Device managment for Window 2000 and later we can clearly see the hard disk numbers as Disk 0 and disk 1 so as CD Rom numbers. Can anyone help me in this regard If no other solutions, maybe this is acceptable char drive[] = "C:"; int diskNumber; diskNumber = drive[0] - 'A'; or diskNumber = toupper(drive[0]) - 'A'; I hope it works. ...Show All
Visual Studio Express Editions CRC32 Calculation?
Hi there, Does anyone know precisely how to calculate a CRC Checksum from a file and/or byte array I've looked at examples all over the web and can't find anything that has helped me so far. Please help! Thanks and regards, Hosma293 Hope the following helps. //----------------------------------------------------------------------------- // in a .h file class CheckSumCRC32 { public: virtual unsigned long block_checksum(const void* data, const int& data_len); inline unsigned long operator()(const void* data, const int& data_len) { return block_checksum(data,data_len); }; };//class CheckSumCRC32 //----------------------------------------------------------------------------- // in a .c ...Show All
Visual Studio 2008 (Pre-release) Load App.xaml at runtime
I'm trying to build an application that can load the app.xaml on runtime. I don't know absolutly if this is possible and if yes how to do this. Who can tell me if this is possible and how Best regards Horst Hi Josh For the moment I will load Ressources at runtime by a Xml, well I could load it with a xmlReader. But is there a better smugger way Horst ...Show All
Visual Studio Tools for Office Update KB908002 not installing during word-addin setup
Hello devs, Im working on a setup project to install an office addin. Im using VS2005 and .NET 2.0. Im trying to get the Shared Add-in Support Update for the Microsoft .NET Framework 2.0 (KB908002) components ( lockbackRegKey.msi, office2003-kb907417sfxcab-ENU.exe, extensibilityMSM.msi) to install along with my setup project. I have installed the KB908002 update on my development machine and included it as a prerequisite in my setup project in order to have these components installed along with my solution. When I run my setup.exe file I get the dialog asking if I want to install the shared addin components on to the machine but when I press install I receive the following error: The following package files could not be found: ...Show All
