Visual Studio Custom project Item - visual-studio

This is more of a question where to look that how to do it..
What I am trying to do is create a custom project item for VS studio, this will have custom code generators etc and will work in the following way..
When I add my new item lets call its a bob item, a few files will be created, myFile.bob, myFile.vb for example. the bob file will hold XML the a custom tool will to geneate the code in myFile.vb or c# etc.
Like some of the database type i will attach a database connection to the bob file, and the drag and drop from the server explorer stored procedures on to the bob dign screen.
this i wll generate a box which will display the procedure, and its parameters (like dropping a table onto the dbml designer), properties will be available for the whole object and also for each parameter to allow the user to change values.
I also want to be able t drag and drop other procedure onto existing ones to create a call stack.
when I add a procedure and or compile a custom tool will use the XML in the bob file to create a class that contains the code to access our data layer for each stored procedure added to the designer.
I am looking to do this in VB2008 and later in VB2010, so I do I create the custom disgnук page!
I hope this make sense.

Related

Which is the most appropriate mfc control to use while creating a dialog window to modify values in a database?

I have to modify existing entries in a database. My Addition entry dialog uses edit controls in order to get values and a submit button to update in database.
I have the need to create a modify dialog that should be able to modify entries when needed by user. Is there appropriate mfc control that can be used for my task?
If you do not want to edit directly on the list control, you can use CListCtrl or CMFCListCtrl.
I think MFC does not provide a list control for editing directly. So, if you want to do it, consider using a 3rd party, like the free Ultimate Grid.

How to create a batch script to find and replace pages within multiple documents

I have created several Word Templates and Forms (over 100). If any form in a template changes, all like forms in other templates must be updated as well. For example, if another field is added to the form, then I need to update 100 templates with this same added field. So, let's say the templates are saved according to client:
Q://Master Templates/Client Name/Client Template
(Note, the client template may have about 30 or more pages - like a contract and the form might be page 29 in this client, but another client may have 60 pages and the form might be page 20).
Then, there is another folder where the form is a standalone form, or part of a group of forms that are used together. Example:
Q://Master forms/Group Forms
Q://Master forms/Standalone Forms
First question: would it make sense to have a batch script that finds the form in each template or each folder; and then should the script find add replace the extra field, or does it make more sense to replace the entire form in the templates?
Second question: how would / could I do this? Is there a way to write the script to replace the form in each location based on the example above?
Third question: what types of security risks or problems such a batch script can create for an enterprise-wide network?
Thank you in advance for your support.
Probably the best answer is to use the Developer ribbon in Word. Within Word, File > Options > Customize Ribbon > Check the Developer item under Main Tabs.
Next, open one template needing changes and click Record Macro then make your changes.
Now you can open (In Windows Explorer, ctrl + click then right click to open multiple files) the other templates needing the changes and replay the macro to make those changes.
You could even record opening another document then just add the VBA code to open the other templates and play back the recorded macro to make the changes.
Here's the VBA to open a document in Word.
ChangeFileOpenDirectory "C:\Users\Administrator\Documents\"
Documents.Open FileName:="My File.docx"
Now once you get at least something partial, post back and we can help refine that.

How to change InstallShield controls properties dynamically?

I have a custom dialog in my IS installer and I want to change some properties such as Height, Top etc. according to the text written in the text areas (on run-time).
Are there any InstallScript functions that handle those parameters (something like CtrlSetText for changing the text)?
Assuming you are using a Windows Installer project type, you can use temporary tables and data. If you understand the underlying table schema you can use InstallScript to write a custom action that changes this during the installation. For starters see:
Q103295 : Dynamically Add and Remove Values from a Combo Box at Run Time

MVC Structure?

I am having some difficulty getting my head around the MVC structure.
What I am still struggling with is, when creating the Control to accompany the supporting code, does one need to include the Object within IB?
Think of IB as a freeze-dried version of an object. It is the object itself in visual form. It's stored in the xib file and pulled out when referenced.
You don't NEED to use IB. You can create an object and add it to a view without ever opening the visual tool (some people prefer to work that way).
Storyboarding carries this to an even greater level where you can create the interaction between views in the form of segues.

How do I stop the linq designer overwriting my manual changes?

I like Linq but find that once the designer has created my classes I have to modify them.
Then when I change my database and recreate my classes in the designer my changes get wiped.
For instance, let's say I have a class called Person.
I create this class, add some non database related methods to it (outside of Linq) and then create a database table with a similar name.
Linq will duplicate this class in the designer.cs file when I drag it in.
So I go and add the partial keyword to the class in that file or even change the class name Linq created.
As development proceeds, no doubt the database table changes and I have to redrag my tables into the designer.
Voila, my manual changes get wiped.
This is most annoying!
In fact, its unworkable to keep modifying code I have already modified.
Any suggestions?
Create a partial class for your context and make your changes there, the designer generated .cs files are recreated every time you click save.

Resources