|
Hi all,
I am trying to create a custom project for Visual Studio.Net. Basically, what I need is for a specific kind of project to appear within the wizard and then I need for my specific kind of code page (like .cs pages, .cpp pages), corresponding to a particular extension, to appear and to be able to work with it.
Any ideas on this one?
Any help would be greatly appeciated.
|
|
|
|
|
This question is better suited to the VS.NET IDE forum.
In either case, I don't have a clue what your trying to accompish...
Are you trying to write your own project template? Like a Windows Forms Application or a Web Forms Application...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How I figured it out (and use it quite often) - go to the installation directory for the VC# or VB.NET in the Visual Studio .NET directory and look at the file structure. Creating a new project or item type is as simple as defining a .vsdir file that points to the wizard files in a sibling directory. These files are either simple templates or contain multiple files that you can use variable replacement. VS.NET defines several variables and you can define your own using a set of HTML files for any wizards and a/some javascript file(s).
If you want more information beyond what you can discover for yourself, you'll need to get Visual Studio .NET Enterprise Architect which includes templates and documentation for creating templates. There is some vague information in MSDN Library[^] about this, but it doesn't tell you much beyond what you can discover and most of the time refers you to use the Enterprise Architect project for creating templates.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
In fact I have already created an addin that works well and gets opened everytime VS is opened. What I need to do is to open that addin as a TAB (like the .cs code pages, for example)....
any ideas?
|
|
|
|
|
That's what I was talking about. See the sub-directories in C:\Program Files\Microsoft Visual Studio .NET 2003\VC# (the default installation directory for VC#).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hmmm
I don't understand.
these are the folders I have at that location:
CSharpContextItems
CSharpProjectItems
CSharpProjects
DesignerTemplates
eCSharpProjectItems
VC#Wizards
VCPackages
Which one do I have to touch to add a tab with my component?
|
|
|
|
|
The directory names should make it obvious, but if you're not sure - look. Like I said, I had no problems figuring it out.
For instance, I wanted to create an interface item, so I copied the related files for the class file from CSharpProjectItems and VC#Wizards and modified them.
Just explore - it's how the world was founded.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
look, everytime you answer me you say: "explore by yourself."
Would I come here to post a question if I had found an answer by exploring?
I AM exploring, but I try this too because I work with tight deadlines. Is it that bad? or what is the whole point of this forum? As a matter of fact everything can be found by exploring so this forum would be useless if we all applied that policy, huh?
I'm just trying to say: don't assume I'm not exploring. I am. But I ask for help to quicken things.
Now, the reason I ask is because there a very concrete thing I don't know: how to make my addin component appear in a TAB in vs.net, a code-style tab, like a .cs tab. I don't even know if that's possible. Is the answer in the folders you told me? Which one? How?
|
|
|
|
|
Look at the directory names: there's projects, project items, etc. If you actually open the files, it's obvious.
It would take an entire article to tell you exactly what to do. I did tell you were to look, since it seemed like you didn't even know before. Forum members are different, and most of us regulars don't just hand over the answers - you'll never learn anything that way. In this case, though, it's a matter of content length: it would take an entire article but can be discovered in a matter of minutes.
Most of what you need to do you can copy, paste, and modify ever so slightly to get what you want, like copying an existing .vsdir file from CSharpProjectItems and creating your own (works best for an installer) pointing to your own directories and items inside that. Create sub-directories in the VC#Wizards directory. Look at examples like CSharpAddClassWiz.
It's really quite simple. You can add new file types and projects to VS.NET this way.
And I don't know what you mean by "TAB". Do you know now many tabs there are throughout VS.NET? Dozens if not hundreds. If you mean in the toolbox where you'd find Windows Forms, Web Forms, and other components (it's not a "TAB"), then see the ToolBoxItem class documentation in the .NET Framework SDK. The class documentation includes plenty of information and example code.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks a lot. I fully understand your reasons and endorse them, too.
By TAB I mean a tab like a code page tab. When you open a .cs file where do you see it in VS? In a code tab! or a .cpp file, etc...
That's what I mean by tab, and that's what I don't see in the files in those folders....
|
|
|
|
|
You mean a window? How am I - or anyone - supposed to help you if you don't use proper terminology. What if I went to a doctor and told them my doodad hurt?
You can't open a component in a window, but that also depends on what you mean by "component" which you mentioned before. A component in .NET is a compiled class that gets instantiated on a Windows Form or UserControl or ASP.NET page or control (among other things).
Before you were talking about tabs, .cs files, and projects. It seemed like you were talking about new project item types (like when you right-click on a project or project folder and select Add New-<Add New Item....
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
sorry
that's what I meant
sorry!
I call that a tab....
Yes, that's what I thought: it can't be done.
Sorry for the inconveniences and thanks a lot.
I hope to have more interesting questions in the near future, and I am sure I will ....
|
|
|
|
|
It is possible!
I just did it with VSIP
Thanks for your help anyway.
thanks a lot.
|
|
|
|
|
Hi
I use C# to programmatically control windows media encoder to encode audio from microphone to streaming server using a push connection. However, there was a delay of around 8 seconds from voice in the microphone to the player. Anyone knows what might have been wrong here?
Thanks
Ferry
|
|
|
|
|
Nothing is wrong, that's the way it works for any served up stream. I've noticed about an 11 second delay coming from my QuickCam to the clients. The delay will vary depending on the speed on the client connection, the speed of the server machine, the speed of the machine doing the capture and encoding,... Also, some encoder must have a minimum amount of data to encode because their schemes may work over the span of a few seconds of data instead of what in front of it right now...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hai there,
i need your valuable information. i don't have any big esposure in think client application. but now i need to do that.
i need your opinion.
which method is good,reliable,efficient,less time consuming and cost effective to store picture files (for a cart application) in sql server or any database.
Sreejith S S Nair
|
|
|
|
|
Create a binary field (like an image field type in your database to store these images. Then use a SqlParameter for your SqlCommand like so:
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "INSERT INTO MyTable (Image) VALUES (@Image)";
SqlParameter image = cmd.Parameters.Add("@Image", SqlDbType.Image);
using (MemoryStream ms = new MemoryStream())
{
bmp.Save(ms, ImageFormat.Jpeg);
ms.Seek(0, SeekOrigin.Begin);
byte[] buffer = new byte[ms.Length];
ms.Read(buffer, 0, buffer.Length);
image.Value = buffer;
}
conn.Open();
cmd.ExecuteNonQuery();
conn.Close(); You should, of course, add some exception handling. How you get the image data isn't so much important as how you store it.
Another alternative is to use your database as a file system and only store a reference to the image files. This make it easier to display the images in a web page since you don't have to worry about either saving the images to a virtual directory when requested, or writing a handler (perhaps even an ASP.NET .aspx page) to extract the data on the fly (if you do, youmight consider caching against the query string params). This is what we do for the documen management portion of our application.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
From the article:Cutting Edge Windows Hooks in the _NET Framework -- MSDN Magazine, October 2002.htm,
i download its demo and test it.
in this function:
public void Install()
{
m_hhook = SetWindowsHookEx(
m_hookType,
m_filterFunc,
IntPtr.Zero,
0
//(int) AppDomain.GetCurrentThreadId()
};
}
When the 4th param is setting to AppDomain.GetCurrentThreadId,the hook does work.
While it is setting to 0(article says global),the hook doesnt work.
What is wrong ?
|
|
|
|
|
Which hook are you trying to implement? Not all hooks work in the global context.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
the hook in the VNCHook.dll is a global one that means every changed message in the desktop will be hooked by the VNCHook.
this can help decide whether the desktop has been changed.
now the problem is how to use it ?
|
|
|
|
|
Well, the MSDN article isn't going to be any help because it knows nothing of the VNCHOOK.DLL. It's not from Microsoft, so their not going to tell you how it works.
The VNCHOOK.DLL was written by a bunch of guys at RealVNC.com. There are no forums on their site and the documentation is REALLY sparse. There is also NOTHING on the normal news groups about the .DLL, other than people trying to remove it from their systems...
If your not able to find a support group that knows specifically about the VNCHook, you're on your own. The guys who originally wrote this thing don't do support for individual users and developers, so...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
All our (Crystal) reports are created using NT Authentication (integrated security). At run-time we want to switch to SQL Server Authentication.
We are using Crystal Reports for Visual Studio .NET 2003 and the database is always SQL Server.
I pasted our code below. This code works fine as long as the database is on the same (local) SQL Server. As soon as we specify another database server then the statement Table.TestConnectivity() always return false!
Can anyone help?
ConnectionInfo ConInfo = new ConnectionInfo();<br />
ConInfo.DatabaseName = "AA_DB40";<br />
ConInfo.ServerName = "MyDatabaseServer";<br />
ConInfo.UserID = "sa";<br />
ConInfo.Password = "secret";<br />
<br />
foreach (CrystalDecisions.CrystalReports.Engine.Table Table in ReportObject.Database.Tables)<br />
{<br />
TableLogOnInfo LogonInfo = Table.LogOnInfo;<br />
LogonInfo.ConnectionInfo=ConInfo;<br />
Table.ApplyLogOnInfo(LogonInfo);<br />
if (Table.TestConnectivity())<br />
{<br />
Table.Location = ConInfo.DatabaseName+".dbo."+Table.Name;<br />
}<br />
}<br />
<br />
crystalReportViewer1.ReportSource = ReportObject;
|
|
|
|
|
An exception type and message would be far more helpful. If one is being thrown, please reply with what it is.
One possibility depends on how ASP.NET runs and what user SQL Server runs as. If ASP.NET runs as the default local user ASPNET, it - by default - will have no access to the SQL Server (even though SQL Server authentication is used, certain security settings may not let an unauthenticated user access the remote machine). Without knowing more about the nature of the problem, however, it's hard to know. This idea is probably not the problem, though - just an idea.
On a side note, you should not store the password in your assembly. Either encrypt it to the registry or .config file (you can actually do both of these, where the encrypted text is read from the registry automatically using the machineKey defined in your application's .config or the machine.config, or a myriad of other ways - search CodeProject for more details). This literal text will be easy to view even using ildasm.exe from the .NET Framework SDK or several other disassemblers/decompilers.
You can obfuscate your code. Most will encrypt literal text, but those aren't too hard to get around. It's just a deterrent.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hai there,
i have a base class and a derived class. A < B.
both classes have a method of same signature and same name.
if i call that method on my derived class the base class method will execute. what is the actual tecnical side behind this ?. if i want to execute the derived class method then what i want to do ?
What is the difference between multi level and multiple inheritance ?
how can i impliemnt multilevel inheritance in C#.
need detailed description. other wise show me some usefull links
Sreejith S S Nair
|
|
|
|
|
To achieve what you're saying, declare the method on the base class as 'virtual' and the method on the derived class as 'override'.
Due to technical difficulties my previous signature, "I see dumb people" will be off until further notice. Too many people were thinking I was talking about them...
|
|
|
|