|
Hi, thank you for your advices
Error is:
Server Error in '/my_p' Application.
--------------------------------------------------------------------------------
The specified module could not be found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: The specified module could not be found.
jenny
|
|
|
|
|
It appears that the SMS assembly can't be found. You should put this either in the bin sub-directory of your web application or install it into the GAC by dragging into %windir%\assembly or using gacutil -i theAssembly.dll (only referencing the SMS assembly).
Anything beyond that, you should consult the web site for the SMS assembly you're using.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Aaand please check this link to understand what I'm dealing with...
best regards
jenny
|
|
|
|
|
https://www.exhedra.com/vb/scripts/ShowCode.asp?txtCodeId=1404&lngWId=10
ups sorry!
well, i am sleeping
i forgot to write the url
jenny
|
|
|
|
|
Hello !
I'm writing an application in C# that must be able to look for information in MSDev if at least one MSDev process is running.
Precisely, I'd like to get the list of the files that are currently opened in the MS-Dev editor.
I think I must add a Reference such as : COM / Visual C++ Text Editor
But I don't know how to use the component...
Does anybody know the right way to do that ?
Best regards,
- Éric -
|
|
|
|
|
Write click on Referenes in your project, select Add Reference then from COM tab browse your dll then simply you can add namespace and use it.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
Thanks Mazy, but that's what I've done and the problem is that I don't know how to use this dll/namespace so as to connect with an MS-Dev process running on the same computer and to get the list of the files which are opened in MS-Dev using COM.
- Éric -
|
|
|
|
|
If you're looking to write a plug-in, you can reference EnvDTE. You can find more information about this on MSDN, Manipulating the Development Environment[^]. More easily, just create a new add-in project in VS.NET. You can get access to the open files (the text editor itself won't help) from there.
If you're trying to do this external the development environment, I'm not sure how you could get a reference to the EnvDTE object or if it's even possible. I do know that devenv.exe does register open files in the running object table (ROT). You could P/Invoke GetrunningObjectTable to get a reference to the IRunningObjetTable (a COM interface, so you'll have to import it or re-define it in C#). You can then enumerate the objects using the EnumRunning method with an IEnumMoniker (forunately, .NET already exposes the UCOMIEnumMoniker interface so you don't have to define IEnumMoniker ). From there, you can get file monikers, filtering on devenv.exe to get the open documents. COM programming experience will be helpful.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Actually I'm trying to do this from a standalone C# application other than Visual Studio (so it's not an add-in).
I'd like to connect with the MSDev.exe process (if one exists) through a COM interface I guess.
I've heard about ITextDocument, ActiveDocument, etc... but I don't know how to reach these interfaces or even if they're the ones I must try to get.
I wish I could find an example of 'communication' between MSDev and a .NET application because I don't know much about COM
Anyway thank you,
- Éric -
|
|
|
|
|
In order to get those properties, you must have a reference to the DTE object that the environment exposes. All those interfaces are contained in the EnvDTE assembly. While you won't be making a plugin, you'll still need that to get the objects and their properties within the environment. There is no way to get a reference to the DTE object with the information provided by the Process class.
You could, possibly, use Marshal.GetActiveObject("VsmIDE.DTE") to get an instance of the msdev.exe DTE object (msdev.exe is for Visual Studio 6, where devenv.exe is for VS.NET 7.0 and 7.1 currently), casting that to a DTE variable (if the process is alive, in which case it adds a moniker to the ROT). This may work, but it's untested.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
It seems to be that... using System.Runtime.InteropServices;
But I'm quite lost since I'm not pretty familiar with COM functionnalities.
So I want to get the DTE for Visual Studio 6 and when I write :
object O = Marshal.GetActiveObject("VsmIDE.DTE");
... I get a COMException saying "Invalid class string".
If you had any idea to help me to solve this issue, I'd be really glad !
- Éric -
|
|
|
|
|
Sorry, seems to be that I gave you the ProgID for VS.NET. The ProgID for VS6 is MSDEV.APPLICATION . Once you get the object from the ROT, you'll need to cast it to DSSharedObjects.IApplication . You can get this by running "tlbimp.exe DEVSHL.DLL", which will create an interop assembly called DSSharedObjects.dll. DEVSHL.DLL can be found in the same directory as MSDEV.EXE. The DTE object is apparently not available in the same way as it is for Office and VS.NET.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Impressive... I probably would never have achieved that without your obliging help.
It works well and once you get this DSShareObjects dll, it's quite plain (especially thanks to auto-completion).
Even no need to use variants or things like that !
May I ask you a last question ? If there are more than one MSDev process in the ROT, how to get the list of their ActiveObjects (in order to choose one in particular for example) ?
I wonder why there aren't some pragmatic articles about interoperability with main windows apps :
- Use of InteropServices (Marshal.GetActiveObject, etc)
- How to get the ProgID of applications ? (strings like "MSDEV.APPLICATION")
- Which dll to convert from COM to .NET ? (like DEVSHL.DLL)
(By the way I don't know what is a moniker)
Summary :
...
using System.Runtime.InteropServices;
using DSSharedObjects;
...
try
{
object ObjetActif = Marshal.GetActiveObject("MSDEV.APPLICATION");
DSSharedObjects.IApplication App = (DSSharedObjects.IApplication)ObjetActif;
DSSharedObjects.IDocuments Docs = (DSSharedObjects.IDocuments) App.Documents;
foreach ( DSSharedObjects.IGenericDocument D in Docs )
comboBox.Items.Add(D.Name);
}
catch(COMException) { }
I'm grateful to you.
- Éric -
|
|
|
|
|
There's plenty of articles about Interop. I've even written a few myself (especially interop'ing .NET and Java). The things I mentioned are obtained through experience - you can't be taught everything.
Not every application registers itself in the ROT. Most applications aren't written with automation in mind (or even care to). This is really an automation thing so developers - like yourself - can "script" (I use that term loosely) the application.
Since you obviously have VS6 installed, if you expand "Microsoft Visual Studio 6.0 Tools", you should see a "ROT Viewer". Start a couple instances of MSDev.exe and you'll notice a pair of GUIDs (or as many as running instances of MSDev.exe). It isn't apparently at first what these are (since the ROT Viewer is VERY old and was never very good compared to many others out there), but if you close an instance of MSDev.exe and click "Update!" in ROT Viewer, you'll notice one is gone. Repeated testing would prove that it represents VS6.
If you want a better ROT Viewer (even though they're not hard to write so long as you know what a moniker - or alias - is and know how to treat it), you can download one here: http://www.lorriman.com/software/rotviewer/rotviewer.htm[^]. It is much nicer and expands the monikers to their compound parts.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi;
I have 2 forms (FormA and FormB) and a text box on each (TextBoxA and TextBoxB).
I want to be able to capture my typing in one text box and in one form on the other form text box. ie, I type in TextBox A and same characters show up in TextBoxB
I realize that when I press a key while I am in FormA and TextBoxA, the keypress event is raised. However, I can't figure out how to trigger the same event in FormB and TextBoxB while I am still typing in FormA.
I really want to raise the same event in form B and not just call TextBoxB_KeyPress method in FormB
Any idea
Thanks
|
|
|
|
|
Hello,
The most appropriate way of accomplishing this would be to have FormB subscribe to the event from TextBoxA. Then, within the event handler, do whatever is needed to add the text into TextBoxB.
laptop_01 wrote:
I really want to raise the same event in form B and not just call TextBoxB_KeyPress method in FormB
May I ask why? I don't see a benefit to raising the event vs. using the information you already have. Assuming you do proceed with this goal, it will likely involve sending windows messages to TextBoxB. Once you start doing that, you will need to be careful that focus issues don't crop up. (You don't want to type a character in TextBoxA, only to find that the next typed character only shows up in TextBoxB. This can be worked around if it does happen, though.)
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Hi,
I am getting problem in the navigation of windows forms.
I have 2 buttons in a form clicking on which it will open two different forms Form1 and Form2 but it is not closing the previous windows. I got some success using the following code:
private void Btn1_Click(object sender, System.EventArgs e)
{
ParentForm.Hide();
Form fm1 = new Form1();
fm1.ShowDialog();
}
private void Btn2_Click(object sender, System.EventArgs e)
{
ParentForm.Hide();
Form fm2 = new Form2();
fm2.ShowDialog();
}
but again ParentForm.Hide() only hides the other form and eating out valuable resources.
Is there any better method so that I can close the previous Form when I call another Form.Actually I am a novice so please help me.
Thanks in advance
Libpcap2001
|
|
|
|
|
No, you can't close it because that form has the Main function on it. When that function ends, you app ends with it. You can only HIDE it, not close it.
RageInTheMachine9532
|
|
|
|
|
Without understanding what problem (business) you are trying to solve, it is not easy to answer this question.
As you have found, hiding the parent form really starts to eat resources. And if this application evolves into a more complex process, you could find yourself n-deep into multiple forms and then find a need to get back to the parent.
One approach if it solves your problem is to establish the first (parent) form as an MDI parent. This parent becomes a container that all other forms live within. You could use menu selections to decide which child to open, and in creating and opening them you make them MDI children. You are still left with the flexibility at the child and parent level that if you need to pop up a dialog box, you can still create your dialog form and do a ShowDialog() from either level (parent or child) If you need to know of certain events occuring within the children you can establish delegates that raise events in the parent to act upon it. For example:
private void menuChoice_Click(object sender, EventArgs e)
{
Form[] children = this.MdiChildren;
foreach (Form item in children)
{
if (item is MyForm)
{
item.Focus();
return;
}
}
string[] args;
PopulateArguments(args);
MyForm frm1 = new MyForm(args);
frm1.MdiParent = this;
frm1.SomeDelegate += new EventHandler(HandleThisEvent);
frm1.Show();
}
public void HandleThisEvent(object sender, MyEventArgs e)
{
}
This will minimize resources of the 'unhidden' form while putting specific functionality into the children that are opened. You could implement a menu in this scenario....but then you go off into deploying a docking manager and third party controls.....too much to cover here.
Hope this gives you some ideas.
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
Hi i want to access exchane server services through .NET ,
Does it have some object model sort
please guide
P.S. PATWAL
|
|
|
|
|
You can use CDO 1.21 (the COM wrappers for MAPI), but you'll need a lot of workarounds if you have to access task items.
|
|
|
|
|
Hi.
My quest is how to sort fields hierarchical in a Crystal Report from within my c#-application.
I know the way how to sort one field (by DatabaseFieldDefintion and SortField ), but what is about multiple sorting fields in a hierarchy? How to tell the ReportDocument, that there are more sorting fields than only one and how to define more than one fields? How to get them to the DatabaseFieldDefinitons-collection? I havent't found an adequate answer yet.
Here's the code for one sorting field:
DatabaseFieldDefinition _dbFieldDef = repDoc.Database.Tables["EXAMPLE"].Fields["EXAMPLE_NO"];<br />
SortField _sortField = repDoc.DataDefinition.SortFields[0];<br />
_sortField.Field = _dbFieldDef;
Additional Info: I'm developing with VS 2003, C# and Crystal Reports 9 (not CR for .Net).
T. Labenche
|
|
|
|
|
You can set up hierarchical sorting when you define the report definition using their wizard. If your report definition is already created, you can customize the groupings and select multiple sort fields, ordered by precendence ascending. You can also accomplish this using nested groups each with their own sorting.
If you're trying to do this through code, see the documentation for the DataDefinition.SortFields collection/array property. I'm betting you could probably add addition SortField s to it.
Other than that, see the Crystal Reports web site for CR-specific documentation, which should also be included with the product.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi all
Does anyone know how I can play .ra files and other multimedia files using C#
Thanks for help!
Medhat Ramses
|
|
|
|
|
I haven't search CP to see anything exist but in addition to that you can import Windows Media Player ActiveX in your project and use it.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|