|
yes. Anyway, I was able to make it work now. Thanks though!
|
|
|
|
|
Hi All,
i need to call a c# code in my java program. i followed the approach given in the codeproject link: http://www.codeproject.com/KB/cross-platform/javacsharp.aspx but there are some issues in generating netmodule , which is required to perform further steps. but it is giving an error
"csc /debug /t:module "bin\Debug\\HelloWorld.dll"" exited with code 9009 on using post build event command line.
Command is:
E:\c#\getOLCont\getOLCont>csc /t:module form1.cs
the error is:
fatal error CS0009: Metadata file 'c:\Program Files\Reference
Assemblies\Microsoft\Framework\v3.0\System.Workflow.ComponentModel.dll'
could not be opened -- 'File is corrupt.'
i have tried the command on different machines but there is same result.
please tell a way to solve this problem.
Regards
Kapil
|
|
|
|
|
Hi,
I have a windows application and I have added a setup project to this application. Im using the custom installer class as I have to run a batch file after the application is installed.
For this, im using overriding the OnAfterInstall event of the base class and have added code there to start a new process that runs the batch file.
The problem is the OnAfterInstall Event is not raised at all. I have added message boxes to check if the events are raised. Also tried the OnBeforeInstall event but in vain.
Need a solution asap. Any help or directives on this wud be very helpful
Thanks,
Shri
|
|
|
|
|
Have you added the component to the custom actions window of your setup?
|
|
|
|
|
HI, I want to iterate only those rows of excel sheet where the data have written, means if user has filled only first 15 rows then my loop should iterate to 15 only,hO wcan i do that Below is sample code which iterates up to 65536 rows,unnecessarily ,but the data are present only in first 15 or 18 rows. Please give me a solution or an idea
This is my sample code
Microsoft.Office.Interop.Excel.Application Excelobj = new Microsoft.Office.Interop.Excel.Application();
if (Excelobj == null)
{
MessageBox.Show("Excel couldn't be started", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Workbook workbook = Excelobj.Workbooks.Open(fdgExcel.FileName,Type.Missing, Type.Missing, Type.Missing,Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing , Type.Missing, Type.Missing);
Sheets sheets = workbook.Worksheets;
Worksheet worksheet = (Worksheet)sheets.get_Item(1);
for (int i = 2; i < worksheet.Rows.Count;i++ )
{
Range range = worksheet.get_Range("A" + i.ToString(), "C" + i.ToString());
}
|
|
|
|
|
int lastUsedColumn = worksheet.Cells.SpecialCells(XlCellType.xlCellTypeLastCell, Type.Missing).Column;
int lastUsedRow = worksheet.Cells.SpecialCells(XlCellType.xlCellTypeLastCell, Type.Missing).Row;
should tell you the last used row and column
|
|
|
|
|
i want to create crystal report for access(password protected)database.i do it bu this project run another computer error messege come loginfo.
please help.i want to diploy database datadirectory.i using visual studio 2005 exprees editon.(crystal report for .net framewort 2)
get more example.because i am biginner
|
|
|
|
|
lankaudaranga wrote: get more example.because i am biginner
So I see. Hence the useless subject, I guess.
I would suggest you buy a beginner book and work through it, start with someting simpler, then work up to this. If you're being paid to do this, let your client know they made a poor choice and they should move on.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
lankaudaranga wrote: .because i am biginner
That's no excuse, and use more descriptive subject lines
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi i am sending mail from my windows apllication...,
For a particular mailid, i am attaching more than one files also...,
Now my question is, " Is there any size limit is there for attachments to send mail for a particular mailid?...,
If there upto how much size i can able to send?,
And one more thing is if i want to send more than that size any cod i have to modify or add?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Hmm.. I think the limit is not in your application, but the limit in in mailserver.
You must increase the limit in your mailserver.
|
|
|
|
|
It depends on mail server.
|
|
|
|
|
Hi i am sending mail to different ids...,
Everything going on well....,
I am going to make this application to exe and put it in schedular task...,
This things will execute automatically...,
Now my probs is suppose mailserver is down...,
Then it will be probs in mailsend...,
So in that case how to handle the code.., it mean if the mailserver will down or mail didnt send properly...,
Then it have to be fire again, after some minutes or some other condition have to do how to do that?
This is my code:
DirectoryInfo dInfo = new DirectoryInfo(mypath);
DirectoryInfo[] dInfos = dInfo.GetDirectories();
foreach (DirectoryInfo d in dInfos)
{
MailMessage mailMessage = new MailMessage();
MailAttachment attach = null;
mailMessage.From = "Magesh@Test.com";
mailMessage.To = d.Name;
mailMessage.Subject = "Hi";
//mailMessage.Body = "Hi This One Is For Testing
FileInfo[] fInfos = d.GetFiles();
foreach (FileInfo f in fInfos)
{
attach = new MailAttachment(f.FullName);
mailMessage.Attachments.Add(attach);
}
SmtpMail.Send(mailMessage);
mailMessage.To = "";
attach = null;
}
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
You need to catch the errors and persist the failed mail details. When it executes next time, read from this persisted data and try to resend.
|
|
|
|
|
but my senior talked an=bt some thing emi or dmi whats that?,
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
I'm using the following code to roundtrip a value between one Int64 var and two In32 vars.
public static Int64 Int64FromPersistentIDs(int highID, int lowID)
{
return (((Int64)highID << 32) + (Int64)lowID);
}
public static void PersistentIDsFromInt64(Int64 longID, ref int highID, ref int lowID)
{
lowID = (int)(longID & 0xFFFFFFFF);
highID = (int)((longID >> 32) & 0xFFFFFFFF);
}
This code roundtrips well when highID is positive, and when highID is negative and 9 digits, but it fails as soon as highID is negative and 10 digits - the highID comes back as off by one (one too large).
What am I doing wrong here?
|
|
|
|
|
int64 is up to 19 digits and
Max/Min value is +/-9,223,372,036,854,775,808 ,
where int32 is only 10 and
Max/Min value is +/-2,147,483,647
what your'e doing is spilling bits off by (int)(longID & 0xFFFFFFFF);
int is Int32 and not int64
Have Fun
Never forget it
|
|
|
|
|
Actually, that wasn't it. I think.
I went back and changed all Int64 to UInt64, and it stopped failing in all cases.
|
|
|
|
|
Can you give an example that does not work?
Using your methods, I plugged in some numbers and, round trip, it works just fine (even without changing the types to unsigned).
static void Main(string[] args)
{
int highID = -1234567890;
int lowID = 123456789;
Console.WriteLine("Build 64-bit ID:");
long longID = Int64FromPersistentIDs(highID, lowID);
Console.WriteLine("highID: ({0,20})", highID);
Console.WriteLine(" lowID: ({0,20})", lowID);
Console.WriteLine("longID: ({0,20})", longID);
Console.WriteLine("\nExtract-32 bit IDs:");
PersistentIDsFromInt64(longID, ref highID, ref lowID);
Console.WriteLine("longID: ({0,20})", longID);
Console.WriteLine("highID: ({0,20})", highID);
Console.WriteLine(" lowID: ({0,20})", lowID);
}
public static Int64 Int64FromPersistentIDs(int highID, int lowID)
{
return (((Int64)highID << 32) + (Int64)lowID);
}
public static void PersistentIDsFromInt64(Int64 longID, ref int highID, ref int lowID)
{
lowID = (int)(longID & 0xFFFFFFFF);
highID = (int)((longID >> 32) & 0xFFFFFFFF);
}
Outputs:
Build 64-bit ID:
highID: ( -1234567890)
lowID: ( 123456789)
longID: (-5302428712118268651)
Extract-32 bit IDs:
longID: (-5302428712118268651)
highID: ( -1234567890)
lowID: ( 123456789)
|
|
|
|
|
Sure:
The following High / Low combination: -1173074781 / -1181223073
was round-tripping back as -1173074782 / -1181223073
(note the High Order output is one more than the input.)
I determined that that code which builds the 64bit INT was the culprit, here's why. These IDs are passed to me by an application that actually stores a 64 bit number in it's XML database. However, instead of passing me the 64bit number, it passes me two 32 bit numbers.
I looked inside the database for the record I was querying, and the 64bit number stored there is: BA144CA3B997F75F
But my code (return (((Int64)highID << 32) + (Int64)lowID) ) was returning BA144CA2B997F75F (note the difference at the 8th digit - the 2 should be a three)
So I was getting a bad 64 bit number from my code. I changed my units to UInt64, and my code started returning a 64 bit number which matched that number stored in the database.
I don't know exactly why it was failing, but I could tell it was a "size" issue, because some inputs were returning the correct 64 bit numbers (as validated in the database), and some were not.
|
|
|
|
|
I'm a chinese learner, Use the MatrixClass.cs to want to get my resualts, but can not...
Can you use my arrA,arrB and Matrix to get the resualt? help me, please!
double[,] arrA = { { 99.07, 70, 1.6, 1.1, 0, 0, 25, 0 }, { 0.31, 15.7, 0.45, 0.3, 0, 0, 1.34, 0 }, { 0.05, 0.2, 30.52, 54.5, 0.09, 0, 50, 0 }, { 0.05, 0.2, 21.32, 2.1, 0.08, 0, 0, 0 }, { 0.23, 13, 0, 0, 42.77, 58.2, 0, 72.28 }, { 0, 0, 0, 0, 42.77, 0, 0, 0 }, { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, -67.2, 0.8, }, { 0, 0, 0, 0, 1.71, 2.3, 0.8, 69.96 } }; ; //array of coefficients
double[,] arrB = { { 72 * 100 }, { 1.2 * 100 }, { 8.3 * 100 }, { 4 * 100 }, { 14.0 * 100 }, { 0.042 * 100 }, { 0 }, { 0 } };
|
|
|
|
|
WHAT????
present the problem/Question, beacuse i can't see it
Have Fun
Never forget it
|
|
|
|
|
|
sgncdc wrote: I'm a chinese learner, Use the MatrixClass.cs to want to get my resualts, but can not...
Why can't you? What is keeping you from getting the result? What do you do to try to get the result, and what happens when you do that? Do you get any error message?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
sgncdc wrote: MatrixClass.cs
What is this and why do you expect us to know about it ? If it's in an article, ask the author in the forum under the article.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|