|
Form2 f2=new Form2(this);
f2.show();???
|
|
|
|
|
And your question is?
Daniel E. Blanchard
|
|
|
|
|
Hi,
I would like to know how to compile the entire C# ASP.NET Application via CommandLine csc.exe, without using VS.NET.
I tried to run the same. But since some files would be redundantly placed in folders like _vti_cnf etc, Compiler is refusing with some duplicate definition errors.
I have one more doubt...
If there are more number of files, how to pass all files to csc.exe and then configure csc.exe to compile to just a single dll by name of application, just like how VS.NET does. (Like ASP.NET application is deepak, then all files need to be compiled to deepak.dll in BIN folder). I am afraid if there are any restrictions to the length of commandline being spawned.
Please advise...
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
I am using a DataSet to store the rows that I am working with. I have been able to add and delete records, but I can't figure out how to simply update a record. Any help would be great.. I'm not sure what other information to give here.
Any help would be great
|
|
|
|
|
Very simple ,something like this:
mydataset.Tables["tablename"].Rows[indexofupdatedrow][indexofcolumn] = value;
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I want an html page inside a WebBrowser control to communicate with the csharp Form around it.
What is the best way to do this, can javascript raise an event that C# can see?
I can't just have the javascript navigate to some special url that my BeforeNavigate event catches, because doing so would cause the page to dissapear.
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
You will need to define three interfaces. IDocHostUIHandler, ICustomDoc and an interface that will define methods you will reference through your JavaScript.
Your form will inherit the IDocHostUIHandler interface as well as the interface your define. Take a look on google for example on how to do this. If you have problems please drop me an email and I can send you some code.
Catch the NavigateComplete2 event that will be fired after loading a web page in your browser control. You can cast the 'sender' argument to an object of type ICustomDoc and then call SetUIHandler. Pass the 'this' pointer to the method call.
Once you've done all of this you should be able to make calls into your form from your JavaScript. Of course these calls can't be made until after you have made the call to SetUIHandler. (ie. If your Javascript is catching some event that occurs before you get the NavigateComplete2 event then it won't work.
BTW: Your JavaScript should look something like this:
window.external.AMethodInYourCustomInterface(<some args="" might="" go="" here="">)
Hope this helps and wasn't too confusing.

|
|
|
|
|
Thanks, I think I've almost got it. I'm actually pretty close to what you describe already. I already have A IDocHostUIHandler assigned with setuihandler. I made an interface with my method, and my form inherits from both IDocHostUIHandler and IMyInterface. I loaded a page that has a script tag with:
window.external.causeShift();
and all I have causeShift doing in my (extended) Form is Console.Writeline("wohoo");
What happens is, I just a get a javascript error: "window.external is null or not an object".
I think somewhere don't I need to connect up imyinterface with the ICustomDoc? I know I'm doing for IDocHostUIHandler as you said (and I know it's working because I have error handlers printing to console for it), but what do I do with imyinterface?
Thanks very much King Rufus,
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
I think I'm figuring out the gap between your instructions and what I'm doing wrong:
My definition of ICustomDoc is like this:
public interface ICustomDoc
{
[PreserveSig]
void SetUIHandler(IDocHostUIHandler pUIHandler);
}
Is that bad?
So when I call SetUIHandler I have to cast my Form ("this") into an IDocHostUIHandler. It works fine, and I can trap events through the IDocHostUIHandler. In your instructions you said to just pass it "this". So you see what I'm saying, because I have to do the cast, my ICustomDoc has no knowledge of IMyInterface.
How should I change my definition of SetUIHandler so that I can just give it my form? Seems to me from reading the docs on SetUIHandler, that it only accepts an IDocHostUIHandler, so I don't think I can interop my way out of this bag. I tried to make it just accept "object" and then pass it my Form ("this") but that didn't work.
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
Here is my code for ICustomDoc
[ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
GuidAttribute("3050f3f0-98b5-11cf-bb82-00aa00bdce0b")]
public interface ICustomDoc
{
[PreserveSig] void SetUIHandler(IDocHostUIHandler pUIHandler);
}
I make this call in my 'NavigateComplete2' event handler. That code looks like this:
private void StartPage_NavigateComplete2(object sender, AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event e)
{
AxSHDocVw.AxWebBrowser wb = (AxSHDocVw.AxWebBrowser)sender;
IHTMLDocument2 hDoc = (IHTMLDocument2)wb.Document;
((ICustomDoc)hDoc).SetUIHandler((IDocHostUIHandler)this);
}
Let me know if that does it for you.
|
|
|
|
|
No, it still doesn't work, I get the same javascript error.
I guess fundamentally I don't understand how it even could work this way. I don't understand how the JS even could call a method in IMyInterface. How can it see it? We glued IDocHostUIHandler to the page, but that interface doesn't have my IMyInterface methods. How could the JS see IMyInterface methods. I don't get it. There has to be someplace where I pass IMyInterface to ICustomDoc or something right?
thanks tho
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
Give me a couple of days here. I'll try to throw together a simple DEMO application and if I have enough time I'll even throw it out there as an article. I know that this doesn't help you right now but there is a way for this to work. I guarantee since it's a major piece of an app I've done for one client and will be for my current one.
Sometimes I need prompting so if you don't hear from me by Wednesday please give me a shout. I would send you code now but it's way to big. (and currently doesn't belong to me.)
Let me know if this will work for you.
King Rufus
|
|
|
|
|
King Rufus,
I see it has been more than a couple of days.
I am interested in your sample application as well. I have a need to do just this thing in my next application.
Condor
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
Bog,
I got to the same point that you did. I have IDocHostUIHandler implemented as well as ICustomDoc and my IPageClickHandler interface. I am also getting the 'not an instance of an object' error from my javascript.
I pulled my test page into VS7 and it does not expose a window.external method within the window object.
Did you figure out how to bind the javascript to the external interface? King Rufus seems to have fallen off the face of the earth and is not responding.
MJ
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
I've created a manifest and used flatstyle.system to get XP look and feel, but does anyone know how to get the XP downarrow onto the button (look and feel of the combobox button) or secondly a bit map (flatstyle.system ignores bitmaps)
Thanks
Steve
|
|
|
|
|
Hi,
Why don't you wrap some of the functions of the uxTheme.dll.
Then you will be able to draw any part of the themed stuff yourself.
If you want I can supply you some API's (there in VB though, but that shouldn't be the problem is it?)
greets,
Poolbeer
Speak Out! Use the Source, Luke!
(Dr. GUI .NET #5)
|
|
|
|
|
Sounds good, if you email me at Sovman@btinternet.com I'll have a look over the weekend.
Thanks
Steve
|
|
|
|
|
Does anyone know of a class for creating a standard click and drag select box?
This seems like it should be readily available but I can't seem to find it.
if not that, does anyone know how to draw with a pen or a brush that will show the inverse color of whatever is behind it?
thanks
JR
|
|
|
|
|
There are some methods in System.Windows.Forms.ControlPaint that look as though they might be useful (DrawReversibleFrame, DrawReversibleLine, FillReversibleRectangle), but I haven't tried them.
Chris Jobson
|
|
|
|
|
Has anyone succeeded in spawning a modeless dialog that stays on top of the main form, but that does not just stay on top of every window in the shell? That is, behaviour identical to Find/Replace dialogs in VS and Office.
In C++ this is routine, but in .Net I have failed when:
1) Setting dialog's TopLevel to false, and making dialog a child of main form. This only allows rendering the dialog within the client area of the main form, of course, since it is treated as a non-form child control.
2) Using Win32 API SetParent() and SetWindowPos() directly. The dialog freezes and paints garbage. CLR does not recognise Windows' way of setting parent-child relationships, I suspect, and proper message handling requires the dialog to be in the parent's collection.
I am investigating some wild hacks, but would appreciate it if anyone has insights on this.
TIA
|
|
|
|
|
Not sure if it's the right way, but the following works for me: Set the dialog's ShowInTaskBar property false, and after creating the dialog (in some method of the main form) call MainForm.AddOwnedForm(DialogForm).
Chris Jobson
|
|
|
|
|
Chris Jobson wrote:
Not sure if it's the right way
Going from memory, the docs for AddOwnedForm say that is what it does so I would say that is The Right Way™
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
Thanks for your support too, James.
Cheers
|
|
|
|
|
Thank you Chris, that's exactly what the doctor ordered It's a pleasure to have contributors such as yourself on CP.
Incredible that I overlooked that in the docs; probably scanned the protected methods too quickly, and got lost in keyword searches!
Cheers
|
|
|
|
|
I am trying to get an assembly compiled using the managed compiler and get the resulting class library strong named.
First I tried an explicite path to the file in the assembly. No go.
Now: the assembly info states that the strong name key must be relative to the project location....so I created the location in the assembly file as ..\..\keyfilename.snk and tried to have it find it.
I first tried just locating the strong name key file within the source files and then in the bin file and in both cases the key file is reported as not found by the compiler.
So next I added the path to my source in the /lib: switch for the compiler. This still ended with file not found.
Has anyone gotten a strong named compilation using the managed compiler and how did you get it to find the snk file ???
I am at wits end.
Thanks,
MJ
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|