JohnGalt's Q&A profile
Visual C++ When I use the following code to invoke a COM function, can I return a array from vResult and how should I change the data typ
When I use the following code to invoke a COM function, can I return a array from vResult and how should I change the data type conversion of vResult I appreciate your help. CComPtr<IDispatch>pdispScript; .......... CComVariant vResult; if (SUCCEEDED(pdispScript->Invoke(dispID, IID_NULL, 0, DISPATCH_METHOD, ¶ms, &vResult, NULL, NULL))) { if ((vResult.vt != VT_EMPTY) && ((vResult.vt == VT_I4) || SUCCEEDED(vResult.ChangeType(VT_I4)))) { *pIntResult = vResult.lVal; bRet = TRUE; } } -- jake -- jake Can you give me the sample of how to return a array from vResult of ...Show All
Visual Studio Team System custom fxcop rule to check is default present in switch
Hi, I wrote a custom fxcop rule to check Is Default present in FxCop. After some days when i checked it i found that it was not working properly. Do give any any input on how to check is default present in a Switch statement or not. I have attached below the code that i wrote previously; public override ProblemCollection Check(Member member) { if (member.NodeType == NodeType.Method) { Method method = member as Method; Instruction instruction = null ; InstructionList instructions = method.Instructions; for ( int i=0;i<instructions.Length;i++) { instruction = instructions ; if (instruction.OpCode == OpCode.Switch||instruction.OpCode == OpCode.Beq||in ...Show All
.NET Development calling managed code from c /win32 dll
hi, i have a dll wrote in visual c 6, and i have to receive inside this dll data coming from some managed assembly wrote in c#. i cannot upgrade to visual c++.net and make too man changes to the c code, because i have several header shared with a firmware, so i would like to expose some methods from managed assemblies and call as normal dll functions. is this possible to this or i have to create another dll with com support, so i can user standard interop to use the managed classes and wrap them and use this dll from my c dll best regards, Luca Morelli If you want to call the C# code from C, you should consume the managed code as COM. Any managed component can be exposed as a COM ...Show All
.NET Development Itanium Web Services
We are deploying a web service to an Itanium box. Everything works great on the 32 bit development platform but when we move it over it to the Itanium box errors are thrown. Does anyone know if it is possible to run debug on a Web Service that is located on an Itanium server If so, how is it done Thanks What kind of errors are being thrown Have you installed the itanium version of .net 2.0 - http://www.microsoft.com/downloads/details.aspx familyid=53C2548B-BEC7-4AB4-8CBE-33E07CFC83A7&displaylang=en ...Show All
.NET Development Xml index in parent
Hello, I have a XmlNode object and I want to know its index in its parent. the following code does the job but the performance is poor. any idea thanks public int getIndex(XmlNode node) { for ( int i = 0; i < node.ParentNode.ChildNodes.Count; i++) if (node.ParentNode.ChildNodes.Item(i).Equals(node)) return i; return -1; } You could try with XPath, check yourself whether that is faster. Approach in pseudo code is e.g. public int getIndex (XmlNode node) { if (node.ParentNode != null) { return node.SelectNodes("preceding-sibling::node()").Count; } else { return -1; } } ...Show All
SQL Server Developing Stored Procedures using Management Studio Express
Hi, I am new to SQL server 2005. I am developing stored procedures as follows in Management Studio: 1)Right click Stored Procedures folder on a database 2)Select "New Stored Procedure" 3)Write the query in a .sql file 4)Execute the query. Now in this model, I dont seem to have a develop->test->develop and then deploy, type of development cycle. The problem is each time I execute a query it is deployed and re-executing it results in an error like: "There is already an object named 'NewEmployee' in the database." Which forces you to manually delete the SP and re-execute your query. It doesn't give you a chance to test your SP logic before deploying. Contrary to this, If I developed CLR SP's in Visual Studio, I wou ...Show All
.NET Development Better way of inserting rows into tables
Hi, Im writing a server side application where clients sends data to it. The server processes it and then propagates the packets to all the other clients. Yes the client program sends data to the server consisting of rows of strings. These strings normally start with a little header (e.g. stktran, stklev) that distinguishes what sort of strings they are where its appropriate function processes it. There are about 52 different functions that corresponding to 52 different string headers. Each function normally inserts a new row or performs DML operations on specific tables. My problem is, even though I have a dedicated thread processing all of these data. I find the operations (e.g updating, deleting, inserting etc) are painfully sl ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Geometry Shaders in XNA?
I have been lamenting about lack of support for old vidboards in other threads... Now what about the new stuff that's coming on the shelves Will I ever be able to write a geometry shader in XNA to feed my brand new GF 8800 I think no because XNA was build around DirectX9.0c. XNA must work also on XBOX 360 that is DX9. But I hope that microsoft will implement a DX10 version ...Show All
SQL Server Example of SMO or WMI to configure SQL Server port number.
Hi, Are there any one who give a example of SMO or WMI to set SQL Server port number Use the server class: http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.server.aspx Buck Woody ...Show All
Visual C# Adding Web References at Run Time
I'm working on a program and need to be able to add web references at runtime and haven't been able to find anything that would let me do this. Basically this is the way the program will work: 1. Allow user to enter asmx URL. 2. During runtime process the web service so it is accessible. 3. For now lets just say I want to print out all of the methods available from the Web Service. I've found examples of the AddWebReference method using an Add-In but can't seem to find anything explaining how to use this from a c# program. Any ideas or thoughts would be helpful. - Chris Yeah, I actually came across the same problem a couple years ago, and ended up manually parsing the WSDL ...Show All
Visual FoxPro Dbf Autoincrement with ADO
Hello everybody, I created a table with an autoincrement field( CREATE TABLE `Synch_LogFile` ( `ID` I Autoinc NOT NULL, `TableName` C (100) NOT NULL, ...) ) when I try To open it by ADO with VB (Select * From Synch_LogFile) I get this error message: [Microsoft][ODBC Visual FoxPro Driver]Not a table. What's I'm doing wrong Thanks, I downloaded and installed, but I already had the version 6 of the driver. Now I tried 2 things: 1) with this connection string (Provider=MSDASQL.1;Persist Security Info=False;Data Source=Arca) I still got the message "[Microsoft][ODBC Visual FoxPro Driver]Not a table." 2) with ththis connection string (Provider=VFPOLEDB.1;Data Source=C:\Programmi\Microsoft Visual FoxPro OLE DB ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Where can I find SamplerState reference
Hi guys! Could someone point me to a reference that defines which initializers are available for SamplerStates I've seen the examples (as the one below) and documentation in the DX December release, but can't seem to find an actual summary of what I could define. SamplerState samLinear { Filter = MIN_MAG_MIP_LINEAR; AddressU = Wrap; AddressV = Wrap; }; Thanks! ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Trends in Managed Game Development
Hello all I'm just starting developing games and am wondering which language / envirronment to write them in. At the moment for experimenting using Direct3D I'm using C#, with Visual Studio 2005 (.NET), and mucking around with DirectX 9, and XNA (the XNA game studio express). I've always figured that the professional game devs use unmanaged C++, but is that changing now with the additional support for managed DirectX So, in short: If I want to make a game using DirectX, what language / environment should I use to make it Thanks =) -Cabbeh Lots of game shops use Visual C++ and Visual Studio. Don't let the .NET scare ya, it's still plenty easy to crank out unmanaged c ...Show All
Visual Studio Team System TFS - Undo Checkout in an environment where multiple checkouts are disabled?
We have configured our TFS server to disable multiple checkouts. Today, a developer left the office early with a file checked out; a coworker asked me (the TFS admin) to undo the checkout. This was more challenging than I anticipated. Here's what happened (names changed to protect the guilty): C:\Program Files\Microsoft Visual Studio 8\VC>tf lock /lock:none /workspace:workspace;username $/code/foo.cs / s:http://server:8080 TF10152: The item $/code/foo.cs must remain locked because its file type prevents multiple check-outs. OK, so I temporarily enable multiple check-outs & run it again: C:\Program Files\Microsoft Visual Studio 8\VC>tf lock /lock:none /workspace:workspace;username $/code/foo.cs / s:http://s ...Show All
SQL Server Date query problem
Why there’s a problem with the folloe select statement: SELECT * FROM table1 WHERE ISNULL(DATE_FIELD) DATE_FIELD is a datetime field of the table table1. There’s an error that this function need 2 arguments, but I find in th help that is only one of them. How can I do that hi, ISNULL(a, b) is a function to replace "a" with "b" in case of "a" being NULL.. it's equivalent to CASE WHEN col_A IS NULL THEN b END operation.. what you are looking for is the .... WHERE DATE_FIELD IS NULL .... comparison... http://msdn2.microsoft.com/en-us/library/ms191270.aspx regards ...Show All
