|
Hi,
I have an assembly that I have run tlbexp.exe on, to create a Type
Library to be used by a COM Client. The type library contains two
interfaces and two coclasses.
The COM Client was already using a COM version (compiled from an IDL,
and stored with a DLL) of these interfaces and coclasses, with
specific GUIDs and ProgIDs. I have re-written the interfaces and
classes in C# so that the exported type library matches that of the
existing COM (except one part which i will come to later).
What I intend to do is to simply unregister the existing COM version
off the "COM machine", and register the Type Library created by
tlbexp.exe. I require the COM Client continue to run without having
to recompile, however, if needed, further building (using the newly
exported type library) would also be required.
Currently, i have got as far as allowing the COM client to run OK with
the new type library, however, when i try and build the COM Client, it
complains that it cannot load a DLL. I was of the opinion that this
may be something to do with the fact that the older COM version of the
interfaces and classes where contained in a DLL, and now that DLL is
no longer registered.
Also, a smaller point which concerned me. When the tlbexp.exe is run
on an assembly, all the enumerations values are prefixed with the
enumeration name and an underscore. Reading the MSDN documentation it
states that this is deliberate behaviour to ensure names are unique
(see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcontlbexptypeconversion.asp).
So, i have two questions (finally!)
1. Are there any suggestions to why I am getting a "Unable to Load
DLL" error when trying to build the COM Client, and are there any
ideas of how to overcome this?
2. Is there any way to alter the behaviour of the tlbexp.exe to stop
it prefixing enumeration values?
Thanks,
Jamie.
|
|
|
|
|
Hi all,
i'm trying to write some Socket code in C#. I'm still learning all the intricacies of C#, and have come across something I'm not sure how to do. It may have been asked here before but I've failed to find any info on, so any help would be appreciated.
Socket.Send accepts a byte []. If I want to send an "int" which is the length of the bytes that I will be sending next, is there a conversion function from "int" to "byte []"?
The same goes for Socket.Receive. Is there a function that converts a "byte []" into an "int"?
Thanx
If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
|
|
|
|
|
you could try this -
byte[] myByteArray = (byte[])intValue;
Gavirj
|
|
|
|
|
Gavin,
that didn't work. I get the following error :
(136): Cannot convert type 'int' to 'byte[]'
Bute Nnamdi helped me, I needed to use the BitConverter class and it has a ToInt32 and GetBytes functions.
If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
|
|
|
|
|
The BitConverter class does what your looking for.
|
|
|
|
|
Int32 is a 32 bit integer.
32 / 8 = 4
therefore Int32 is 4 bytes long.
and the code you have there is correct for converting the byte array to an int, so im presuming you mean Int32 -> byte[]. for that, use:
int myInt = 5;<br />
byte[] bytes = BitConverter.GetBytes(myInt);
|
|
|
|
|
Hi Nnamdi,
just as I clicked send, I noticed the GetBytes function in BitConverter which I didn't see before, so I deleted my old message and was just about to write a thank you for your help.
<edit>
I think it's too early in the day. I can't believe I thought that a byte was 4-bits and not 8. I seriously need some sleep I think.
Thanx again
Jubjub
If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
|
|
|
|
|
Oh, I got you. That actually does not come with .Net. Just the ProgressBar class. You would actually have to make it on your own, or look for some free source code with that kind of control. If anything you might be able to just use a ProgressBar, and put a PictureBox on top of it that increases its Horizontal size everytime the ProgressBar increments. The PictureBox would have to be white of course, and you would have to experiment to see how much to increase the size for each increment, based on the size of the ProgressBar.
|
|
|
|
|
Thanks, I'll see what I can get on the net...
Greets
|
|
|
|
|
I have a C# console application that makes a reference to a managed c++ dll. This managed c++ dll is in the same solution. I have added the reference by clicking add reference, clicking on the project tab and selecting the managed c++ dll project. When I build this application it is ok, but when the console is loading, I get a System.IO.FileNotFoundException, cannot find the managed c++ dll or one of its dependencies. I am clueless, since the managed c++ dll has also been copied to the same directory as the console application .exe.
|
|
|
|
|
Did you by any chance change the output name of the managed c++ dll? Because I changed the output name of a dll in my solution with C#2005 and got the same exception when the application loaded.
|
|
|
|
|
Hello,
I have a C# project that generate an executable a.exe
I would like to create a stripped down version of this program using a compilation flag. The executable should have a different name, say b.exe
What is the best setup to get to this result?
Thanks!
|
|
|
|
|
hello
i write a smtp client winform (using socket connect to smtp server at port 25),and deploy it to iis by NTD (no-touch deployment),i can launch the form from the client machine,when i want to connect to the smtp server,the security exception is thrown,i know that i have not assigned the socket permission in the client side to the downloaded assembly,but i don't know how to do that,who can give me a step-by-step instruction.
any help will be appreciated.
|
|
|
|
|
Does anyone know a .net lib to manage AVI files?
|
|
|
|
|
Hi,
there are simple windows API functions for reading and writing AVI files, so you can use .Net wrapper (here is article about this: http://www.codeproject.com/cs/media/aviFileWrapper.asp[^], but if you want more advanced features, you'll probably have to use DirectShow (this may be problem, because managed directx, doesn't include directshow) ..
|
|
|
|
|
Thanks for the tip. I'll look into it.
|
|
|
|
|
Hello all,
I have been searching the site for a datagrid control that allows for grouping in a hierarchy style like Outlook. One that allows you to compress and expand groups. I have seen a couple of example that were close but they were all in VB and that is on my list for one of the languages to learn. So could you let me know if you have seen a post for one in C# or where i could find one.
Thanks
|
|
|
|
|
I have one that is 90% way through development, which is for an application I am developing. There is considerable work behind this control, so I will NOT be offering this control for free.
If you are interested see http://developski.blogspot.com/2004/09/building-better-list-gui-class.html.
|
|
|
|
|
Hi people,
Can someone point me to some libraries or techniques for conducting aspect oriented programming (say via a weaver tool) that allows one IL (Intermediate Language) tool (the aforementioned weaver) to draw out certain aspects (i.e. boolean conditions of variables) of say a program written in a specification language such as AsmL (translated into IL).
Lets say I've created a weaver written in a arbitrary .NET higher language (that has been translated into IL), where I want one IL to inspect the states of variables as it executes (possibly also to measure temporal properties of the AsmL IL, do some counting, etc) of the first AsmL derived IL at runtime.
Am I too high, do I need to go below the CLR, and if so how? Any ideas on good .NET routines for monitoring the runtime stack, or locksteping execution of the two independantly running ILs into native code and enforcing assertions (aka runtime conformance testing).
If I am too vague, coming across as a total newbie or not making any sense feel free to tell me.
Many Thanks,
Joel
---
Joel Rivendell
Bachelor of Software Engineering (Hons)
Monash University
Clayton Campus
Australia
Also dont be a lemons and check out Throwing Lemons Website for all your entertainment needs!
|
|
|
|
|
|
I am experiencing an interesting behaviour with the DataGrid in .NET Framework 1.1 SP1. The problem cannot be reproduced in non-SP1 environment. If you select a read-only grid cell and refresh the grid with new data, the cell that was selected overlays the new data in the grid, as if the EndEdit has not been called.
Below is the sample code. I’d appreciate any comments, is it a bug in SP1, or it is me doing something stupid?
// Populate the grid, click on the cell, then click the Refresh button. The old cell value is still visible.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace GridTest
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnRefresh;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.MappingName = "TempTable";
tableStyle.RowHeaderWidth = 20;
dataGrid1.TableStyles.Add(tableStyle);
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.btnRefresh = new System.Windows.Forms.Button();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// btnRefresh
//
this.btnRefresh.Location = new System.Drawing.Point(32, 16);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(88, 32);
this.btnRefresh.TabIndex = 0;
this.btnRefresh.Text = "Refresh";
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// dataGrid1
//
this.dataGrid1.CaptionVisible = false;
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(8, 16);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ReadOnly = true;
this.dataGrid1.Size = new System.Drawing.Size(520, 208);
this.dataGrid1.TabIndex = 1;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btnRefresh);
this.groupBox1.Location = new System.Drawing.Point(8, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(536, 64);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.dataGrid1);
this.groupBox2.Location = new System.Drawing.Point(8, 72);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(528, 232);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(544, 309);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void btnRefresh_Click(object sender, System.EventArgs e)
{
DataTable table = new DataTable("TempTable");
DataColumn myDataColumn = new DataColumn();
myDataColumn.DataType = System.Type.GetType("System.Int32");
myDataColumn.ColumnName = "ID";
myDataColumn.ReadOnly = true;
table.Columns.Add(myDataColumn);
myDataColumn = new DataColumn();
myDataColumn.DataType = System.Type.GetType("System.String");
myDataColumn.ColumnName = "Description";
myDataColumn.ReadOnly = true;
table.Columns.Add(myDataColumn);
int start = new Random().Next(100);
for (int i = start; i <= start + 10; i++)
{
DataRow row = table.NewRow();
row["ID"] = i;
row["Description"] = "Desc - " + i.ToString();
table.Rows.Add(row);
}
dataGrid1.DataSource = table;
}
}
}
|
|
|
|
|
my .net application stopped working fine after installation of SP1. Each button control in the application stopped working. i.e
I have a login screen, type user name and password, click on "Login" button -> nothing happens!!! No action, no postback...nothing. Clicking on Submit "button" on form page does just nothing, like this button is not binded or there is no event associated.
Every thing was working fine before installing SP1. after instalation only BUTTON control stopped working in enire application With Browser IE 6.0, while its working just fine with Netscape.
I have also replaced the aspnet_client folder of the remote
server with my local server which is running fine the entire application. But it does not solves the problem.
Any help on the above listed contex will be highly appricated.
thanks in advance.
--Yogender Ahuja
Dont know whats going on, but I'm really short on ideas
Any HELP..!!!
Yogen Ahuja
|
|
|
|
|
hello
i write a simple winform app to test the NTD(no-touch deployment) feature of dot net,after deploy it to the iis server,it works well,i can invoke it from either commandline or ie browser. but i found that after it is started up ,i IGNORE it,that means i don't operate it,after a wile,it is automatically closed.why,are there some .net configuration to incharge the timeout?
how can i make the ntd winform app keep PERMANENTLY running in the client side,even no body touch it.
thank you!!
|
|
|
|
|
i have tried several ways,and found it depand on how i deploy the project:
1 if i deploy the "debug" directory of the visual studio as "web share"(right click the directory,and select "web share" tab,select appropriate radio button..........),then from client side,i can lauch it,but it will shutdown spontaneously after a while if i don't touch it.then a windows debug windows pop up ,it saild that the "FileNotFound" occur to the "ieexec.exe"and ask me to select a debug tools.
otherwise,if i close the form MANUALLY , the same debug windows pop up too.
2 if i copy the "*.exe" file from the debug directory to the subdirectory of wwwroot,it works well,NO spontaneous shutting down and NO pop up debug form.
according to the two scenario,it seem like that if i deploy it WITHIN the iis box,it woiks well.
why ?i wonder what is the difference between the iis in-box delpoyment and web share directory deployment?
|
|
|
|
|
Hi All,
I am creating a word document from VB.NET environment.
In the report footer I created some information to display, and sending the parameters from the application. When the report is completed then the fields are not updated but when I click preview for the report then I could see the updated fields and at the same time if I take the print then the fields are updated.
Do any one got the same problem...any clues will be appreciated.
Thanks in advance.
Sreepathi
|
|
|
|
|