|
e_LA wrote: but where to create the object of settings class?
If you are using the singleton pattern then the class itself creates the object.
For example:
public Settings
{
private static Settings onlyInstance;
private Settings(){};
public static Instance
{
get
{
return this.onlyInstance;
}
}
}
|
|
|
|
|
Colin,
When I was waiting for the answer I managed to do that in such a way you explained and it works! I can make a few changes after reading you responses.
Many thanks for the explanation!
...very strange this singleton pattern
I had problems with saving settings but I created public method in singleton and called settings save method.
Redards
Ela
|
|
|
|
|
Hi all.
How I can get control's id "(Name)" property of a control of other process (vb6 app) via windows api?
Please, help me.
Thx in advance.
Best Regards,
Marco Alves.
|
|
|
|
|
hi all,
i have a simple windows application with 2 forms.
i show the 2nd form with showdialog option.
but when i click on the main form, the second form flicks both in task bar and its head part.
the thing i want to learn is: is it possible to completely restrict clicking on the form behind when i open a new form with showdialog option ?
(do not want the main form to react with mouse clicks. no flicks on the front form)
thanks in advance, bye.
MFA
|
|
|
|
|
Hello,
No, with ShowDialog you have too .Exit the Form.
I don't think that there is a solution for the flickering.
All the best,
Martin
-- modified at 9:16 Monday 4th September, 2006
What you can try is, not showing the 2nd Form (ShowDialog Form) in Taskbar.
All the best,
Martin
|
|
|
|
|
I'm relatively new to C#, and just started with interop. I've a C DLL with this function:
int SomeFunction (
const int id,
const char * name,
int num = 0,
CLASS1 *const ptr1 = NULL,
CLASS2 *const ptr2 = NULL
)
I wrote a C# file for this C library and defined this function as:
[DllImport(DLLNAME)]
public static extern int SomeFunction(
int id,
string name,
SIPX_CONTACT_ID num,
IntPtr ptr1,
IntPtr ptr2
);
Now I've got only the values of only first three parameters. So, I want to pass the last two parameters as null . But I got "Cannot convert null to System.IntPtr because it is a value type" error.
To solve this problem I rewrote C# file as:
[DllImport(DLLNAME)]
public static extern int SomeFunction(
int id,
string name,
SIPX_CONTACT_ID num,
ref CLASS1 ptr1,
ref CLASS2 ptr2
);
Is this correct? It's not giving me the desired results. SomeFunction is returning me
wrong values.
I also tried an alternative approach. In the C# file, I declared an overloaded
function as:
[DllImport(DLLNAME)]
public static extern int SomeFunction(
int id,
string name
);
Then I called the function with only first two arguments. But that gives me an System.AccessViolationException : "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
What's wrong with this code?
Ut
|
|
|
|
|
Okay,
you could try to pass "0" instead of "null", since "null" is a built-in "feature" (dont know if its a datatype or "just" a value).
Since cpp null is nothing else than the value 0, you could try to pass this value instead.
*edit* please let me know if it works - i'm not that expirienced in programming cpp nor in programming c# ;D
|
|
|
|
|
It does work! Thanks a lot! You don't know how much time I wasted on this! Thanks a lot, again!
Utkarshraj Atmaram
|
|
|
|
|
I found out another way to do this using Type.Missing . We can write: string foo = (string)Type.Missing etc. and then pass foo as parameter.
Utkarshraj Atmaram
|
|
|
|
|
I want Save The Picture I drew in PictureBox,usually I can use PictureBox.Image
property to save, But the picture is I drew, the Image proper is null, What can i do in this case.
|
|
|
|
|
You must draw it into Image object, and then set this object into Image property, or draw them into picturebox on Paint event.
Geniality is in simplicity.
|
|
|
|
|
how will you differentiate interface and abstract class.
|
|
|
|
|
An interface can't contain any behaviour (it doesn't have any method bodies).
An abstract class can have some behaviour allready defined and can allready store properties into fields, etc..
Choosing wich one to use realy depend on your situation.
|
|
|
|
|
Hi psamy,
what do you mean exactly? Using a naming convention myself an interface starts with a capital I (I think MS does it the same way).
Was this your question?
Regards
Sebastian
|
|
|
|
|
I have been developing a vsto Word 2003 document action pane solution
. Now a trouble has come to me. It is how can deploy my build, including a word file, a dll, and some configuration files in xml format, to the share point portal document library. My questions are,
1). The word file can be upload to portal doc lib. But the related dll file cann't.
2). Even if the word file and all its related dll and xml files can be upload to portal doc library, i also confuse about the posibility of downloading related files of opening word file automatically. If the answer is yes, what is way to do so. please teach me. very thanks.
3). another thing is about the security policy, what means that how can the vsto word file be run when it is moved to a new position of hard disk from the original development place.
Very thanks!
jacklin
Sep 4, 2006
hangzhou, china
msn: shwlin@hotmail.com
jacklin
|
|
|
|
|
I think you're better off deploying the solution using clickonce deployment.
Be sure to exclude the clickonce directory from the sharepoint installation.
WM
|
|
|
|
|
Can you describe what you mean in more detail. very very thanks.
jacklin
|
|
|
|
|
I did publish my solution to share point portal document library, but failed with message "can't create web site on share point web service". can any one tell me the reason and what can i do now?
very thanks.
jacklin
|
|
|
|
|
i want to use this image with the move ...
http://www.shoppinp.com/loading100.gif
in my C# application
Palestine
|
|
|
|
|
what i can make
Palestine
|
|
|
|
|
Hi,
there should be a control named PictureBox. I don't know exactly if this control can handle animated GIF, but give it a try.
Regards
Sebastian
|
|
|
|
|
I've build the following, of wich I know it's not the way it's supposed to be and I also know how to fix it. I'm just wondering how it's caused.
- I open a SQLConnection
- I create a SQLCommand
- I run SQLCommand.ExecuteReader and store the readerobject in a variable
- I set the SQLCommand to null
- I create a new SQLCommand in the same SQLCommand variable
- I run ExecuteNonQuery
Doing the above will result in an InvalidOperationException with the message:
"There is already an open DataReader associated with this Command which must be closed first."
I looked to see if the setting to null and the creating a new SQLCommand actually resulted in a new object and it did.
Just for my understanding, how does this work in the background?
|
|
|
|
|
Jonathan van de Veen wrote: Doing the above will result in an InvalidOperationException with the message:
"There is already an open DataReader associated with this Command which must be closed first."
Command? Connection surely!
|
|
|
|
|
I'm affraid not. I've copied the message straight from VS.
|
|
|
|
|
Hello
You should call the SqlDataReader.Close() first, or make a new command object.
Regards
|
|
|
|