|
Yes. As a matter of fact, you can compile C++ and C# projects in the same solution.
Best,
Jun
|
|
|
|
|
C# can access C++ functiosn directly using p/invoke. To do the reverse, it's necessary to expose the C# code using a com object.
|
|
|
|
|
If everything is in .NET then just create a C# or C++/CLI class library and reference it from either a C# or C++/CLI project.
If you want unmanaged then what the others suggest is the way to go.
Kevin
|
|
|
|
|
Hi there,
I like to start n number of instances of a .net application from my .net windows serivce. I was wondering if there is a limit for n. Because I tried implementing it but I saw some a .net framework error while I am able to start any number instaces of the same application when I convert this service to a Windows Application. Any idea what's going on here?
Thanks,
|
|
|
|
|
I think you might run into some security problems trying to start a windows application from a service. Try setting the login credentials of your service.
|
|
|
|
|
Thanks for responding. Service is already running under an admin account's privileges, and I noticed that it starts few of the processes but stops starting anymore after 24 processes.
|
|
|
|
|
I started the jit on dev machine and found a clue that this exection is win32exception and raising in the Windows Application (Form Appliction) which is being started by this service. Here is the what I saw, but I am still not sure why this error comes after 24 processes are started without such error. Any comment?
Errors:
1.
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.windows.forms.dll
Additional information: The parameter is incorrect
And
2.
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.windows.forms.dll
Additional information: Error creating window handle.
|
|
|
|
|
Ok, I have a question:
Say I have a panel, and in that panel I have a couple of images, arranged in a row, side by side.
Using a timer, I want to 'grow' one of the images and also allow it to grow outside of the panel control without getting clipped.
Is this possible? If so, how would I go about doing this?
|
|
|
|
|
seanwright wrote: Using a timer, I want to 'grow' one of the images and also allow it to grow outside of the panel control without getting clipped.
Is this possible?
Yes, use scrolled window.
Best,
Jun
|
|
|
|
|
Could you be more specific?
|
|
|
|
|
I don't think you actually draw outside the control. What you could do is:
1) Use a scrolled window as your container control. When the image grows larger than the window, use the scroll bar to view the hidden portion.
Or
2) Support panning capability. Basically, when the image is larger than the window, press the left key and drag the image so that the control window shows the portion that you want to see.
In implementation, you draw the entire image to a graphic buffer and only render a portion of it (the same size as the constrol) to the control window.
Hope this helps.
Best,
Jun
|
|
|
|
|
A control normally won't draw outside it's specified area. Of course you can draw outside the control, but there is no way that you can keep what you have drawn up to date. The control will not get any notification that what you have drawn has been erased and needs redrawing.
Create a new control that has the size to contain what you want to draw, place it on top of your control, and use the new control to do the drawing.
---
b { font-weight: normal; }
|
|
|
|
|
Hi
I written code in vc7 win32 console application.Now i want to integrate this code in c# that's why i have to generate a .dll file throgth .Net class library but same code is not compiled in class library.
Even a single line of c++ programe in not compile
i produces errors below
aaa error LNK2020: unresolved token (0A000006) _CxxThrowException
aaa error LNK2020: unresolved token (0A000017) delete
aaa fatal error LNK1120: 2 unresolved externals
plz tell me solution
Parshant
|
|
|
|
|
Parshant Verma wrote: same code is not compiled in class library
That is right. The source code consists of two portions: your code and compiler generated code. The compiler generated code differs between an App and class library. What you should do is creating a new class library project and then moving your own code to the class library. Also, you may need to change your code to fit class library.
Best,
Jun
|
|
|
|
|
How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?How to register an assembly in asp.net web app?
|
|
|
|
|
Sorry, perhaps instead of asking over and over, you should have explained what you mean ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am looking for a commercial component that does HTML editing for WinForms/C#/.NET 2.0, with full source code.
I am using HTMLEditors MSHTML currently (http://www.itwriting.com/htmleditor/index.php), but it is missing too many features, which turn out to be too expensive to develop.
Can anybody recommend on experience with a good HTML Editor component?
Thanks
Yuval
"The true sign of intelligence is not knowledge but imagination." - Albert Einstein
|
|
|
|
|
My name is Brady, and I have never used .NET security. I now have to deploy a ClickOnce application to various external clients. The application unzips files, reads the registry, and does database and file updates. Running in the Internet Zone I see a problem here. Where do I start?
|
|
|
|
|
Hi Brady
One way of doing it is to add the URL (or website) of the clickonce application to the "trusted sites" zone in Internet Explorer. This should be read by the security mechanism of the CLR.
If this doesn't work - reply again and we'll try something else
Kind regards - Jakob
*********************************************
Three kinds of people in the world:
- Those who can count..
- Those who can't!
10 kinds of people in the world:
- Those who understand binary
- Those who don't
|
|
|
|
|
Thanks Jakob, I've come right signing the deployment with our cert. That was a relativel easy part. The hard bit was passing command line arguments to the application.
|
|
|
|
|
...yup that's another way of doing it
And - you're right - the command line parameters are tricky
Kind regards - Jakob
*********************************************
Three kinds of people in the world:
- Those who can count..
- Those who can't!
10 kinds of people in the world:
- Those who understand binary
- Those who don't
|
|
|
|
|
Hi Guys,
I'm getting the following error and it's a very strange one:
______________________________________________________________________________
File or assembly name mlj0rqcf.dll, or one of its dependencies, was not found.
=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\DOCUME~1\JAVANS~1\LOCALS~1\Temp\mlj0rqcf.dll
LOG: Appbase = C:\Shoprite\MoneyMarket\Electricity\Oostenberg\Electricity.Oostenberg.Forms\Oostenberg.Forms.Test\bin\Debug\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/DOCUME~1/JAVANS~1/LOCALS~1/Temp/mlj0rqcf.dll.
______________________________________________________________________________
What makes it strange is that the file mlj0rqcf.dll keeps changing every single time you run the code. To further enhance the strangeness, the code actually works when you pop it into the GAC.
There's no problem that I can see with code and no reason for it to break, but of course I don't know the solution to the problem.
The code are as follows:
using System;
using System.Xml;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Shoprite.MoneyMarket.Electricity.Oostenberg.Forms.Test.WebReference;
// using Shoprite.MoneyMarket.Utilities;
// using Shoprite.MoneyMarket.Electricity.Oostenberg.Entities;
namespace Shoprite.MoneyMarket.Electricity.Oostenberg.Forms.Test
{
public class frmAccountDetail : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox txtMeterNumber;
private System.Windows.Forms.Button btnLoadAccountDetails;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtConsumer;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtAddress;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtMinLimit;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtFreeSubsidy;
private System.Windows.Forms.TextBox txtMessage;
private System.Windows.Forms.TextBox txtMaxLimit;
private System.Windows.Forms.Button btnDeserialize;
private System.Windows.Forms.Button btnChangeNamespace;
private System.ComponentModel.Container components = null;
public frmAccountDetail()
{
InitializeComponent();
}
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.groupBox1 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.btnLoadAccountDetails = new System.Windows.Forms.Button();
this.txtMeterNumber = new System.Windows.Forms.TextBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.txtMessage = new System.Windows.Forms.TextBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label6 = new System.Windows.Forms.Label();
this.txtFreeSubsidy = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtMaxLimit = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.txtMinLimit = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtAddress = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtConsumer = new System.Windows.Forms.TextBox();
this.btnClose = new System.Windows.Forms.Button();
this.btnDeserialize = new System.Windows.Forms.Button();
this.btnChangeNamespace = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.btnLoadAccountDetails);
this.groupBox1.Controls.Add(this.txtMeterNumber);
this.groupBox1.Controls.Add(this.groupBox3);
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Location = new System.Drawing.Point(8, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(616, 368);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Account Details";
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(184, 23);
this.label1.TabIndex = 4;
this.label1.Text = "Meter Number";
//
// btnLoadAccountDetails
//
this.btnLoadAccountDetails.Location = new System.Drawing.Point(480, 24);
this.btnLoadAccountDetails.Name = "btnLoadAccountDetails";
this.btnLoadAccountDetails.Size = new System.Drawing.Size(128, 24);
this.btnLoadAccountDetails.TabIndex = 3;
this.btnLoadAccountDetails.Text = "Load Account Details";
this.btnLoadAccountDetails.Click += new System.EventHandler(this.btnLoadAccountDetails_Click);
//
// txtMeterNumber
//
this.txtMeterNumber.Location = new System.Drawing.Point(208, 24);
this.txtMeterNumber.Name = "txtMeterNumber";
this.txtMeterNumber.Size = new System.Drawing.Size(264, 20);
this.txtMeterNumber.TabIndex = 2;
this.txtMeterNumber.Text = "39982";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.txtMessage);
this.groupBox3.Location = new System.Drawing.Point(8, 192);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(600, 168);
this.groupBox3.TabIndex = 1;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Message";
//
// txtMessage
//
this.txtMessage.Location = new System.Drawing.Point(8, 16);
this.txtMessage.Multiline = true;
this.txtMessage.Name = "txtMessage";
this.txtMessage.Size = new System.Drawing.Size(584, 144);
this.txtMessage.TabIndex = 15;
this.txtMessage.Text = "";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.txtFreeSubsidy);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.txtMaxLimit);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.txtMinLimit);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.txtAddress);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.txtConsumer);
this.groupBox2.Location = new System.Drawing.Point(8, 48);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(600, 144);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
//
// label6
//
this.label6.Location = new System.Drawing.Point(8, 112);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(184, 23);
this.label6.TabIndex = 13;
this.label6.Text = "Free Subsidy";
//
// txtFreeSubsidy
//
this.txtFreeSubsidy.Location = new System.Drawing.Point(200, 112);
this.txtFreeSubsidy.Name = "txtFreeSubsidy";
this.txtFreeSubsidy.Size = new System.Drawing.Size(392, 20);
this.txtFreeSubsidy.TabIndex = 12;
this.txtFreeSubsidy.Text = "";
//
// label5
//
this.label5.Location = new System.Drawing.Point(8, 88);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(184, 23);
this.label5.TabIndex = 11;
this.label5.Text = "Maximum Limit";
//
// txtMaxLimit
//
this.txtMaxLimit.Location = new System.Drawing.Point(200, 88);
this.txtMaxLimit.Name = "txtMaxLimit";
this.txtMaxLimit.Size = new System.Drawing.Size(392, 20);
this.txtMaxLimit.TabIndex = 10;
this.txtMaxLimit.Text = "";
//
// label4
//
this.label4.Location = new System.Drawing.Point(8, 64);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(184, 23);
this.label4.TabIndex = 9;
this.label4.Text = "Minimum Limit";
//
// txtMinLimit
//
this.txtMinLimit.Location = new System.Drawing.Point(200, 64);
this.txtMinLimit.Name = "txtMinLimit";
this.txtMinLimit.Size = new System.Drawing.Size(392, 20);
this.txtMinLimit.TabIndex = 8;
this.txtMinLimit.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 40);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(184, 23);
this.label3.TabIndex = 7;
this.label3.Text = "Address";
//
// txtAddress
//
this.txtAddress.Location = new System.Drawing.Point(200, 40);
this.txtAddress.Name = "txtAddress";
this.txtAddress.Size = new System.Drawing.Size(392, 20);
this.txtAddress.TabIndex = 6;
this.txtAddress.Text = "";
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(184, 23);
this.label2.TabIndex = 5;
this.label2.Text = "Consumer";
//
// txtConsumer
//
this.txtConsumer.Location = new System.Drawing.Point(200, 16);
this.txtConsumer.Name = "txtConsumer";
this.txtConsumer.Size = new System.Drawing.Size(392, 20);
this.txtConsumer.TabIndex = 0;
this.txtConsumer.Text = "";
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(536, 376);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(88, 24);
this.btnClose.TabIndex = 1;
this.btnClose.Text = "Close";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnDeserialize
//
this.btnDeserialize.Location = new System.Drawing.Point(400, 376);
this.btnDeserialize.Name = "btnDeserialize";
this.btnDeserialize.Size = new System.Drawing.Size(128, 24);
this.btnDeserialize.TabIndex = 4;
this.btnDeserialize.Text = "Deserialize Message";
this.btnDeserialize.Click += new System.EventHandler(this.btnDeserialize_Click);
//
// btnChangeNamespace
//
this.btnChangeNamespace.Location = new System.Drawing.Point(264, 376);
this.btnChangeNamespace.Name = "btnChangeNamespace";
this.btnChangeNamespace.Size = new System.Drawing.Size(128, 24);
this.btnChangeNamespace.TabIndex = 5;
this.btnChangeNamespace.Text = "Change Namespace";
this.btnChangeNamespace.Click += new System.EventHandler(this.btnChangeNamespace_Click);
//
// frmAccountDetail
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(632, 406);
this.Controls.Add(this.btnChangeNamespace);
this.Controls.Add(this.btnDeserialize);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.groupBox1);
this.Name = "frmAccountDetail";
this.Text = "frmAccountDetail";
this.groupBox1.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void btnLoadAccountDetails_Click(object sender, System.EventArgs e)
{
txtMessage.Text = string.Empty;
string _meterNumber = txtMeterNumber.Text;
string _userName = "userName";
string _password = "password";
string _municipalityCode = "3498";
string _branchReference = Guid.NewGuid().ToString();
string CreationDate = DateTime.Now.ToString("yyyy-MM-dd") + "T" + DateTime.Now.ToString("HH:mm:ss");
string[] headerDetails = new string[5];
headerDetails[0] = "username=" + _userName; // Username
headerDetails[1] = "password=" + _password; // Password
headerDetails[2] = "municipalityCode=" + _municipalityCode; // Municipality Code
headerDetails[3] = "referenceNumber=" + _branchReference; // Branch Reference
headerDetails[4] = "dateTime=" + CreationDate; // CreationDate
try
{
// This is the line that breaks every single time.
Oostenberg.Forms.Test.WebReference.WebServices elSrv = new Oostenberg.Forms.Test.WebReference.WebServices();
elSrv.Url = "http://SomeWebService";
elSrv.Proxy = null;
accountDetails acntDetails = elSrv.getAccountDetails(headerDetails, _meterNumber);
txtConsumer.Text = acntDetails.consumer;
txtAddress.Text = acntDetails.address;
txtMinLimit.Text = acntDetails.minLimit.ToString();
txtMaxLimit.Text = acntDetails.maxLimit.ToString();
txtFreeSubsidy.Text = acntDetails.freeSubsidy.ToString();
XmlDocument document = new XmlDocument();
// document.Load(acntDetails.Serialize());
// document = Utilities.Xml.ChangeNamespace(document, acntDetails.ResponseNamespace);
txtMessage.Text = document.OuterXml;
}
catch (System.IO.FileNotFoundException ex)
{
txtMessage.Text = ex.Message + Environment.NewLine + ex.FusionLog;
return;
}
catch (Exception ex)
{
txtMessage.Text = ex.Message;
return;
}
}
private void btnDeserialize_Click(object sender, System.EventArgs e)
{
// if (txtMessage.Text.Trim() != string.Empty)
// {
// AccountDetails acntDetails = new AccountDetails();
//
// try
// {
// acntDetails = (AccountDetails) acntDetails.Deserialize(Streams.ConvertToStream(txtMessage.Text));
// }
// catch (Exception ex)
// {
// txtMessage.Text = ex.Message;
// return;
// }
//
// MessageBox.Show(acntDetails.Consumer);
// }
}
private void btnClose_Click(object sender, System.EventArgs e)
{
Close();
}
private void btnChangeNamespace_Click(object sender, System.EventArgs e)
{
if (txtMessage.Text.Trim().Length != 0)
{
XmlDocument document = new XmlDocument();
}
}
[STAThread]
static void Main()
{
Application.Run(new frmAccountDetail());
}
}
}
|
|
|
|
|
Hi,
I have developed a windows service which starts multiple processes on a client machine and communicates with those. I use multiple sockets and asynchronous communication. This service may require to start multiple processes and to handle communication with those. But I have seen that when the number of client processes reaches 24 the service starts reporting following error. I am assuming this is related to threadpool because total concurrent threads reach at max (25) after 24 processes including one main thread (24+1).
Event Type: Error
Event Source: .NET Runtime
Event Category: None
Event ID: 0
Date: 9/8/2006
Time: 11:05:38 AM
User: N/A
Description:
The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: .NET Runtime version 1.1.4322.573- .NET Framework Initialization Error: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\mscorwks.dll could not be loaded.
I have tried setting maximum num of worker threads and IO Completion threads using SetMaxThreads method exposed by ICorThreadPool interface, but no help.
Any helping comment much appreciated.
Thanks in advance,
|
|
|
|
|
I have a mobile app using sqlce 2.0 connecting to an sql server 2000 db. I am able to push, pull and execute sql statements no problem. I would like to be able to "sniff" messaging and data going between sqlce on the mobile device and sql 2000 server with another app(c# .net) running on the same physical drive as sql server, IIS and sscesa20.dll. Does anyone have any suggestions on how to handle this? Thanks in advance for your help!
doc...
@@@by doc...
|
|
|
|
|
hii i am kannan.currently im working with a project in VB.Net. the project is, i've to create a reader for pdf files.the reader uploading a pdf file and user can read it like a real magazine. and we know we are flipping/turns each page of a real magazine to go for the next/Previous page. I WANT THE SAME PAGE FLIP EFFECT IN MY PROJECT.i heard that directx + vb.net wil gimme a solution.
you can see an example reader at www.zinio.com, its free for download. i need the same effect in my project. I have a components that converts each page of a pdf file to image file, which then i need to animate. Can you suggest me some idea. Is it possible using directx.
|
|
|
|