|
|
hi forum,
I want to integrate an old C application with a C# library (dll). I know there are various alternatives but i have choosen the "managed C++ extensions" way.
What i do is to modify the compiler options by adding the /clr option and to recompile the old C application... but the compilation returns this error:
Command line error D2016 : '/YXstdafx.h' and '/clr' command-line options are incompatible
do u know what is the problem and its solution?
I am using Visual Studio .NET 2002 (.NET Framework 1.0)
Thanks in advance!
Sergio.
|
|
|
|
|
hi,
I have solved the problem by setting the "Not Using Precompiled Headers" option, but now i have got another problem: I dont know how to use the imported C# dll.
What i do is to copy the c# dll in the "debug" folder. Then, I set the path of the "debug" folder in the "resolve #using reference" project property and finally, I import in the C++ program the C# dll by using the #using directive:
#usign "MyDLL.dll"
But now, how can I create an object contained in the DLL?
Thanks a lot!!
Sergio.
|
|
|
|
|
Your question belongs in the C++ Forum, not C#. If your trying to use the C# .DLL in Mnaged C++, it's a question for the Managed C++ Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, guys, I want to export my data into some standard file format, eg. excel and word. How can I do that?
Thanks a lot
vigorous
|
|
|
|
|
If anyone could help I posted this last week. I am having a problem and getting the following error on this piece of code:
A namespace does not directly contain members such as fields or methods.
I placed the web generated code inside the brace and it got rid of that error but i now got another one
Class FriendsReunion Default already defines a member called InitialiseComponent() with the same parmater types.
I do have other pages with .cs code holding initialisecomponent() however the other pages work fine. I did try adding numbers to it (initialisecomponent2()) but it still gave me the error above, with the respective number ofcourse.
I have added the code below and would be grateful if anyone could point me in the right direction.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
//I removed using System.Drawing from here
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace FriendsReunion
{
public class _Default : System.Web.UI.Page
{
protected FriendsReunion.SubHeader ccSubHeader;
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
private void Page_Load(object sender, System.EventArgs e)
{
Table tb = new Table();
TableRow row;
TableCell cell;
Image img;
Hyperlink lnk;
if (Context.User.Identity.IsAuthenticated)
{
//Create a new blank table row
row = new TableRow();
//Set up the News image
img = new Image();
img.ImageUrl = "Images/globe.gif";
img.ImageAlign = ImageAlign.Middle;
img.Width = new Unit(24, UnitType.Pixel);
img.Height = new Unit(24,UnitType.Pixel);
//Create a cell and add the image
cell = new TableCell();
cell.Controls.Add(img);
//Add the new cell to the row
row.Cells.Add(cell);
//Set up the News link
lnk = new HyperLink();
lnk.Text = "News";
lnk.NavigateUrl = "News.aspx";
//Create the cell and the add link
cell = new TableCell();
cell.Controls.Add(lnk);
//Add the new cell to the row
row.Cells.Add(cell);
//Add the row to the table
tb.Rows.Add(row);
}
else
{
//code for authenticated users here...
}
//Finally, add the table to the placeholder
phNav.Controls.Add(tb);
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler (this.Page_Load);
}
#endregion
}
}
|
|
|
|
|
And this question was answered twice then with the correct answer
You have mistakenly deleted a } brace and VS.NET has re-indented all your code wrong. (A lovely feature of VS.NET)
Look very carefully at your opening and closing braces ( {'s & }'s ) and you will see there is an uneven number of opens/closes.
|
|
|
|
|
Hi guys,
Here i am having one image on one scanned page that is already skewed at any angle so i want to rotate that skewed image so after rotating that image it fixed up to Left TOP part of the page.(0,0).
so i had find out the rotation angle and i am rotating it from the left,top corner of that skewed image(i.e. point).so now i want to find out the six co-ordinate(left,top),(top,right),(bottom,left) of the image after rotation from which i can get that how is now the position of my image.so now how to get that co-ordinate?
Here i am using GDI+ class. and matrix.rotateat method.
Here is some sort of code.
Matrix M = new Matrix();
Point p = new Point((int)x0posext,(int) y0posext);
M.RotateAt((float)AngleThetaDegree, p);
regards.,
montu3377
montu3377
|
|
|
|
|
If anyone could help I posted this last week. I am having a problem and getting the following error on this piece of code:
A namespace does not directly contain members such as fields or methods.
The problem occurs with the web generated code at the bottom of this thread. I have tried to move it inside the last brace as below but I am still getting the errors. Many thanks.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
//I removed using System.Drawing from here
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace FriendsReunion
{
public class _Default : System.Web.UI.Page
{
protected FriendsReunion.SubHeader ccSubHeader;
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
private void Page_Load(object sender, System.EventArgs e)
{
Table tb = new Table();
TableRow row;
TableCell cell;
Image img;
Hyperlink lnk;
if (Context.User.Identity.IsAuthenticated)
{
//Create a new blank table row
row = new TableRow();
//Set up the News image
img = new Image();
img.ImageUrl = "Images/globe.gif";
img.ImageAlign = ImageAlign.Middle;
img.Width = new Unit(24, UnitType.Pixel);
img.Height = new Unit(24,UnitType.Pixel);
//Create a cell and add the image
cell = new TableCell();
cell.Controls.Add(img);
//Add the new cell to the row
row.Cells.Add(cell);
//Set up the News link
lnk = new HyperLink();
lnk.Text = "News";
lnk.NavigateUrl = "News.aspx";
//Create the cell and the add link
cell = new TableCell();
cell.Controls.Add(lnk);
//Add the new cell to the row
row.Cells.Add(cell);
//Add the row to the table
tb.Rows.Add(row);
}
else
{
//code for authenticated users here...
}
//Finally, add the table to the placeholder
phNav.Controls.Add(tb);
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
|
|
|
|
|
You declare the OnInit and InitializeComponent methods directly inside of a namespace, which is not allowed, as the Compiler message states.
So move the "Web Form Designer generated code" region up past the next brace, so both methods are defined inside the _Default class.
www.troschuetz.de
|
|
|
|
|
Hello from a confused programmer...
I'm having a problem with a custom control of mine.
I have created a UserControl which inherits from System.Windows.Forms.Label.
I have added an custom object property to the control which contains an integer, and I have added a normal integer property to the control.
In the property editor the normal integers current value gets saved when I close the solution, but the current value on the integer on my custom object does not.
Why is that? Do I need to do something special on my custom object - i.e. inherit an interface, use some special attribute.
I can't seem to find anything on the subject.
yours truly
Spif2001
|
|
|
|
|
I've added toolbar to application, added buttons, imageindex, icons to image index (48×48 8bpp) and set ImageIndex property of ToolBarButtons. In the begining it all worked fine. But when I enable visual styles in application icons don't show up on buttons.
When I add another toolbar with buttons and everything and dock it somewhere both toolbars show normal, how they should.
I can't find anywhere answer to this problem so if anyone knows how to fix this please help.
|
|
|
|
|
Does anyone know of a way that I could take an algebraic expression and evaluate it? for example, lets say i had the equation I=Prt (simple interest), and had values for I, r, and t, and wanted to solve for P. Is there anyway this could be done or do i need to write 4 seperate equations and pick the approprite one (if solving for P use I/rt, or if solving for t use I/Pr)
|
|
|
|
|
If the expressions are simple and known beforehand, a simple OOP solution would be: create an interface and implement it with the 4 separate equations on 4 separate classes. Then, you pass an interface reference to the method that needs to call them.
If the expressions will only be known at runtime, a solution could be: http://www.codeproject.com/csharp/runtime_eval.asp[^].
If the expressions are more complex, maybe you'll need to build your own parser.
Yes, even I am blogging now!
|
|
|
|
|
Hi all,have you got any sample code in C# to process with ACCESS database such as:Read,WRite,Delete,etc...using 3 tiers model.Give me please,i know nothing about it,but i need it.Thanks for your helping!
God save all of you!
|
|
|
|
|
tiem wrote:
using 3 tiers model
Well, so long as you have no presentation code in the example ( which you wouldn't ), it'll be suitable for 3 tiered development.
The MSDN is full of examples, I believe you pass the path to the Access DB to a SQL Connection constructor, then treat it as any other DB, passing in SQL, etc.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
You say in your email that you don't have time to look in MSDN. I found this link in less than a minute, using google.
http://visualbasic.about.com/od/usingvbnet/l/aa050303c.htm[^]
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
You say in your email that you don't have time to look in MSDN.
Sounds like a homework assignment coming due huh?
- Nick Parker My Blog | My Articles
|
|
|
|
|
Either way, it's a worry when someone 'doesn't have the time' to use the best tools for the job.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi
i had some add-in project in C#.
When i begin one add-in wizard create for me also setup project.
When i compile this project one create setup.exe file and some other files in Debug folder,further more when i launch this setup.exe file from this folder all work fine, but when i remove this file to an other directory and launching
one rised error "not found ...ini file".My question is "How i should compile my setup project in oredr to setup.exe launching be available without some other auxiliarity files"
Thank.
|
|
|
|
|
I've tried for about all possible functions, searched thru articels, messageboards and the rest of the internet but nothing works.
When my Program starts up, i create a second window (titled Reminder) but hide it immediately. Various timers cause this Reminderwindow to pop up. But if my main window is minimized to taskbar the reminderwindow will also be minimized and visible in the taskbar. So... how do i avoid this so that the remidnerwindow pops up again?
|
|
|
|
|
Setting Form.WindowState to FormWindowState.Maximized doesn't work?
( too lazy to try right now )
best regards,
David 'DNH' Nohej
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
|
oh, I see. Strange behaviour! anyway, I was playing with it... I don't whow what exactly are you doing, bt I made this work:
<br />
private void timer1_Tick(object sender, System.EventArgs e)<br />
{<br />
if(m_popUpForm.IsDisposed)<br />
{ <br />
m_popUpForm = new Form();<br />
} <br />
m_popUpForm.WindowState=FormWindowState.Maximized;<br />
m_popUpForm.Show();<br />
}<br />
where m_popUpForm is protected member and it's basic Form class.
It pops up maximized nicely every tick event... even when "parent" form is minimalized!
Is it behavour tou want? I can send you whole app if you want.
I have to admit it's not the best way how to debug bt it works and time is valuable, so forgive me so unprofessional approach
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
ah. Now i found the Problem.
I had the set the WindowState, Show the Form and Activate it.
[Form.WindowState=FormWindowState.Normal;
Form.Show();
Form.Activate();]
The Problem occurs when you generate a hidden
Winform on startup
Subform blah = new Subform();
blah.Hide();
and then try to show it when the main Form is minimized
private void button1_Click(object sender, System.EventArgs e) {
this.WindowState = FormWindowState.Minimized;
blah.WindowState = FormWindowState.Normal;
blah.Show();
blah.Activate();
}
It won't show up without bla.Activate();
|
|
|
|