|
Hi Thanks alot for ur replay
but the problem is the nero solution pacakge make a train and test and it can generate a DLL but this DLL is supported by c++ 6 or pervious only i wanna to know if there is a way to link this DLL with C# or if there is a way or an update which make the nero solution generate a DLL file which allow to be linked with an application by C#
thanks alot
byebye for now
Gego
|
|
|
|
|
There is no linking as you think of it in terms of C/C++. The DLL must export functions (either C-style or C++-style) and the DllImportAttribute is used to configure the metadata necessary for the CLR to P/Invoke those calls. Read that link I sent you for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am working on a new project.
Basically, I want to implement a Window Form that mimics Internet Explorer.
So, it would consist of two parts.
A Window Shell with a browser capabilties, and the menu will be like a window explorer file-structure style (tree-like structure). And when clicked on the menu, it will call some aspx page (rendered inside the app).
Any hints welcomed.
I would like to know what class to use for those 2 components. Thanks.
Stanley
|
|
|
|
|
There are many articles on Windows Explorer-like interfaces here on CodeProject. I suggest you do a search.
As for Internet Explorer, you need to right-click on your toolbox and customize it. Click on the COM tag and find the "Microsoft Web Browser" or something like that (shdocvw.dll). When you add that to your toolbox and then to your form, two interop assemblies are created: Interop.SHDocVw.dll (contains the interfaces for the WebBrowser control) and AxInterop.AxSHDocVw.dll, which contains the AxHost -derived control you can put on your form. You can use these two together, and there are also plenty of articles about this here on CodeProject. Just use the Navigate or Navigate2 methods (the latter is recommended) to browser to the URL of your ASP.NET page.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have the following situation: I serialize an object, let's say ob, and later on I deserialize it and when I try to do this I get an exeption that tells me the following additional information: The constructor to deserialize an object of type ob.subOb was not found.
subOb being another object contained in the main object ob.
How do I have to do the Serialization in this case to get it right?
Thanks for you help.
Best regards,
Cristina
|
|
|
|
|
A type must have either a default constructor (no params) or a constructor that uses the following signature if you implement ISerializable :
access-modifier classname(SerializationInfo info, StreamingContext context)
{
} This is documented in the ISerializable interface documentation in the .NET Framework SDK. Note that you do not have to implement ISerializable for your class to be serializable, only to attribute it with the SerializableAttribute . Implement the interface when you want more control over what gets serialized (the default is all private and public fields).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm posting this with the risk of Heath getting angry at me because for this one instance I'm not using the parameters in the dataAdapter...not because I like the old way of constructing a long select command, but because I don't know how to use the parameters in this circumstance. I am querying a database, no big deal. But, there are like 7 or 8 different "filter" parameters the user may choose from...and they can also choose to not use any of them. I didn't know how to tell the adapter to ignore that particular parameter, so I resorted to constructing my own select command. However (and Heath will probably say I told you so ) two of these parameters are dates...I am trying to search BETWEEN Date1 AND Date2. This is giving me some really strange results though. First of all, I have to set Date1 all the way to the day before if I hope to get the correct results. Also, sometimes a perfectly good date range will return nothing, whereas a ridiculous range that hasn't even happened yet, will return rows with dates that don't fall anywhere in between my specified range. I'm sort of confused by it, so if anybody has faced this issue before, I'd like to know how it was solved....or, if I can somehow "turn-off" parameters at run time, or if I can see a small example, one or two lines is all, of how to create a parameter to the adapter at run time (peferrably a BETWEEN AND parameter), I'd be much obliged. And Heath, I know you get really frustrated when people don't use the adapter parameters, cause that's what they are there for, sorry about that.
|
|
|
|
|
If you post your SELECT statement, it'll make it easier to help spot the problem.
Michael
CP Blog [^]
|
|
|
|
|
Putting pound signs around the Date like Heath suggested made my query a little better...I no longer have to subtract a day from Time1 to get the correct results. But here is the strange result I'm getting:
A row with a date column of 5/4/2004 is being selected when the date value of Time2 is 5/11/2004 and Time1 is anything from 5/4/2004 to 5/10/2004, but it's not selecting my row when Time1 is before 5/4/2004, and it should. Here is the statement I'm using to select my rows. I hope you can find something, because I sure can't:
string MySQLText = "SELECT * FROM Invoices";<br />
<br />
DateTime Time1 = new DateTime(dateTimePicker1.Value.Year, dateTimePicker1.Value.Month, dateTimePicker1.Value.Day, 0, 0, 0);<br />
<br />
DateTime Time2 = new DateTime(dateTimePicker2.Value.Year, dateTimePicker2.Value.Month, dateTimePicker2.Value.Day, 23, 59, 59);<br />
<br />
MySQLText += " WHERE (OrderDate BETWEEN #" + Time1.ToString() + "# AND #" + Time2.ToString() + "#)";<br />
<br />
oleDbSelectCommand1.CommandText = MySQLText;<br />
oleDbDataAdapter11.Fill( MyDataset );
|
|
|
|
|
I won't badger you this time, but I still suggest you try it. Once you do, I suspect you'll never turn back.
Dates in SQL Server are single-quoted like strings. When referring to Date fields, SQL Server knows what to do. For Access (and some other's I've seen, but don't remember) you encase them in pounds (or hashes - #). If you don't, they will be treated like strings (IIRC) so you won't get the result you'd expect.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Even with the pound signs, the adapter is treating the dates as strings. It is acting like 5/11/04 should go BEFORE 5/4/04. If using the parameters will fix this, I'll change to them as long as I can add them to the adapter programmatically, because in truth I would prefer to use the parameters...I just didn't know how in this situation. What would you suggest? Thank
|
|
|
|
|
Trust me - using parameters is so much better. You can add them programmatically, as there is no other way!
For example (and I'm assuming you're using an OleDbCommand since you're using # signs):
OleDbCommand cmd = oleDbConnection.CreateCommand();
cmd.CommandText = "SELECT * FROM MyTable WHERE DateCol BETWEEN ? AND ?";
cmd.Parameters.Add("StartDate", OleDbType.DBDate).Value = DateTime.Parse("5/4/04");
cmd.Parameters.Add("EndDate", OleDbType.DBDate).Value = DateTime.Parse("5/11/04");
OleDbDataReader reader = null;
try
{
oleDbConnection.Open();
reader = cmd.ExecuteReader();
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
}
finally
{
if (reader != null) reader.Close();
oleDbConnection.Close();
} Of course, you could use this command with an OleDbDataAdapter as well - this is just an example.
Still, though it is unusual that it's treating it as a string. You're not using quotes and # signs, are you?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'll give this a try and see if it makes a difference. And no, I just have the hash signs, not the single quotes. The message I replied after the other person's post is a direct copy and paste.
|
|
|
|
|
I'm pretty embarrassed to admit this, but I discovered that the date column in my database was set to text. At any rate, I did convert things to parameters, so your efforts weren't in vain. Thanks for the help!
|
|
|
|
|
I am zipping up a bunch of files and "Modified" date on the files always turns out to be 1/1/1980 12:00AM
The date I have is in DateTime format, and I tried
zipEntry.setDate(d.ToFileTimeUtc())
zipEntry.setDate(d.ToFileTimeUtc())
zipEntry.setDate(d.ToFileTime())
zipEntry.setDate(d.Ticks)
Nothing works!!! It keeps on getting 1/1/1980 12:00AM
Do you have any idea why this is not working?
Code:
<br />
<br />
ZipEntry currententry = new ZipEntry(localPath);<br />
currententry.setMethod(ZipEntry.DEFLATED); <br />
currententry.setTime(createDate.ToFileTimeUtc()); <br />
<br />
m_zipstream.putNextEntry(currententry); <br />
<br />
try<br />
{ <br />
java.io.FileInputStream current = new java.io.FileInputStream(fullPath); <br />
try<br />
{<br />
sbyte[] buffer = new sbyte[8192];<br />
int buffercount;<br />
<br />
while ((buffercount = current.read(buffer, 0, buffer.Length)) > 0)<br />
m_zipstream.write(buffer, 0, buffercount); <br />
}<br />
finally { current.close(); } <br />
}<br />
finally { m_zipstream.closeEntry(); }<br />
Thanks,
Elena
|
|
|
|
|
|
I've heard that too (and I see I'm mentioned ). In this case, however, is sounds like an epoch problem since Java and .NET (not to mention the OLE DATE and who knows what else) all use different epochs. The DateTime struct in .NET also uses ticks (100 ns) instead of ms like most structs. And developers thought all the different text encodings were a problem!
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I never even used J#, but you could be right. I didn't know that they actually replicated the Java classes like DateTime that have equivalents in C#, but it does make sense. In any case, the poster'd probably be MUCH better off using SharpZipLib...
|
|
|
|
|
The didn't. The java.util.Date is nothing like the DateTime . The J# portability assemblies work just like the Java classes. Encapsulating a DateTime in a Date , for example, would screw-up any code that modifies the Date .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
DateTime in .NET and the date and time in Java use different epochs (start times). DateTime is the number of ticks from 00:00:00 Jan. 1, 0001 AD. Java's Date starts at 00:00:00 Jan. 1, 1970 AD and is the number of milliseconds from that date/time.
A tick is 100 nanoseconds. So, to convert a DateTime to the number of milliseconds to use, you'll need to take this information into account and convert the number.
The best way is to use the java.util.Date class. When working with the vjslib.dll assembly, keep in mind that this assembly exists only to make it easier for Java developers to make the move. It's intended to work just like it would if you were still developing with Java classes. Classes in the FCL and Java assemblies should not be inter-mixed without proper consideration.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Is java.util.Date a part of vjslib or is it from a different library?
Thanks for your help.
Elena
|
|
|
|
|
Yes it's in the vjslib.dll assembly, along with pretty much everything else you'd find in the JRE (besides the swing stuff). If you want to know for sure, run ildasm.exe (the IL Disassembler found in the .NET Framework SDK bin directory) and open the vjslib.dll assembly in the %WINDIR%\Microsoft.NET\Framework\v1.1.4322 directory. This will show you the assembly and Type metadata, as well as the IL for any module(s) in the assembly (if you know how to read IL).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How can I display a popup tip when the mouse moves over a certain area on a form?
Help class can show popup tips but I cannot hide the tip when I am done with it. Any suggestion?
Thanx
|
|
|
|
|
A simple hack would be to put a Panel in that region of the form and use the ToolTip component to set the tooltip for that region. The ToolTip is an IExtenderProvider that provides "properties" to other controls. Once you add it, click on that Panel and you'll see something like "ToolTip on panel1" (or whatever you call your panel variable).
The other way is to P/Invoke SendMessage and send the tooltip common control messages, which is really all the ToolTip component is doing. You can use the Form.MouseHover event to determine when to show the tooltip.
You can find out more about the tooltip common control and it's messages in the Platform SDK: http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/tooltip/reflist.asp[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Great ideas. Thanks a lot.
|
|
|
|