|
No.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Thanks for your clarification, Vikram!
regards,
George
|
|
|
|
|
George_George wrote: will Dispose/Close be called automatically during exception (e.g. similar to during stack unwinding in C++)? Or we have to wait for GC to call Finalize?
Dispose() won't be called automatically on exceptions. You have to do execution in try block, catch all possible exceptions, cleanup in finally. using statement is a syntactic shortcut for this pattern.
|
|
|
|
|
Thanks N a v a n e e t h,
Any comments to here? I write more details about my specific situations there. Even though I am not using "using" and since the traffic is low, I do not meet with any issues.
I would like to learn from you and let you anticipate what issues I will meet with if I do not use "using" in my situation?
http://www.codeproject.com/script/Forums/View.aspx?fid=1649&msg=2561393[^]
regards,
George
|
|
|
|
|
How i can handle Mozilla Browser event in windows application using Dotnet
|
|
|
|
|
I wanted to access methods written in C++ from C# .net .For this i created DLL(dll is win32 library) which contain method and when i add through the add refrence option it gives me following error
"A reference to D:\program\DynamicLibrary\debug\Dynamiclibrary.dll couldnt be added .please make sure
that file is accessible and that it is a valid assembly or COM component. "
Where i builded the DLL successfully even i tried using other way also where i written following code to access method from DLL
[DllImport(@"D:\Program\DynamicLibrary\Debug\DynamicLibrary.dll", EntryPoint="goal")]
public static extern int goal();
public static void Main()
{
program.goal( );
}
}
In that code also i got error saying that couldn't load DynamicLibrary.dll .
can anyone help me out in this .Please tell me what is the procedure to call C++ function from C# .net it will be very usefull .
Any help will be appreciated .Thanks in advance .
|
|
|
|
|
Have you registerred your dll?
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
No i haven't registered it .i only built the DLL successfully .please tell me how to register it ?
|
|
|
|
|
hi
i wrote this code to define new eventArgs named ControlTextColorChangedEventArgs as follow :
class ControlTextColorChangedEventArgs : System.EventArgs
{
private Color _color;
public Color Color
{
get { return _color; }
}
public ControlTextColorChangedEventArgs(Color color)
{
this._color = color;
}
}
and use in my user control as follow :
public partial class UserControl1 : UserControl
{
public delegate void UserEventHandler(object sender, ControlTextColorChangedEventArgs e);
public event UserEventHandler ControlTextColorChanged;
private string _text;
private Color _color;
public string ControlText
{
get { return _text; }
set
{
_text = value;
this.OnPaint(new PaintEventArgs(this.CreateGraphics(), this.ClientRectangle));
}
}
public Color ControlTextColor
{
get { return _color; }
set
{
_color = value;
this.OnPaint(new PaintEventArgs(this.CreateGraphics(), this.ClientRectangle));
this.OnControlTextColorChanged(new ControlTextColorChangedEventArgs(this.ControlTextColor));
}
}
public UserControl1()
{
InitializeComponent();
this._color = Color.Black;
this.ControlText = string.Empty;
}
protected override void OnPaint(PaintEventArgs e)
{
if (this.ControlText != string.Empty)
{
e.Graphics.DrawString(this.ControlText, new Font("tahoma", 10), new SolidBrush(this.ControlTextColor), new PointF(this.Width / 2, this.Height / 2));
}
}
public virtual void OnControlTextColorChanged(EventHandling.ControlTextColorChangedEventArgs e)
{
ControlTextColorChangedEventArgs handler = ControlTextColorChanged;
if (handler != null)
{
handler(this, e);
}
}
}
but the following error has shown me :
Inconsistent accessibility: parameter type 'EventHandling.ControlTextColorChangedEventArgs' is less accessible than method 'EventHandling.UserControl1.OnControlTextColorChanged(EventHandling.ControlTextColorChangedEventArgs)'
where does my problem and how to solve it ?
thanks
|
|
|
|
|
this is because OnControlTextColorChanged is declared public, but the method's argument type isn't.
declaring ControlTextColorChangedEventArgs public will fix.
|
|
|
|
|
thanks buchstaben
my problem was solved.
thanks a lot.
|
|
|
|
|
Hi I am using browser component in my application which is in C#.net 1.1 Windows application
private AxSHDocVw.AxWebBrowser axWebBrowser1;
and i have set all the properties for it
it gives me error as
an error has occured in the script on this page.
Line: 1
Char: 1
Error: Object Expected
Code: 0
URL: http://in.msn.com/default.aspx?froo=www
do you want to continue running scripts on this page?
yes no
I have navigated by
string str1 = ComboAddress.Text;
object tmp = (object)str1;
object null_obj_str = "";
System.Object null_obj = 0;
axWebBrowser1.Navigate2(ref tmp , ref null_obj, ref null_obj, ref null_obj_str, ref null_obj_str);
how do i go about with this problem and i want allow popups also?
can any 1 help?
|
|
|
|
|
in .net 2 webbrowser control, there is a property named "ScriptErrorsSurppressed". maybe there is similar in AxWebBrowser?
|
|
|
|
|
When i tried to update the contents of a table in my database using oledbcommand i am getting the "Could not save; currently locked by another user" exception.
I tried closing the connection other places where ever it is used.
But still the same problem is coming? what should i do? Please help me?
|
|
|
|
|
I assume this is an access db ? How many connections does your code have ? Why does it have more than one ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for the reply,
Exactly i am using access. Actually my code calls internally some services which are also using the same connection and upto my knowledge they are getting closed as soon as the service use is finished.
Or otherwise is there any way to view all the connections which are open?
|
|
|
|
|
If u r the only one using that db than surely there's a place left in your code where db connection left open.
|
|
|
|
|
I am new to .NET
I have completed my project and want to deploy the files to a clilent machine.
How do I go about it? I have created the setup files. But installing these on clients system dosent run them properly..
It closes after some time. (Fatal error comes).
What files do I need to copy to the setup?
I have copied the exe files from the debug folder iniside my project folder..
Do I have to build the project on Release mode and then take the exe's?
Does copying the exe's will solve the purpose or do I have to copy some other files??
Please help me..
|
|
|
|
|
ptr2void wrote: Do I have to build the project on Release mode and then take the exe's?
Yes, but you also need the .NET framework.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
you should make your setup through setup wizard...
and it's better to point your exe from release folder...
by making setup through setup wizard it automatically includes the dependencies which u may be missing while making setup by yourself
|
|
|
|
|
Nouman Bhatti wrote: you should make your setup through setup wizard...
and it's better to point your exe from release folder...
by making setup through setup wizard it automatically includes the dependencies which u may be missing while making setup by yourself
Could you please tell me how can I make my setup through the wizard?
|
|
|
|
|
when u make a new project there's a option of setup wizard....
|
|
|
|
|
.NET is very easy to deploy. If you only use the built in functionality, ie. no external dll's, you can simply move the exe and run it. Assuming that you have the correct .NET Framework installed. There are minor differences between Debug and Release mode and I don't think this is the reason for the crash.
If the program closes after some time it seems more likely that you have a bug that you need to fix in your program.
|
|
|
|
|
Hi all,
Any one suggest me a regular expression that replace a "\n" char with HTML break tag( <br /> ). I did this using the following expression
string BodyText=Regex.Replace(Bodymsg, @"\n", "( <br /> )", RegexOptions.Multiline);
Bodymsg is dynamic text from database.
When i try to use the above expression it replaces all the "\n" like "\t\n", "\r\n", but for me the new line "\n" alone should be replaced not the new line with tab or carriage return for eg: "\t\n" or "\r\n" should not be replaced from "\t\n" to \t < br />
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
OK, so you need to look behind and make sure it's not a \t or \n before it ?
www.expresso.com is great for working out regex.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|