|
i think so.
readInt()
Reads four input bytes and returns an int value.
http://java.sun.com/j2se/1.4.2/docs/api/java/io/DataInput.html
Reads four input bytes and returns an int value. Let a be the first byte read, b be the second byte, c be the third byte, and d be the fourth byte. The value returned is:
(((a & 0xff) << 24) | ((b & 0xff) << 16) |
((c & 0xff) << 8) | (d & 0xff))
|
|
|
|
|
The Java readInt method reads in big-endian (Motorola) format, while .NET ReadInt32 reads in little-endian (Intel) format.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa wrote: The Java readInt method reads in big-endian (Motorola) format, while .NET ReadInt32 reads in little-endian (Intel) format.
How could I forget? Guess I haven't worked with Java in a long time
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Ok so i figured it out.
Now when i write the integer to the file, i would have to write it using Big Endian coding so Java can read it, correct?
Anyone want to point me in the right direction?
|
|
|
|
|
Ok I'm still pretty new to C# and could use some advise. I'm trying to work with the SJPhone API and all the examples that come with it are in VB6. To start the program up you need to initialize the API and it is done like this...
Private Sub StartConnecting()
TextState.Text = "Initializing: stage 1"
Set ApiConnection = New SJxmlApiConnection
If (ApiConnection.Initialize("SJphoneXmlApiDemo.dll")) Then
ToConnectingState
Else
ToConnectfailedState
End If
End Sub
Now if I try to call the dll like that C# has a fit, but I just don't know why yet? What is the C# way of doing this? The Init function requests the dll passed as a string so what can I do different? Thank you for any help here.
|
|
|
|
|
Converting from VB6 to C# might be in the same league as a root canal. Here is my thought on how to do the code you specified...
(1) make a reference to SJPhoneXMLApiDemo.dll in the Solution
(2) the c# code may be something like:
void StartConnecting()
{
TextState.Text = "Initializing: stage 1";
SJxmlApiConnection ApiConnection;
if (ApiConnection.Initialize("SJPhoneXmlApiDemo.dll")))
{
ToConnectingState();
}
else
{
ToConnectfailedState();
}
}
Not sure if this code will compile, but it would be my first stab at the problem...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Well at least I can say that I was thinking the same thing when I made my attempt. My first try at making this work looked exactly like your code If I try to reference the DLL I get an error that it's not a valid COM object and when I try to run the above code I get a COM exception error. I did try to let VS convert the VB6 version of this app to C# and that was just a nightmare. Are there things you just can't do in C#, like this?
|
|
|
|
|
Hi,
I had been trying to set up my C# program to be a .dll for my C++ project. I had followed the guide from this site (http://www.csharphelp.com/archives/archive281.html) to package it as a Com Object. It worked in all regards, except that when I try to make a pointer to the exported class (public class DBCOM_Class : DBCOM_Interface in example), the named class is not seen by the C++ project. I can see/make pointer to the interface and the event handler, however the class itself doesn't show up in the list of members of the exported namespace (Database_COMObject) in the example.
What do I do wrong?
wbr,
Victor
|
|
|
|
|
I have a ToolStripContainer with four ToolStripPanels. I need to remove this container from the project without loosing the menus and toolbars I have contained within it.
I have been searching for two days trying to find any info on how to save the docked toolbars by serialization. I then decided to remove the container. I found lots of info on creating the container but nothing on serializing the controls or removing the ToolStripContainer from the project!
Any help is appreciated.
Mark
|
|
|
|
|
If you remove the container, you'll lose it's contents. Where were you hoping they would go ? You'd need to replace them with conventional menus and toolbars, and I don't think there's an automated way to do that.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thought so. I dropped the MenuStrip, ToolStrips (2) and a StatusStrip on a form. Later I added a ToolStripContainer (with four panels). Didn't like it so now I want to remove it.
Mark
|
|
|
|
|
need to know hw 2d dwt wrks for images hv a class in 1d form.
|
|
|
|
|
u shd wte cplet stcs or we dnt undsnd u
modified 12-Sep-18 21:01pm.
|
|
|
|
|
There's a full 101 key keyboard in front of you. Use it.
TXT speak is frowned upon here because it makes your posts difficult to understand. All I could pick out was something about 2D drawing?
|
|
|
|
|
Dave Kreskowiak wrote: There's a full 101 key keyboard in front of you. Use it.
Hey, the subject of the post is "compression". Maybe he's proposing some sort of text compression algorithm. Lossy, obviously...
Anyway, your guess is as good as mine...
Sean
|
|
|
|
|
|
how do can i open excel charts(in Excel 2007)in .net with C#?
|
|
|
|
|
The Microsoft Tools for Office give you the ability to interact with Office.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I generally use this method to update buttons cross-thread, but ToolStripButtons don't have the InvokeRequired property.
delegate void UpdateStartDelegate(bool newState);
private void updateStartButton(bool newState)
{
if (startButton.InvokeRequired) // is cross-thread update
Invoke(new UpdateStartDelegate(updateStartButton), new object[] { newState });
else
startButton.Enabled = newState;
}
Is there an easy way to do the same thing with a ToolStripButton?
|
|
|
|
|
((Control)btn).InvokeRequired
only two letters away from being an asset
|
|
|
|
|
All ToolStripItems (suach as ToolStripButton) are only of type Component. They don't inherit from Control.
Regards.
|
|
|
|
|
You're correct, my mistake
only two letters away from being an asset
|
|
|
|
|
use a synchronous calls using a timer
|
|
|
|
|
I apologize for posting on an old thread, but I had the exact same question, and there did not seem to be an answer to this one. Someone mentioned using a timer, but my cross-thread could take several seconds, several minutes, or several hours.
I think I came up with an answer, so for future searchers I decided to post. I would test the ToolStrip that contained the button. This code seems to work to enable a toolstripbutton when a thread is done.
public void Enable()<br />
{<br />
if (toolStrip.InvokeRequired)<br />
{<br />
EnableButtonCallback d = new EnableButtonCallback(Enable);<br />
toolStrip.Invoke(d, new object[] { });<br />
}<br />
else<br />
{<br />
button.Enabled = true;<br />
}<br />
}
|
|
|
|
|
Hi,
I am designing a paint brush type program…..for drawing area where I can draw something then I used pictureBox…..like as
Pen p = new Pen(Color.Red, 5);
g = pictureBox2.CreateGraphics();
g.DrawEllipse(p, e.X, e.Y, 5, 7);
in this program I can draw anything but when I want to save this drawing by the help of this command: pictureBox2.Image.Save(saveFileDialog1.FileName);
then an error occur : “NullReferenceExpection was unhandled !”
“Object reference not set to an instance of an object.”
I need your help………can anybody solve my problem
Thanks
|
|
|
|