|
I need to use midiInGetErrorText[^]. I've managed to get it to work by using a StringBuilder with it's Capacity set to UInt16.MaxValue, and passing the StringBuilder to the second parameter and it's Capacity to the third.
public string GetErrorText(Result error)
{
StringBuilder resultBuilder = new StringBuilder();
resultBuilder.Capacity = UInt16.MaxValue;
Functions.midiInGetErrorText((UInt16)error, resultBuilder, (UInt16)resultBuilder.Capacity);
return resultBuilder.ToString();
} Is this the correct way?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
DaveyM69 wrote: Is this the correct way?
I don't think so, setting the capacity actually allocates a char array of that size.
Set a reasonable capacity, then use P/Invoke:
public string GetErrorText(Result error) {
StringBuilder resultBuilder = new StringBuilder(300);
Functions.midiInGetErrorText((UInt16)error, resultBuilder, (UInt16)resultBuilder.Capacity);
return resultBuilder.ToString();
}
BTW: I wouldn't be surprised if the integers needed 32-bit, hence (int) instead of (UInt16)
|
|
|
|
|
Luc Pattyn wrote: I wouldn't be surprised if the integers needed 32-bit
I wondered about that. I've examined several implementations for other winmm functions and some have used int, some uint and some ushort. Is there any definitive way to find out? (I believe all the original constants and prototypes are in mmsys.h - I don't know if that's an original 16 bit C file or a newer 32bit C++ one.)
[Edit] I assumed it was using 16 bit as the midiInProc callback passes a dw that contains 4 bytes - therefore a word should contain 2 [/Edit]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I don't know the finer details of all those fancy integer (and string!) types in C and C++.
Most of the time it says int or DWORD, both being 32-bit.
Be warned about long and char, they differ in .NET versus native.
signed/unsigned does not matter.
To find out, either delve into the header files, or just try. With a pointer in the list, one will work,
the others will fail.
BTW: there is that nice MAXERRORLENGTH constant, that (if not too large) would be the right capacity once you know its value.
|
|
|
|
|
That constant is declared:
#define MAXERRORLENGTH 256 /* max error text length (including NULL) */
but some of the strings returned by the function are longer
(the file is actually MMSystem.h)
255 works fine
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
modified on Saturday, April 25, 2009 9:26 AM
|
|
|
|
|
Found this MSDN page[^] that states what data types to use in the managed world
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
hii i change font of textbox several times but when i tried to change font in hindi and run my project it shows blank squares on typing in textbox, also i have hindi fonts installed pls help me with this problem.
|
|
|
|
|
Removing the Bold would help everyone else - blank squares are preferable to that!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
sorry sir but that is not working anything else
|
|
|
|
|
Hello there,
I have the setup for Visual Studio.NET 2008 but it is in .iso format. I searched google and found that it was an image file. How can I install Visual Studio 2008 from it? Will I have to burm it to a CD or DVD? or is there any software to do that job for me? I dont have a DVD writer, but I know that the setup would require 2 CD disks then. Please help me..... Please..... Its really urgent!
Thanx,
Rajdeep.NET
|
|
|
|
|
YOu require, PowerISO software to read ISO files.
|
|
|
|
|
|
This VS2008 ISO wouldn't be a pirate, would it? If so, remember you gave your email when you registered here? No so clever, was it?
I'm sorry but you are behaving a bit judge jury and executioner here. You asked him if it was pirate when you had clearly already made your mind with your "no so clever" comment. If you had any clue, you would realise that ISO is a very common method of distributing software to many people such as:
An MSDN subscription for a company.
Or more likely and as in my case via the MSDN Academic Alliance that provides free VS and other things to students who's universities are part of it in ISO format.
And besides, what do you really think is going to happen even if it was pirate, Microsoft is clearly going to file a lawsuit against one guy on one of the millions of forums out there on the premise that his e-mail address was not generated by 10 minute mail or just created as a false one?
Perhaps think next time before you start accusing people without knowing really what the situation is.
|
|
|
|
|
My apologies if you took it that I was accusing anyone in particular of pirating software. If I believed that this was pirate software, would I have given links to software to use it? Unlikely...
Yes, ISO is a common method of distributing software legitamately, but it is also a very common way of distributing software illegaly.
Most users who pay for software in ISO format would allready have a good idea what to do with it, or the provider will recommend a package. If they didn't, wouldn't they ask first, or order the CD version?
If you have a company MSDN subscription, then the IT department will normally handle distribution, and save everyone else from needing to install yet more software.
Of course MS isn't going to sue a single person, even he if shouts "I pirate Software" as his signature. But do we have the right to encourage piracy on this forum? Or should we discourage it? Do you get paid for software production - I do. Does piracy hurt your company - it would mine.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Of course we should discourage it, but we should do so in a professional manner. I felt that your comments were a little unfair since you don't really know the full story behind why he has an ISO.
There are quite a lot of people at my university who use the MSDNAA ISO files so they can work at home. You would be quite suprised how clueless some people are when it comes to computers and yet are taking a computer course. The tech department gives instructions on what to do, but people are people and just don't read half of the time.
|
|
|
|
|
Steve_ wrote: but people are people and just don't read half of the time.
I agree, I don't always http://www.codeproject.com/script/Forums/View.aspx?fid=1159&msg=3013204[^]
I also noted that the original poster is based in India, were software piracy is rife...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi,
In a dataGridView, One of the column type is combobox. How to read the values from combobox in grdConditions_CellValueChanged event.
Please guide me.
Thanks in advance.
modified on Saturday, April 25, 2009 3:55 AM
|
|
|
|
|
hi i am creating a windows application that will take a binary file as input and this binary file is on the my website so when i download it from the website it should directly go into the window's application for processing how do i do
|
|
|
|
|
Hi,
There are two solutions that comes to my mind at this point.(i am assuming the website you have mentioned is under your control)
1) you store the file on an FTP server , and then use the FTP class provided in .net to check if there is file available (Also we can use a date time stamp to check if we really want the file), then download the file and run the file using "Shell".
2) using a web service , you write a web service which will provide the file to you , then from windows application call the web service , get the file and run using "Shell".
Please let me know if this what you want(Let hope ) , i am just trying to give you direction to think , if you need more help let me know .
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
You can use filesystemwatcher to detect when a file is written to a specified directory.
|
|
|
|
|
hi GURUs my myself Vinod
i am an amature in network programming
as an assignment for my final year i have picked up LAN messenger
actually there are many questions but 1st things 1st
*
HOW DO I GET THE NAMES AND IPADDRESS OF ALL THE COMPUTERS IN MY OFFICE?????????????????
*
Desperately waitin for ur reply
n thx a million in advance
|
|
|
|
|
Hi Vinziee ,
You can try the following code , also do not forget to Import System.Net
In the following example we use the service of DNS , first we find the host of current computer
then try to get list of computer from this DNS. I hope this works .
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
GetAllIP()
End Sub
Public Function GetAllIP() As Integer
Dim strHostName As New String("")
strHostName = Dns.GetHostName()
Console.WriteLine("Local Machine's Host Name: " + strHostName)
Dim ipEntry As IPHostEntry = Dns.GetHostEntry(strHostName)
Dim addr As IPAddress() = ipEntry.AddressList
Dim i As Integer = 0
While i < addr.Length
TextBox1.Text = TextBox1.Text & vbCrLf & String.Format("IP Address {0}: {1} ", i, addr(i).ToString())
System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
Application.DoEvents()
End While
Return 0
End Function
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
Sorry the previous code is in Vb , i hope you will be able to convert it . It is very simple
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
Hi!
I am currently doing a project that involves automated logging-in on web accounts. I used the webBrowser control for this purpose and so far everything is working fine.
However, the method I use is: webBrowser1.Document.GetElementById("btnSubmitURL").InvokeMember("click");
The problem comes in when the button elements do not have name or id properties. Is there a way to invoke the click event without knowing the name or id of the button element?
The only other method I know is GetElementFromPoint(), but it would be good if there is another way since this method requires knowledge on the coordinates of the button.
Thanks everyone.
|
|
|
|