|
It looks like there's a DisplayIcon value in some of the registry keys for the installed apps. You could use that. Otherwise, I believe the way that Windows does it is by looking for the EXE in the InstallLocation value, which all of those keys provide, and then grabbing the icon from it.
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
Dont' know if this is the right forum but here goes !
I have an ActiveX control which I wrote (in VC6) and I am trying to use it in a C# Web App.
I have run it through AxImp.exe and now got a couple of dlls and a cs file.
Does any body know how I can now add the control to my C# page ?
Hope some body can help.
Cheers,
Users.
Can't live with 'em, can't kill em!
|
|
|
|
|
Are you using Visual Studio? If so, just add the ActiveX dll to the Visual Studio toolbox, then drop it on your form as if it were a standard .NET control, VS will do the AxImp for you.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
I am using VS 2003, when I add the ActiveX Control and build the project, it does not create anything and I can't access the control as it does not have a variable associated with it, any ideas ?
Cheers
Users.
Can't live with 'em, can't kill em!
|
|
|
|
|
Are you adding it to the VS toolbox and drop it on your form? Or did you just add it to the project references?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Hi,
I added the activeX to the Toolbox and then dragged it onto the form but when I look as it's properties, it only shows the HTML properties, I can't see a way to give a variable which I can access from functions in the cs file.
Any ideas ?
Cheers
Users.
Can't live with 'em, can't kill em!
|
|
|
|
|
If you dropped it on the form, it created a variable for you. VS usually assigns the name ax[componentName][number], so if you dropped the WebBrowser control, it would generate a variable named axWebBrowser1.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
I tried adding the WebBrowser to the form, and nothing was created.
It does as you say if you drop the control onto a windows form but not a web form, any ideas ?
Users.
Can't live with 'em, can't kill em!
|
|
|
|
|
Lol...yeah, the WebBrowser controls is a Windows forms control, not a web forms control. That is where you're going wrong.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
I think we are talking via crossed wires.
My original problem is that when I add any ActiveX control to a Web form, I dont know how to access it from the c# code as it does not create a variable.
I used the web control as an example to prove to myself that if you add a control to a windows form, a variable is created.
I do not intend to use a web control on a web form, that would be silly I agree.
Is it possible to do what I want or can I only add special web form controls to web forms ?
Hope you can help,
Cheers
Users.
Can't live with 'em, can't kill em!
|
|
|
|
|
I don't think you can add an ActiveX control to a web form. My understanding is there is something extra that needs to be done. I don't know though, you should ask that question in the ASP.NET forums.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Hi All,
I'm new to C#, my first application should read a binary file in which each element is defined as a 'struct' in a C-style include file. This file is shared with C applications so I cannot modify it to fit the C# syntax.
What's the best way doing this?
TIA,
Cabbi
|
|
|
|
|
You can redefine the struct in C# and use it from there as if it were a C struct. For instance, here is a a C# equivalent to widely used POINT C struct:
[StructLayout( LayoutKind.Sequential )]
public struct POINT {
public int X;
public int Y;
}
I can now pass this POINT to a C function that takes the POINT struct as defined in C. Note that the LayoutKind.Sequential is necessary for interoping with C code; this attribute tells the CLR to layout the struct in memory exactly as shown in code, which is necessary for C to work with.
I recommend using this site[^] for correct interop definitions and practices.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Hi, codeprojecter
I use "checkboxlist" to show some information of the registeruser
-------------------------------------------------
for example:
I have 4 items in the checkboxlist,when first run there are 4 items in the page ,and when I check 2 and then click the submit button, the page will refresh and just show me the checked items,don't show unchecked items.
-------------------------------------------------
I don't know how to do this thing,
my code is below:
private void submit_Click(object sender, System.EventArgs e)
{
for (int i=0; i<(this.chkboxGroup.Items.Count-1);i++)
{
if (this.chkboxGroup.Items[i].Selected)
{
//I don't know the code here,please help me!!
}
}
}
-------------------------------------------------------------------------
Thank you very much!
shanzy
|
|
|
|
|
Try this:
private void submit_Click(object sender, System.EventArgs e)
{
for (int i = 0; i < this.chkboxGroup.Items.Count; i++)
{
if (this.chkboxGroup.Items[i].Selected)
{
this.chkboxGroup.Items[i].Remove(this.chkboxGroup.Items[i]);
i--;
}
}
}
www.troschuetz.de
|
|
|
|
|
Thank you for your replay!
But, the "chkboxGroup.Items[i]" doesn't have the method "Remove"
shanzy
|
|
|
|
|
Ups, my fault
this.chkboxGroup.Items.Remove(this.chkboxGroup.Items[i]);
www.troschuetz.de
|
|
|
|
|
Thank you for your replay!
|
|
|
|
|
I need a robust way to insert some hidden information of 2 bytes in a text file which should not be visible in a normal text editor,I can't use Alternative data streams as when we unzip them the info gets lost,Plz help!!
|
|
|
|
|
There's no way to completely *hide* 2 bytes, but you can crypt them or scramble them so in the notpad will be shown 2 little squares...
CodeProject's Server wrote:
HTTP/1.1 500 Server Error
|
|
|
|
|
Is it possible (e.g. with reflection or by using some debugging-/profiling-API) to write a class that is aware of the context where it is instantiated?
E.g. something like this:
class SomeClass {
void A( int i, string s )
{
ContextDumper cd = new ContextDumper();
string d = cd.Dump();
...
}
} with function A being called like this:
void B()
{
SomeClass sc = new SomeClass();
sc.A( 10, "hello" );
} And cd.Dump() returning a string like this:
Hi, this is ContextDumper.
I was called inside the following function
with the following paramters:
SomeClass.A( int i=20, string s="hello" ) Is this possible? If yes, how?
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
-- modified at 8:33 Wednesday 21st September, 2005
|
|
|
|
|
Look at system.diagnostics.StackTrace and StackFrame.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Yes, thanks; but these classes do not tell me with which current parameter values the method is called.
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
|
|
|
|
|
The only way I know to get the parameters like this is to use enterpriseServices and setup a context for the object. Here is an example of the technique.
http://www.codeproject.com/dotnet/ContextBoundModel.asp[^]
I don't know of any way to get the actual parameters in regular code.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Hi all!
I need to create application to capture video and audio. To do this I use WMEncoder SDK. I use video tape recorder device connected through a COM port using the Sony RS422 protocol. Everything is good - I can capture and control my device. But I have a problem, when I try to change settings of encoder instance. Here is source:
<br />
WMEncoder Encoder;<br />
IWMEncSourceGroupCollection SrcGrpColl;<br />
IWMEncSourceGroup2 SrcGrp;<br />
IWMEncVideoSource2 SrcVid;<br />
IWMEncSource SrcAud;<br />
IWMEncDeviceControlCollection DCColl;<br />
IWMEncDeviceControl DControl;<br />
IWMEncDeviceControlPlugin DCPlugin;<br />
Encoder = new WMEncoder();<br />
SrcGrpColl = Encoder.SourceGroupCollection;<br />
SrcGrp = (IWMEncSourceGroup2) SrcGrpColl.Add("SG_1");<br />
SrcVid = (IWMEncVideoSource2) SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);<br />
SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);<br />
SrcVid.SetInput(_video, "Device", "" );
SrcAud.SetInput(_audio, "Device", "" );
IWMEncProfileCollection ProColl = Encoder.ProfileCollection;<br />
for (int i=0; i<ProColl.Count; i++)<br />
if (ProColl.Item(i).Name == _profile)<br />
{<br />
SrcGrp.set_Profile(ProColl.Item( i ));<br />
break;<br />
}<br />
DCColl = SrcGrp.DeviceControlCollection;<br />
DControl = DCColl.Add();<br />
DControl.SetInput(_device, "DeviceControl", "");<br />
Encoder.PrepareToEncode(true);<br />
DCPlugin=(IWMEncDeviceControlPlugin)DControl1.GetDeviceControlPlugin();<br />
So, when I try to change my settings (_video, _audio, _profile or _device) and do Encoder.PrepareToEncode(true) I catch an exception "It was not possible to find a valid source plug-in for the specified source". I try to set null for all of using vars after doing Encoder.PrepareToEncode(false), but have no result. Maybe somebody do something like this? Thanx for all advices.
_sergei
|
|
|
|