|
I computer use XP ,I want to my program interface can cover the XP system deskface. how can I do ?
|
|
|
|
|
|
|
Hi All
I would like to use a DLL written in C, in my .Net 2.0 win application.
I’ve tried using DllImport, but I’ve encountered the following exception:
“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”
Probably because I didn’t declare the function right.
The DLL function I’m trying to use is:
extern "C" __declspec(dllexport) void EncryptString(char* inString, int strSize, char* ret)
What should be the .Net equivalent?
Thanks in advance
Yaron.A
|
|
|
|
|
stringbuilders are used to marshal strings that get changed by the unmanaged code..
try
<br />
[DllImport(@"YOUR.DLL")]<br />
public static extern void EncryptString(String inString , int strSize , System.Text.StringBuilder result);<br />
this is assuming the first parameter won't be changed.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Works like a charm, i've spent hours to figure out this one.
THANKS Malcolm!
|
|
|
|
|
A pleasure.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Hello...
I have a problem. For example :
public class MyClass
{
public int A = 1;
public int B = 2;
public int C = 3;
}
If I serialize that class, I want to serialize A and B only. I don't want to serialize C.
Are there any possibilities to do that ?
I'm using XmlSerializer.
Thanks...
|
|
|
|
|
Use the XmlIgnore attribute to prevent specific public properties from being serialized.
/ravi
|
|
|
|
|
Ravi's response will take care of your problem, but if you want further information I have an article on XmlSerializer attributes[^] that should help out.
|
|
|
|
|
hi
my project have 2 form and i call show() method to showing Form2
i want to pass a parameter (or property) to form2 when it showing or
find that form2 is close or show in form1
Does anyone know how i can do this action?
Thanks;
|
|
|
|
|
I think I understand your question, try using ShowDialog() instead of Show() . If I don't understand your question, reply with more details.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Declare private fields for the properties in Form2 and set them when you construct the form. For example:
Form2 f2 = new Form2 (prop1, prop2, etc.)
f2.Show(); /ravi
|
|
|
|
|
hi
my project have 2 forms ...in form 1 i have a button and button1_Click is
private void button1_Click(object sender, EventArgs e)
{
this.DesktopLocation = new Point(DesktopLocation.X - 200, DesktopLocation.Y);
new Form2(this.DesktopLocation.X + this.Width, this.DesktopLocation.Y).Show();
}
now form2 is Show() and i want to know IN FORM1 that form2 is close or still running ....
and when form2 is close event or property fire in form1 to Form1.DesktopLocation return to orginl location...
here is source code of my project[]
Does anyone know how i can do this action?
Thanks;
|
|
|
|
|
Hi
Declare in form1
public static bool IsForm2Closed;
now in form2 add at closing event this line
form1.IsForm2Closed = true;
thus , you can query about the var IsForm2Closed from form1 Timer , button or such
bye
I know nothing , I know nothing
|
|
|
|
|
Dear All,
I tried searching CP for some relevant answer as to "How to integrate a help (.chm) file with my dot.net application).
Any comments / suggestion / solutions ...
Thank you!
Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
On install of your software put it into the same directory as the your executeable. Or not, doesn't matter, just know where you put it. Build a string for the directory of the file, and show it like this:
<br />
Help.ShowHelp(this, strHelpFilePath, "Introduction.htm");
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Thx for the hlep Perez.
I m quite unable to understand the syntax above, can you please be more elaborative.
Thank you!
"Mess with the Best, Die like the rest"
|
|
|
|
|
Hi,
I have 2 tables with same fields like event, venue, date and cost. Table 1 has 5 records and Table 2 has 100 records. How can i take a record from Table 1 and match with Table 2 to get the exact match record of Table 1 record. Please help me out. Thanks in advance.
|
|
|
|
|
If I understand you correctly, you just have to make a condition that matches all the fields. Example:
... where t1.event = t2.event and t1.venue = t2.venue and t1.date = t2.date and t1.cost = t2.cost
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks for the reply. all the Records in Table 1 and Table 2 will not be same. I will give you an example.
Table 1:
Event Venue Date Cost
Cricket Chepauk Stadium 11-10-2007 99
Table 2:
Cricket Match Chepauk, Madras 11-10-2007 99
India Vs Aus Chepauk Stadium 11-10-2007 99
Cricket Match Madras Satdium 11-10-2007 99
Here 1 record of Table2 will be exact match because 1 word from all the fields has matched. I need the nearest match from Table 2 for Table 1 record.
Thanks in advance
Jebin
|
|
|
|
|
jebin k wrote: all the Records in Table 1 and Table 2 will not be same.
That's a funny definition of "exact match".
jebin k wrote: I need the nearest match from Table 2 for Table 1 record.
You can count how many of the fields that match with something like:
case when t1.Event=t2.Event then 1 else 0 end +<br />
case when t1.Venue=t2.Venue then 1 else 0 end +<br />
case when t1.Date=t2.Date then 1 else 0 end +<br />
case when t1.Cost=t2.Cost then 1 else 0 end
You can sort on the value using descending order to get the best matches first, and filter out only the matches that reaches a certain value.
You can use other values than 1 in each case if you want the fields to have different importance.
---
single minded; short sighted; long gone;
|
|
|
|
|
Sorry for the wrong word (Exact match) , Thanks for your advice.
|
|
|
|
|
What you could do is take the row from table one, load it into some variables,
Once you have your fields loaded up, you would iterate through table 2, and if the first column matches, look at the second column, and contiue for all columns, if one of them doesn't match, then break out out of the loop, and continue to the next row.
Once you find a row that has all columns matching, break out of the loop and return success.
Hope that helps
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Field values will not be exactly same, 2 fields date and cost will be same but other two string columns will not be exactly same .
(Eg Dallas Cowboys vs Chicago bulls will be there in Table 1 Event Column where as Cowboys Vs Chicago bulls will be in Table2 Event Column and other columns will be same..
|
|
|
|