Ways to update a sql server database from a VC++ win32 project? - sql-server

I'm in the process of creating a Password Filter as described here. I can manage to write the VC++ code. My issue is that i need to update SQL Server database from that code. I dont have any past experience in VC++ Win32 project. My assumptions are
Linking an external dll (compiled
C#.net code) which will take care of
the database update
Hitting a windows service which will
take care of the update
Any insights?

Why are those your only two options?
You can use ADO from directly within C++ by #import(ing) msado15.dll, which exposes lots of useful objects and methods from ADO. See: Visual C++ ADO Programming
There are other options here: Data Access Programming in Visual C++

Okay. Since i dont have good working in knowledge in VC++ i found this solution to be more easy for me to do. Just followed this Microsoft KB to register a managed dll and create a type library and to use it in the VC++ code.
Anyways thanks for your reply joe.
NLV

Related

How to compile a program in c with a fresh copy of windows? No External Software

Is there any way to compile some Windows API code without installing any development environments to Windows?
Does Windows come with a C Compiler built in that I could just write some code in notepad, and run it through a cmd or a batch file?
.NET includes a command line compiler for C#. (not exactly what you asked for, but it might suit you.) I believe .NET is preinstalled on modern versions of Windows. Look in the folder \Windows\Microsoft.NET\Framework\v4* and see if you have a file called CSC.EXE. This is the command line compiler for C#.
See
"How can I compile a .NET project without having Visual Studio installed?"
Working with the C# 2.0 Command Line Compiler
Is it possible to install a C# compiler without Visual Studio?
For more information and examples.
You can also get the free version of Visual Studio that supports C++. Download Visual Studio Community 2013
No version of Windows I am aware of comes with a C compiler.
No, Windows does not come with a C compiler.
And I don't mean to sound patronizing, but why do you think it'd make sense for it to come with one? Sure, it'd be handy --- if it were a decent compiler --- but beside that, it is not required for normal OS operation. An optimizing compiler is a complex piece of software that would not see any use at all from most users (since most users aren't developers --- and even they might prefer using a compiler of their choice instead of something that just happened to be around).
I should note that at least some Linux distros also come without a compiler by default (as long as it's not needed as a dependency for something else --- which, granted, can happen easily).
As others have pointed out, Windows does not come with a preinstalled C compiler. There are several good free one available for download (including a freeware version of microsoft visual c), but that does not mean you can't access with Windows API/SDK.
If you need to make API/SDK calls without the requirement you install anything, you can use Windows Script Hosting https://en.wikipedia.org/wiki/Windows_Script_Host. It supports a number of languages out of the box, such as Jscript, VBScript, and has the ability to add even more options. Using Windows Script Hosting you can create any call you require into the Windows API/SDK.
Newer versions of windows have started to move towards powershell which is even more powerful -- but is not yet universally available which might mean having to install addition software (which I assume is what you are trying to avoid).
I think you may want Visual Studio Express.
http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
You do not mention which version of Windows. Also Windows API calls are customarily built with Visual C++. Although you could build with C# or VB.NET and wrap the calls. As another poster mentioned, if your version includes a .NET, then there are command line building tools available

Is there a way to run my XBAP (or WPF) application as OLE object?

I need to run my WPF application as OLE object. I apologize that if I make it XBAP-application I could, but how?
Generally I need this cause of I need to access my application from CIMPLICITY.
You need to modify your existed .NET application to be COM visible. it's a quite general question and I may suggest to look at .NET - COM Interoperability and Microsoft .NET/COM Migration and Interoperability. I'm sure there is a very popular issue and you can find much more materials about it.

What tools are available to create a help file in Visual Studio 2010?

I need to write a help file for a WinForms app in Visual Studio 2010. Ideally, I'd like to use a tool that integrates with Visual Studio, rather than a totally separate tool.
In the past I've used HTML Help Workshop, but this is ancient, and I recall it was a little funky to use. I also know there was a tool built into the Visual Studio 2005 SDK, but I need something for 2010.
Here are your options...
If you want Microsoft's documentation generator with VS integration:
Sandcastle Help File Builder for help file generation
DocProject to integrate it into VS
Although, it appears that DocProject doesn't quite support VS2010 yet.
For the Non-MS solution there's GhostDoc, which does support VS 2010 integration and appears to be a better solution.
For options that don't integrate into Visual Studio:
DoxyGen
Docu
NDoc3
it is an awkward target for tool vendors. In most shops, the help is authored by professional writers that don't have any use for Visual Studio in their day-to-day activities. Third party authoring tools like RoboHelp is their preferred weapon of choice.
The VS2005 SDK tool you probably saw was HelpStudio Lite, a product of Innovasys. There is no version available that integrates with VS2010 and judging from a forum post they have no intention of releasing one. Their Document X! product however does, sounds like what you ought to take a look at. The eval version is available for download from here.
I remember that a year or so ago some people on Joel's The Business of Software forum were recommending HelpNDoc.
Forum discussion: http://discuss.joelonsoftware.com/default.asp?biz.5.359131.10
As others have said, you can convert the triple slash XML MSDN-style help using Sandcastle on all class-level members and objects
/// <summary>
/// I am a method help Header
/// </summary>
/// <param name="parm1">info for param 1</param>
/// <param name="parm2">info for parm2</param>
/// <remarks>Some Extra Info</remarks>
public override void MeMethod(SourceElement rootElm, Subject subject){
...
Here is the link to Sandscastle
A more feature-rich help generator that integrates with Visual Studio 2010 and generates multiple help formats is VSDocMan . It includes a WYSIWYG comment editor, and actually comments some of your code for you. Extremely useful
ghost doc with documentx or sandcastle is the way to go...Rest is all still very primitive when it comes to 2010. If you have project both c# and C++ then documentx will be the way if its just C# then any one is good.
If the audience for your help file is the user of the application html help 2 is not usable, you will still need to create a chm file. The tool which can do this for your from your winforms application is Help Generator for Visual Studio, which takes away a lot of work in preparing the help and linking it to the forms.
Probably doesn't integrate with VS2010 but I remember using RoboHelp back around '97 and it was ok:ish then so if I needed to write helpfiles now I'd probably give that another look since it seems like it's still around here. Fairly expensive though it seems but if you've got some Adobe licenses (which isn't totally unsual for a development shop) for some other reason maybe you've already got this?
Html Help, is replaced by Html Help 2.
http://www.mshelpwiki.com/wiki/tiki-index.php?page=Help2
Just been doing a lot of research and after testing various tools the http://www.helpgenerator.com/ is the fastest way to put together a help system.

How to start developing Windows mobile applications

I want to write an application for my Windows 6.1 standard smart phone that intercepts incoming SMS messages and auto responds if they match a specific criteria, but despite installing countless SDk's I am unable to do what I need.
The code I want to use relies on the Microsoft.WindowsMobile.PocketOutlook.dll assembly, but I can't seem to find that assembly. Is it possible to use this assembly on a standard mobile device, or do I have to have a Windows Mobile professional device?
So basically I need help getting set up to create Windows Mobile applications.
I am using SharpDevelop (because I
can't afford Visual Studio).
I need the
Microsoft.WindowsMobile.PocketOutlook
assembly (Since I have already written code that should work, that uses it).
A device emulator would also be nice
so I don't have to test on my phone.
Is what I want to do possible on a Windows 6.1 Standard device (HTC OZone)?
Any help would be appreciated, since I am completely stuck at this point.
Thanks,
I tried to compile my code and I get the following errors, as I suspected I would.
The type or namespace name
'WindowsMobile' does not exist in the
namespace 'Microsoft' (are you
missing an assembly reference?)
I can't find the Microsoft.WindowsMobile.PocketOutlook assembly so of course I'm missing an assembly reference.
Where can I get this assembly, and will this code run on my Windows 6.1 Standard phone if I can find it?
In my opinion it's very difficult for someone new to Windows Mobile development to work without Visual Studio.
In theory you can use SharpDevelop or MonoDevelop, but you wouldn't be able to do any debugging on the emulator or a connected device. Being able to debug by stepping through the code while it's running seems to me an unmissable thing if you're new to Windows Mobile and are not quite sure why something you coded is not working. It requires more effort and time to debug something and in the end you might find it more cost effective to buy a Visual Studio license.
The minimum required is Visual Studio 2005 Standard. You could try to see if you can find somewhere that sells it cheaply (as most developers now use VS2008/2010). If you're a student you could get an academic license or take advantage of Microsoft's DreamSpark program. Or if you're a startup you could look at Microsoft's BizSpark program.
Try starting with sample code that has most of you requirements implemented. The SDK comes with the sample: SMSIM
link text
It demonstrates how to use C# to write a managed code version of a Short Messaging Service (SMS) interception application.
I hope this helps.
Mike

VS 2008 WinForms with SourceSafe

We are using Visual Studio 2008 to develop a winforms application stored in Visual Source Safe 2005.
If one of our team members changes a *.Designer.cs file without changing the form's source file the change doesn't appear during a "Get" operation. However, if in Visual Studio you run a compare on the *.Designer.cs file the differences are displayed in the difference viewer.
FYI: We are using the default Microsoft Visual SourceSafe plug in for Visual Studio.
Any ideas why the "Get" operation will not detect changes in the *.Designer.cs files and suggest we pull down the latest version?
Thanks for your help!
Designer files are not intended for manual manipulation. One of the chief incentives for adding partial classes to the popular .Net languages was to segregate the designer-generated code from manual user code, in fact. Manual manipulation of repeatedly-generated code (in pretty much any environment, not just visual studio) is asking for headaches.
What changes are you making to the designer file, and why is it not possible to make those changes to the non-designer source file?
Edit:
Is the project in the IDE properly bound and connected to the source control database (via File->Source Control->Change Source Control)? It should automatically be checking out the designer files when changes are made in the designer view.
I would try doing a Get manually through VSS Explorer (i.e. not through Visual Studio) and see if it works. If not, check to see if the file is pinned to a previous version.
Woe unto you for having to use SourceSafe. At my last job, we used SourceSafe and had a myriad of problems with it. We switched over to Surround SCM and were really happy with it. I'd never heard of it before that job.
To answer your question, any time I ran into a problem like this with SS, I'd do a "forced get": in the options dialog when you get latest, tell SourceSafe to get the latest version from the server regardless of whether it thinks the file is up to date.
Edit: I think the issue is the VS200X plugin for VSS. If you have the VSS standalone application you should be able to do a forced get from there. I now remember having to do this so often that I stopped using the VS200X plugin.

Resources