Martin Gentry's Q&A profile
Visual C++ Save a file to Ansi from a Unicode only app
I think the title says it all. I've avoided Unicode with a passion until now. I have an application which is defined Unicode. I need to save one file in Ansi format. It is a win32 api so no MFC. Any and all help would be appricated. I'm using CreateFile to create the file and WriteFile to write it. Nothing else to add. I need the end file in ANSI. Thanks, Bubba Found an answer about thirty minutes after posting this. It's included and works great! //calling it LPSTR strTemp; UnicodeToAnsi(wVCnt, &strTemp); //end calling it //The function from the MSDN Library HRESULT __fastcall UnicodeToAnsi(LPCOLESTR pszW, LPSTR* ppszA) { ULONG cbAnsi, cCharacters; DWORD dwEr ...Show All
Visual Basic Module and class
I am new in OOP. I have two questions: 1) What is difference between module and class 2) To declare public variable, put in module or using property in class file What is advantage of using property MSDN introduction: http://msdn2.microsoft.com/en-us/library/w86s7x04.aspx Hope this helps. ...Show All
SQL Server Execute DTS Package
Hi, I would like to REMOTELY execute a DTS Package stored on the server SQL2000. I would like to realize an application (VB.net or ASP.net) able to execute from the client computer the dts package on the server. The application should be able to give to the user the information about the success/failure of the Package's steps. Is this possible this is my scenario: Package stored in SQL2000 server (ServerA) Application on client computer Web server (in case to use ASP.net) on ServerB Can anybody post some example/code/explanation Thank you! An extremely simple way to execute dtexec remotely is to use psexec.exe, which can give you error,progress, and other info on standard out and stan ...Show All
SQL Server insert only time in sql server database
hi, i want to insert only time in my sql server database.but when m try to insert time in database it takes time+default date. i want to eliminate this default date. plz any one know this then tell me. Regards, shruti. There are only two date data types available in SQL Server (DateTime and SmallDateTime). So if you use any of these two data types, it will use the default date along with your specified time. It is just like how it takes a default time when you only insert date. Here is a small workaround. Create Table Schedule ( ScheduleID Integer Identity , ScheduledTime DateTime ) Go Insert Into Schedule ( ScheduledTime ) Values ( '10:15:00 AM' ) Go Select ScheduledTime As DB ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Specular is not working for some models
I have written a program in VC++ and DX9 to achieve specular lighting. I am using the models provided with the DX SDK for testing purpose. Specular lighting is working for some models (dolphin) and it is not working for other models (like teapot). Is there something that we should specify in the .X file for specular lighting or is everything related to the code alone Also, I don't have access to any 3D modelling software right now. So please don't ask me to create my own model for solving this problem. I will do so when I get one, along with an exporter. Please tell me what's wrong/missing with the other models in the SDK or is it something I should include in the code. I would greatly appreciate if someone could help me with this ...Show All
.NET Development What is the right way to dispose Control instances?
Hi, In Windows Forms application I am trying to dynamically create and dispose Controls. However, while testing it I ran into the fact that the way I do it leads to a stable GC Handle leak (one per instance). Here is the code that seems to produce a leak: for ( int idx = 0; idx < 5000; idx++) { Control tmpCtrl = new Control (); tmpCtrl.Dispose(); tmpCtrl = null ; } GC .Collect(); GC .WaitForPendingFinalizers(); This results in exactly 5000 extra GC Handles (according to performance counter). What am I doing wrong Thank you, Leo. If the object is of a type that implements the IDisposable interface use the using statement: ...Show All
Software Development for Windows Vista Show of Hands! Is WF by itself a viable approach to addressing a customer's workflow needs?
Like many of us in the forum I am in the all too often unenviable position to influence my client's decisions. I currently have a lot of customers evaluating workflow, many for the 1st time. I personally have avoided building "custom" workflow solutions whenever possible as I have had success in the past implementing packaged workflow or BPM offerings, both Microsoft-based and less recently non-Microsoft-based. It's allowed me to focus my energies on building solutions and solving real business problems, not building infrastructure. Granted, there are customer situations that don't require or afford you the opportunity to buy a packaged solution to address a workflow/BPM need, but I would argue those are/should be the exception n ...Show All
Visual Basic strings
If you have a doublebarreled name in a textbox, how do you capitalize the first letter in the second name. E.G Carly-anne all advice would be welcome txtName1.Text = Char .ToUpper(txtName1.Text.Chars(0)).ToString() + txtName1.Text.Substring(1) The above line of code is what i am using for a textbox name control I tried to figure it out from that line but to no availe ...Show All
SQL Server DTS Package
I have created a DTS package that connects to the database fills a temp table with data based on my sql statement, generates a text file with the data in the temp table, and after the file is generated the temp table to truncated. The package has been added as a job to run daily, but the problem is sometimes the job will not generate data in the text file. I get an email with the file attached as soon as the job ends, and if i see that no data is in the file I run the package manually, and for what ever reason the file will then have data. Can someone tell me why the job will sometimes pull data, and sometimes not. But manualy running it will always pull data. Thanks in adavance for helping!! ...Show All
Visual C++ How can I use the Win32 API DeviceIoControl to send the SCSI Write ommand(0x2A) to the USB MASS Storage device?
I have a USB Pen Drive device. My application try to write some data to device. It can work well in the windows XP, but do not work in thw Vista. Any ideas, about send SCSI Write Command. 1. Obtaining a handle to a device HANDLE hDevice = ::CreateFile(" \\\\.\\F :" , GENERIC_READ | GENERIC_WRITE , FILE_SHARE_READ | FILE_SHARE_WRITE , NULL , OPEN_EXISTING , 0 , NULL ); 2. Set SCSI Write Command (0x2A) SCSI_PASS_THROUGH_WITH_BUFFERS m_Sptwb; memset(sptwb, 0, sizeof(SCSI_PASS_THROUGH_WITH_BUFFERS)); sptwb->spt.Length = sizeof(SCSI_PASS_THROUGH); sptwb->spt.PathId = 0; sptwb->spt.TargetId = 0; sptwb->spt.Lun = 0; ...Show All
Visual Studio crystal reports 9.x compatibilty with Windows Vista
Unable to gauge out whether Crystal Report 9.x is reqd as minimum or absolute in Windows Vista if not then which version is required as minimum and/or absolute in Vista Thanks and Regards Luv Walia Hi, I tried to install CR9 on a fresh Windows Vista Ultimate installation (retail version, downloaded from msdn). The main, standalone application works fine, but the report designer component hangs in vb6. I tried everything that came in my mind: reinstalling it a few times, with administrator priviledges on and off, enabling and disabling uac, manually registering dlls, ... No way, when you try to insert a report in vb6, the first dialog is shown, letting you choose as usual between a wizard, a bl ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Clarification on device creation, resetting, and deletion...
I come from C/C++ and DirectX 9 where the defacto standard (at least with their early examples) was an InitDeviceObjects()/DeleteDeviceObjects() pair of functions and an InvalidateDeviceObjects()/RestoreDeviceObjects() pair of functions. It all seemed pretty clear cut as to when any of those functions ever got called. The Init/Delete functions where called for device creation and deletion. The Invalidate/Restore functions were/are typically called for device reset etc. Within those functions -- if you had static device assets (i.e. MANAGED memory pool) -- you could create and delete them inside of the Init/Delete functions. For device assets that needed to be recreated due to the fact that they don't persist across a device reset (i.e. DEF ...Show All
Visual Basic Exe takes more than 35 sec. to load
Hi freinds, I am using vb.net 2005. The problem is when i install the project on the clients PC it take more that 30-40 sec to load. Why does it takes so much time as compared to vb 6 applications. Is there any other way to improve the performance Please Help me out. Thanks Puneet Minda By default applications deployed using ClickOnce checks for updates from the deployment server(typically a server in the intranet) everytime it launches. ...Show All
Visual Basic Is the IDE Tab control available as a component?
The IDE Tab control has some features that I would like as a run-time component - mainly the auto-hide feature. Is the component MS uses in the IDE availalble as a usable component If not, is there a tab control component that behaves like the IDE version with auto-hide Thanks for your replies. I'm using .NET 1.x and could not find a control with all the feature like the IDE tab control so I had to use someone elses: http://sourceforge.net/projects/dockpanelsuite/ ...Show All
Visual Studio Team System Using TFS + TeamPlain as project portal GREAT first impressions
Hello! We just set up our organisation + customer wide project portal using TFS + TeamPlain ( www.teamplain.com ). Using "Scrum" process model, I cannot praise how much this boosts our project management and collaboration with the customers. First impressions are really superb, astonishing and GREAT! After spending little while of creating the "account sandboxes" for our customers in the Active Directory environment restricted for anything except authenticating to the TFS (including SQL Server RS and SharePoint) everything just clicked in. Wow! Seriously, after a day's work we had running web accessible TFS project portal that our customers can access as well for their projects. Almost perf ...Show All
