|
|
Hello everyone,
I am debugging and learning MSDN C# COM server sample.
http://msdn2.microsoft.com/en-us/library/aa645738(vs.71).aspx
I am using Regasm to generate Windows Registry scripts, here it is,
I can understand that for C# COM Server, since it is managed code, it will use mscoree.dll as the entry point. But I can not see anything related to the real codebase dll (CSharpServer.dll), which contains the real implementation of coclass and interface definition.
I am wondering how mscoree.dll find and invoke real implementation in CSharpServer.dll?
[code]
REGEDIT4
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation]
@="CSharpServer.InterfaceImplementation"
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation\CLSID]
@="{C6659361-1625-4746-931C-36014B146679}"
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}]
@="CSharpServer.InterfaceImplementation"
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="CSharpServer.InterfaceImplementation"
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v2.0.50727"
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32\0.0.0.0]
"Class"="CSharpServer.InterfaceImplementation"
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v2.0.50727"
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\ProgId]
@="CSharpServer.InterfaceImplementation"
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]
[/code]
thanks in advance,
George
|
|
|
|
|
Hi!
Without looking into it too deeply: I think the assembly containing the CSharpServer has to be placed in the GAC. That's the codebase...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi mav,
Do you know how to check GAC? In MSDN, it is not mentioned that we need to register codebase into GAC and only Regasm is mentioned to be used.
regards,
George
|
|
|
|
|
ReHi!
There are several ways, for example using gacutil.exe.
If you're using regasm to register an assembly, you either have to give a codebase so that your code can be found or put the assembly into the GAC. Can't imagine a different way for .NET to find the assemblies...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thanks mav,
If you look at the output I posted in the question, there is no real codebase (actual dll which contains coclass implementation), only mscoree.dll.
So, I doubt if we are not using gacutil tool, how/whether the actual codebase could be found. Any comments?
regards,
George
|
|
|
|
|
Pleasure to help !!
|
|
|
|
|
Ok here's the skinny:
I want to allow users to create their own forms and they are familiar with html, hence they will write them in html.
It is basically data entry, but in varying formats.
I want to be access the information they put in the various input boxes through my windows application.
Is there a way to query the forms they create. In other words, can I have their forms in an html browser on one panel and have the submit button on another panel where the code would reside and I can see their entered data?
I appreciate any and all help!
Thanks!
Sean Murphy
"All things great and small start at the same point, the first step."
|
|
|
|
|
Hi Sean,
May be I did not understand what you wanted, but I think Sharepoint is what you need. Or if you want an ASP.NET application, you will have to build a Custom CMS (content management system), where you can allow users to create something like articles and and then, when they submit the article, you can review them before it goes online....
If above does not makes any sense, I am sorry
|
|
|
|
|
I want to read the text from input objects, like a basic textbox for a name, in an html document but without it having to be "post"ed.
here's an example
Name:
Address:
Notice there is no submit button on the form.
Someone would fill in their name and a line of their address then click a System.Windows.Forms.Button
Here is my code (which doesn't work)
foreach(HtmlElement elt in browser.Document.Forms)
{
foreach(HtmlElement ch in elt.GetElementsByTagName("INPUT"))
{
MessageBox.Show("Text = " + ch.InnerText);
}
}
I was expecting it would show the text that was typed in but I keep getting a blank return.
Any help would be great!
Thanks!
Sean Murphy
"All things great and small start at the same point, the first step."
|
|
|
|
|
You can try writing client side code, javascript may be.
In the textbox, you can register the script for key up (or some other as convenient)
txtBox.Attributes.Add("onKeyup",javascript:ShowText(this.ID)");
and javascript:
ShowText(param)
{
var textBox = document.GetElementByID(param);
alert(txtBox.Value);
}
hope that does that.
|
|
|
|
|
That lead me perfectly down the path I needed to go. Thanks RepliCrix!
For anyone else out there, the code I used was
C#
public form1()
{
InitializeComponent();
// Make the form the scripting object
browser.ObjectForScripting = this;
// Display the html file file.html
browser.Navigate(Application.StartupPath + "\\file.html");
}
void Button1Click(object sender, EventArgs e)
{
foreach(HtmlElement elt in browser.Document.Forms)
{
foreach(HtmlElement child in elt.GetElementsByTagName("INPUT"))
{
browser.Document.InvokeScript("SendTypedText", new object[] { child.Name });
}
}
}
public void ShowText(string ibox_name, string ibox_value)
{
MessageBox.Show(ibox_name + " = " + ibox_value);
//Of course now you can do whatever you need to do with the data
}
//file.html code
Box1:
Box2:
Box3:
//Send Back Input Values
function SendTypedText(param)
{
var thisForm = document.forms[0];
window.external.ShowText(param, thisForm[param].value);
}
Thanks!
Sean Murphy
"All things great and small start at the same point, the first step."
|
|
|
|
|
hi looking for an open source LDAP server for use in conjunction with C#/.NET - any good suggestion besides openldap?
Correct me if I'm wrong, don't find a good number of documentation/tutorial with OpenLDAP, from perspective of a dot-net developer.
I'm using this for hierachical information storage - user/group, classification... etc...
Thanks in advanmce
devy
|
|
|
|
|
Hi,
I need some expert opinion. Assume that i need to display 3 shape(circle, rectangle and a triangle). I should be able to select any of them at one time to be drag and drop. So, should i draw these shape onto the form directly or should i save it in the bitmap and load the image. if using bitmap, each of the shape must be save separately?
Thanks
|
|
|
|
|
Hi,
I see no reason to use bitmaps for this.
As long as you get the drawing to look the way you want it to look,
by just using a couple of Graphics drawing primitives, just do that.
If the intended result requires a lot of shading, reflections, whatever (so it looks
more like a picture, not a computer generated drawing), then you might want to switch
to bitmaps.
|
|
|
|
|
I've done a decent amount of C++ in school last year (college level work) and I was interested in giving a GUI C# work a go.
I have experience in a couple BASIC languages and Java, that coupled with my C++ experience has made it fairly painless so far.
I have a class called "UpdateTimer" that obviously implements a Timer object. The class is passed the data class from where it gets all of its data. However, once it has completed, I want it to refresh the data in two labels.
I have tried both referencing to the lables directly and the method in Form1.cs that called "refreshData()" both with no luck.
I am lost on what to do. I am sure that my methodology is wrong. I would like to be able to implement the timer outside of the Form1 class.
Thanks for any assistance!;P
|
|
|
|
|
You're writing your own timer object? .Net provides timers for you - there's the Timers.Timer[^] for general all purpose use, and the Windows.Forms.Timer[^] for thread-safe use with Windows Forms.
If those don't suit your fancy, what kind of problems are you having with the "UpdateTimer" class?
|
|
|
|
|
hi guys:
can everyone tell me, what is interface, why do we use interface and when do we use interface?
thanks
|
|
|
|
|
A quick Google[^] would reveal the answer. Ok the page is in VB but it demonstrates the concept, basically an interface is a contract. When you implement an interface you are basically signing an agreement that you will implement all the fields, properties and methods defined in the interface. You can then rather than dealing with definite objects you can deal with the common interface without having to know what the underlying type is.
It's commonly used in plug in[^] based systems.
|
|
|
|
|
Hi All,
I have a page that is used in two separate scenarios, either directly linked in the web application, or as a popup using window.open. On this page is a datagrid with three columns i care about, column1 is just some information (a KeyWord) and defaulted to visible=false for when the page is used as a popup, column2 is the same information but used as a link when the window is a popup, and column3 is a select command item also default to visible=false.
basically, i want it so that when used as a popup:
column1 = visible false
column2 = visible true
column3 = visible false
when linked in the main window:
column1 = visible true
column2 = visible false
column3 = visible true
(the exact opposite)
I want to be able to check onload the page's status, and change the visibilities accordingly. Changing the visibility is easy enough, but i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code.
Any help would be appreciated
|
|
|
|
|
Craigpt wrote: i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code.
You can't. The browser doesn't tell the server where the page will be displayed, so the server simply doesn't know.
If you put a value in the querystring that reflects how the page is used, the server can check that value.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa wrote: The browser doesn't tell the server where the page will be displayed, so the server simply doesn't know.
Ok thanks, that's what i needed to know. I remembered the popup window already had querystrings in the URL so i just used the presence of those to decide.
|
|
|
|
|
Wouldnt' this be more appropriate in the ASP.NET forum?
|
|
|
|
|
Ya, it was a toss-up for me, but i decided that in the ASP.net forum i ran the risk of getting a VB.Net answer, and if code was available i wanted it in C#
|
|
|
|
|
There isn't that much difference and both can easily be translated between the other, besides you could always just ask for it to be given in C#.
|
|
|
|