|
Hi!
I have created one class library in C# with some overloaded functions like,
public void AddColumn(string val){};
public void AddColumn(string val, bool PK){};
I am taking referance of this C# classlibrary in to Visual basic project. Everything is workign fine except, I am able to call only the first overloaded method. If I will try to call the second overloaded method, I am getting run time error like "Invalid procedure call or argument".
Is there any way from which I can call the second overloaded method?
|
|
|
|
|
Hi!
I have created one class library in C# with some overloaded functions like,
public void AddColumn(string val){};
public void AddColumn(string val, bool PK){};
I am taking referance of this C# classlibrary in to Visual basic project. Everything is workign fine except, I am able to call only the first overloaded method. If I will try to call the second overloaded method, I am getting run time error like "Invalid procedure call or argument".
Is there any way from which I can call the second overloaded method?
|
|
|
|
|
I have this long process I'm doing in my application. On my GUI I have a pause button. Now, by problem is, how to make my app just sit there, and not do anything. I've tried these...
while (true)
{
}
while (true)
{
Application.DoEvents();
}
But, they eat up the processor (100%).... Any idea how I can make my app pause where it is??? short of Thread.Sleep(), because this is a single threaded app.
/\ |_ E X E GG
|
|
|
|
|
Why not make a new thread and join it on the main UI thread? You can tell that thread to pause and resume by using Suspend and Resume .
|
|
|
|
|
Oh, the Suspend and Resume look like they work good. But, but calling join on my GUI thread to wait for my worker thread, makes my gui crash out.....
/\ |_ E X E GG
|
|
|
|
|
Make a member variable in this class which can be marked true or false from the Pause button click event.
Your long process would be a series of function calls or calculations. At each logical step check whether bPauseFlag is true, if yes enter a infine loop which does
while(bPauseFlag==true)
{
Thread.Sleep(100);
}
Thread.Sleep is important because unless you do that, the UI paint event processing would hang. You can use Thread.Sleep in single thresded apps. Let me know your feedback.
|
|
|
|
|
I am considering the converting of an existing application to C# but have been a little reserved due to the issue of being able de-compile the code so easily. There are several funtions/algorithms in my existing app that I would like to prevent the competition from being able to reverse engineer.
I have read some on using obfuscators, but I am uncertain if this is the best or only way to secure my code. Even thou the code is made harder to read/research, it appears that the logic, if ... loop ... etc can still be seen. Even if the code is obfuscated, can it be decompiled? Is obfuscation secure enough?
I had also seen where it was recommended to put the code that needs to be the most secure into an unmanaged DLL and then call it from C#. Is this the better approach?
I thought I had heard that Microsoft was going to address the issue of reverse engineering of the code with the release of Visual Studio 2005. If this is true, can someone provide a link for more information.
Also, I know that it is not best practice to place passwords within the compiled code (in any language, especially one that can be de-compile so easily) but if you have a database that is encrypted and shared with several users, what would be recommendations of using a password protected database but not store the password in the compiled code?
I am just trying to get as much information as possible as to what are the best practices. I know that it has been said that no code if 100% safe from being reversed (with enough time and money) but it seems too easy with the available de-compilers.
|
|
|
|
|
Right now, the technology to obfuscate code uses techniques such as name mangling to make it less human readable but still valid IL and therefore same execution. You can still reverse engineer such obfuscation...it just takes another program and a methodology/pattern to turn it back into something more human readible.
For things like passwords and other authentication information you are right. You shouldn't hard code them into the application directly. What you should do is make them a configuration setting or prompt the user at runtime. Hard coding passwords in any runtime environment is like putting your creditials on a sticky note on your monitor. Put that stuff somewhere else.
Beyond all of this, why are you so concerned about reverse engineering? My personal feelings on obfuscation: Don't bother. The .Net Framework is not meant to be a "code obscured" execution platform so don't bother trying. Even "unmanaged" runtimes like C/C++ can be disassembled back into human readable code chunks.
Software is to dynamic and has an incredibly short lifespan. Any commerical application you write today will get dramatically changed to the point of a near re-write in less than a year. Why hold onto old useless code?
|
|
|
|
|
One concern is the scoring routines we use for our product. This is probably the portion of the code that is most concerning.
If I create unmanaged runtimes (Win32 - Delphi) then use a encryption/compression utility, shouldn't it be more secure?
|
|
|
|
|
Then why on earth do them in C# if you already have it in some other form? sounds to me you have too much time on your hands :p
top secret xacc-ide 0.0.1
|
|
|
|
|
Hi friends
Im having a problem regarding the debugging of my Web Based .NET Application.
I want to debug my application on my system (the application is on the server and the VS.NET is also on the server).
Currently i can build it but for running i have to just run in the browser.
F5 or debugging is not working in this case.
On server side all the remote debugging rights have been given and i have been put in Debugger user group.
Please help me in this as im having a great problem in my Web Application.
Any help or pointer is most appreciated
Naveen
|
|
|
|
|
while writing customized control that inherits .Net control (e.g. Treeview control) what is the advantage/disadvantage of having default
constructor and parameterized constructor both?
can we avoid/delete default constructor if everything can be done with parameterized constructor?
Please guide.
|
|
|
|
|
Your basic problem is that the IDE isn't going to generate any code for you that uses a constructor, and if you go changing the code it generates for you to use that constructor, it's likely to delete your code for you. I'd suggest sticking with a default constructor and an initialise method you can call.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
public class ExRichTextBox : System.Windows.Forms.RichTextBox
{
// variable declarations
private ExRichTextBox() : base()
{
// some logic
}
public ExRichTextBox(string _lang, string _projName) : this()
{
// some logic
}
// public and private methods
}
is it advisable?
please guide
|
|
|
|
|
Yes, but as Christian said, it wont work in the designer anymore... (does any real coder use the designer anyways? )
top secret xacc-ide 0.0.1
|
|
|
|
|
leppie wrote:
does any real coder use the designer anyways?
LOL - do you lay out GUI's by trial and error ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
LOL - do you lay out GUI's by trial and error ?
No, I normally think about it 1st...
top secret xacc-ide 0.0.1
|
|
|
|
|
You visualise the whole thing in your head ? I'd rather think about it by moving things in the designer until they look good.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
yeah, I think about the layout while i code some other stuff, it not that hard, just dont start your app with a GUI and build one as you need to expose functionality. Then you dont need to worry about the designer adding silly variables (like autoscalebasesize, that messes up borderless forms) etc, or changing your images in the imagelist from png to memory bmps (that lose transparency)... and if you wanna really love the UI designer u have to make all your controls also nice and friendly, tedious and redundant.
Gimme intellisense and im happy
top secret xacc-ide 0.0.1
|
|
|
|
|
Hi Guys,
I'm trying to write a server control that exposes as one of it's properties an object.
I've created a TypeConvertor that converts from a string representation to an instance of my object, and have also implemented the converstion from the object to an InstanceDescriptor.
When I create the InstanceDescriptor, I am passing in the parameters for the default no argument constructor of my object, and the third parameter to specify that the object can not be fully created from the InstanceDescriptor - which should force the serializer to output code for the properties of my object as well....
return new InstanceDescriptor( XmlDocType.GetConstructor( System.Type.EmptyTypes ), null, false);
However the code that is generated for the asp.net does not have any code for setting the propertiess of my object.
I know I could just create a constructor that takes in the values, and return the relevant InstanceDescriptor, but I would like to get it working the other way first. Does anyone know if this is possible, and where I could be gonig wrong?
Also I've looked at implementing my own CodeDomSerializer for my object, but cannot get the asp.net to actually call my implementation - again if any knows where I am going wrong with this, would be helpful to hear from you.
Thanks.
Chris.
|
|
|
|
|
How can I build a string with the string builder with new lines in it...?
foreach(string line in mail.LOGIN(user, pass))
{
sb.Append(line);
}
Right now I go like this... I would like to add a "\n " after line , but it dosn't complie. How can I add each line to a new line in the string?
/\ |_ E X E GG
|
|
|
|
|
Use Environment.NewLine
foreach(string line in mail.LOGIN(user, pass))
{
sb.Append(line);
sb.Append(Environment.NewLine);
}
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
Ahh, that's it. Thanks.
/\ |_ E X E GG
|
|
|
|
|
Environment,NewLine is how you should add newlines, not with \n or \r\n. I don't see why that wouldn't work in a stringbuilder.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
thanks..............................................................
/\ |_ E X E GG
|
|
|
|