Showing posts with label csharp. Show all posts
Showing posts with label csharp. Show all posts

Friday, March 16, 2012

Please help me with bandobjects

I am trying to do something VERY simple. I want to use this:

http://www.codeproject.com/csharp/d...7553#xx714692xx

to point to a web page.

I cannot use process.start because it opens the webpage in the last
opened IE window, not the window which is currently active. So, I am
trying to use the Microsoft Internet Controls COM.

I found out that I cannot simply add the COM reference and compile
it's objects. It wanted a strong name.

Being very new the below was the best I could do.

Best I can tell I made Interop.SHDocVwLib.dll a strong named library
accessible to the .net framework. But when I try and use it's objects
on most all it get is "equals" or "ReferenceEquals." I don't have
Navigate Object.

I need help. Please. All I want to do is load a url in the IE
instance whose window I am in. Thank you.

C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>sn
-k Sam
eBars.snk

Microsoft (R) .NET Framework Strong Name Utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Key pair written to SampleBars.snk

C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>tlbimp
Samp
leBars.dll /keyfile:SampleBars.snk /out:Interop.SampleBarsLib.dll
/namespace:Sam
pleBarsLib
Microsoft (R) .NET Framework Type Library to Assembly Converter
1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

TlbImp error: The input file
'C:\Temp\.net\code\Bands\dotnetBandObjects_src\Sam p
leBars\bin\Release\SampleBars.dll' is not a valid type library

C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>tlbimp
SHDo
cVw.dll /keyfile:SampleBars.snk /out:Interop.SHDocVwLib.dll
Microsoft (R) .NET Framework Type Library to Assembly Converter
1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Type library imported to
C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBar
s\bin\Release\Interop.SHDocVwLib.dll

C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>I'm not understanding what you are trying to accomplish. Would you mind
re-explaining. I went to the link you posted and couldn't see any thing
relevant to what you were explaining.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"jm" <john_20_28_2000@.yahoo.com> wrote in message
news:c67e4bdd.0405261139.50a2bb71@.posting.google.c om...
>I am trying to do something VERY simple. I want to use this:
> http://www.codeproject.com/csharp/d...7553#xx714692xx
> to point to a web page.
> I cannot use process.start because it opens the webpage in the last
> opened IE window, not the window which is currently active. So, I am
> trying to use the Microsoft Internet Controls COM.
> I found out that I cannot simply add the COM reference and compile
> it's objects. It wanted a strong name.
> Being very new the below was the best I could do.
> Best I can tell I made Interop.SHDocVwLib.dll a strong named library
> accessible to the .net framework. But when I try and use it's objects
> on most all it get is "equals" or "ReferenceEquals." I don't have
> Navigate Object.
> I need help. Please. All I want to do is load a url in the IE
> instance whose window I am in. Thank you.
> C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>sn
> -k Sam
> eBars.snk
> Microsoft (R) .NET Framework Strong Name Utility Version 1.1.4322.573
> Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
> Key pair written to SampleBars.snk
> C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>tlbimp
> Samp
> leBars.dll /keyfile:SampleBars.snk /out:Interop.SampleBarsLib.dll
> /namespace:Sam
> pleBarsLib
> Microsoft (R) .NET Framework Type Library to Assembly Converter
> 1.1.4322.573
> Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
> TlbImp error: The input file
> 'C:\Temp\.net\code\Bands\dotnetBandObjects_src\Sam p
> leBars\bin\Release\SampleBars.dll' is not a valid type library
> C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>tlbimp
> SHDo
> cVw.dll /keyfile:SampleBars.snk /out:Interop.SHDocVwLib.dll
> Microsoft (R) .NET Framework Type Library to Assembly Converter
> 1.1.4322.573
> Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
> Type library imported to
> C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBar
> s\bin\Release\Interop.SHDocVwLib.dll
> C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release
Essentially, when one uses a COM object, in a .net application, it
doesn't have a Strong Name. I don't know what it wants me to do.
MSDN is so complex that I can't put it together. It claims VS .NET
will do it for me, but I can't figure it out. I also do not see the
relationship between a .snk keyfile, my solution that I am bulding and
how to put them together to get that keyfile so that I have a strong
name for my COM objects I am using.

It really doesn't have to be about the bandobjects, that is simply
where I first encountered the error because the Microsoft Internet
Control doesn't have a strong name;

Thinking back, and I apologize, the MS Inet control COM object really
doesn't have anything to do with the article. I was simply adding the
COM object to the project below to make the bandobject be able to
navigate to web pages, etc. instead of simply displaying a message
box.

I guess I don't really know what a Strong Name is.

BTW, process.start will not work properly as it always uses the last
session of IE open and not the current session the user is in, thus my
need for the COM object (I am not asking for help here, just giving
background.)

Thanks for all your help.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message news:<Oe9U8e6QEHA.3944@.tk2msftngp13.phx.gbl>...
> I'm not understanding what you are trying to accomplish. Would you mind
> re-explaining. I went to the link you posted and couldn't see any thing
> relevant to what you were explaining.
> --
> Regards,
> Alvin Bruney
> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> Got tidbits? Get it here... http://tinyurl.com/27cok
> "jm" <john_20_28_2000@.yahoo.com> wrote in message
> news:c67e4bdd.0405261139.50a2bb71@.posting.google.c om...
> >I am trying to do something VERY simple. I want to use this:
> > http://www.codeproject.com/csharp/d...7553#xx714692xx
> > to point to a web page.
> > I cannot use process.start because it opens the webpage in the last
> > opened IE window, not the window which is currently active. So, I am
> > trying to use the Microsoft Internet Controls COM.
> > I found out that I cannot simply add the COM reference and compile
> > it's objects. It wanted a strong name.
> > Being very new the below was the best I could do.
> > Best I can tell I made Interop.SHDocVwLib.dll a strong named library
> > accessible to the .net framework. But when I try and use it's objects
> > on most all it get is "equals" or "ReferenceEquals." I don't have
> > Navigate Object.
> > I need help. Please. All I want to do is load a url in the IE
> > instance whose window I am in. Thank you.
> > C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>sn
> > -k Sam
> > eBars.snk
> > Microsoft (R) .NET Framework Strong Name Utility Version 1.1.4322.573
> > Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
> > Key pair written to SampleBars.snk
> > C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>tlbimp
> > Samp
> > leBars.dll /keyfile:SampleBars.snk /out:Interop.SampleBarsLib.dll
> > /namespace:Sam
> > pleBarsLib
> > Microsoft (R) .NET Framework Type Library to Assembly Converter
> > 1.1.4322.573
> > Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
> > TlbImp error: The input file
> > 'C:\Temp\.net\code\Bands\dotnetBandObjects_src\Sam p
> > leBars\bin\Release\SampleBars.dll' is not a valid type library
> > C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>tlbimp
> > SHDo
> > cVw.dll /keyfile:SampleBars.snk /out:Interop.SHDocVwLib.dll
> > Microsoft (R) .NET Framework Type Library to Assembly Converter
> > 1.1.4322.573
> > Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
> > Type library imported to
> > C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBar
> > s\bin\Release\Interop.SHDocVwLib.dll
> > C:\Temp\.net\code\Bands\dotnetBandObjects_src\Samp leBars\bin\Release>

Please help override property

Hi,
I've never developed in CSharp before and I'm trying to adapt an
existing user control written in CSharp. The user control inherits from
the DataGridColumn. I'd like for one of my controls properties to
override that of the DataGridColumn. Could somebody help with the
syntax? Currently my code for the property is as follows:
public virtual string HeaderStyle
{
get
{
object savedState = null;
savedState = this.ViewState["HeaderStyle"];
if (savedState != null)
{
return (string)savedState;
}
return "";
}
set
{
this.ViewState["HeaderStyle"] = value;
}
}
When I try to compile I get the message 'HeaderStyle hides inherited
member system.web.ui.webcontrols.datagridcolumn.headerstyle. To make
the current member override that implementation, add the override
keyword. Otherwise add the new keyword'. Please could someone confirm
that instead of
public virtual string HeaderStyle
I should have
public overrides string HeaderStyle
Thanks,
PaulI think it should be "override", without the "s".
An "override" is actually a "virtual" but it emphasize that it override
the virtual function declared in one of its base class. The thing is it
makes the purpose clearer, and avoid the case of accidental overriding
when you actually want a new virtual method, and acidentally create a
new virtual method while you actually want to overriding.