I am currently using a C .dll file in my vb.net project, and need to access a string that it returns (as a pointer to a char array). How can I access this?
Private Declare Function src_error Lib "libsamplerate.dll" (ByVal err As Integer) As (???) 'i've tried intptr, string, integer, none work
<MarshalAs(UnmanagedType.LPTStr)> Dim ptr As String
...and then in the actual function,
ptr = src_error(6) 'returns an error based on what combination of things I've tried
i want to read a character 1 by 1 from a string and a .txt, i know all about stream reader so for the .txt would it be somthing like:textbox1.text = tr.readCharacter.i would prefer to be able to read from a textbox or String array though.
I need validation for string to comply with next: no space char starts with one delimiter char ends with one delimiter char has no other char as delimiter char. Updated sorry missed that should only be one delimiter char at start and at the end
I have split a string into a char array, now i need to copy the char array to an int array with the ASCII values of each char.Donīt know how to do it without looping each value.
This is my code:
origen = RichTextBox1.Text.ToString Dim valor As Char() = origen.ToCharArray Dim numeros As Integer() = (How can i convert "valor" to an int array?????)
I'm working up a system where I plan on using RealProxy objects to enable intercepting method calls against a set of objects, handling the call, and then returning appropriate results. This works just find for simple return types like strings or ints, but I can't seem to return objects from the RealProxy.Invoke method. Everything works. I get no errors, but the returned value is always NOTHING, instead of an object.
I've worked up the smallest sample code I could, and have included it below. Essentially, just call RPtest and single step through. The code creates a simple object, RPTestA, with a string field and an object valued field It then retrieves the string
I have a textbox with value in it like: "577457747037375770" and so on, i want to XOR each value of them with "0x1b" how can i do that ?Like "0x1b" XOR 57 ; "0x1b" XOR 74 ; "0x1b" XOR 87 and so on for all value in textbox.I don't want to check if the value in the textbox is in the good format, i want just XOR them all.
I'm making a Visual Basic GUI application to display whether a number of my ports are open for people to know whether things like my website and my Minecraft server are open.My problem is I have absolutely no idea how to do this in Visual Basic.Basically, I'm asking for something which sends a signal to an IP with a specific port, if it is open then return true, if it's closed, return false. Similar to: http:[url]....
I have a DLL that I am importing:Declare Function QueryInfo Lib "mydllname" (ByVal DevName As String, ByVal pcQueryParam As String, ByVal Result As String, ByVal Length As Int32) As Int32
[Code]...
Anyone have an idea what the issue could be? If I run similar code in VB6 (only diff is mtStatus = String(mtValueSize, Chr$(0)) ) it returns what I expect.
First things first, sorry if this is in the wrong section and sorry if it has been answered many times before. I have no idea what to search for.
I have two integers and a char which is a maths operator (+ - / * ). What I would like to do is use the operator and pass the answer to another integer. Something along the lines of "Integer3 = Integer1 (Char) Integer2".
i have a C++ DLL. What i am doing is that i am passing memory address to my C++ dll where it write message on that address and i want to read the message from that memory address.
Here is my C++ function.
int _stdcall Test(int res, wchar_t *text)
Now in my C#.Net test app .. if i use unsafe char* .. i am getting proper output.
Declaration static extern unsafe int Test(char* msg); Implementation
[code].....
Now implementing in vb.net i am getting jst 1st character by using stringbuilder.
Dec Private Shared Function Test(ByVal msg As StringBuilder) As Integer Imp
I have built a DataTable from my database. Then I am looping through the rows and trying to access a string, however the value is being returned as each character in the string.
For Each theseRows In DisplayForm.MainTab.Rows If theseRows.Item("Last_Name") = userLast And theseRows.Item("First_Name") = userFirst Then
[Code]....
The Trap_Code values are two or three letter strings, the returned value is each letter once at a time. The loop seems to cycle through the individual characters of the string as an array rather than display the entire value, which is what I was hoping for.
Private Sub TbxInput_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TbxInput.KeyUp
[Code]...
Basically, what this code is supposed to do is compare the text inputted in the input textbox with the text of the string answerstring. It seems to successfully compare the two, but every time I type the first char into the input textbox the program crashes, givingmythe Out of Range Exception. I assume it means the Char() "array" thats built into vb is out of bounds, however as i've set the while loop so that it only is executed when the whilecount is less than both the length of the input textbox and the answerstring, I don't see how it could be out of bounds.
If checkboxList.Items(i).Selected Then .Fields("DESC1").Value += checkboxList.Items(i).Text + ", " End If
should produce output such as "A, B, C,(space)", which will then be bound to a dynamically created GridView. I would like to remove the last two-char string, that is ",(space)". How can I do this?
In .Net, given a char, is there a way to tell if that character is part of a specific Unicode category? The categories I'm interested are defined here http:[url]......For example, is there a function that does anything like this?:
I have a string of ASCII in HEX. ( 5A65726f)so first i split them into 2s >>>> 5A 65 72 6f then i change the hex to integer using these integer i convert them to char using chr() it did the job great, i can see the correct word i want..but it give me an error saying " make sure it has the right format" ( error shown below)
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim hexnum As String Dim converttohex As String Dim hextonum As Integer
[code]....
i thought it was the for loop problem...since i will go up to 7 while len(hexnum) is 8 so it would loop again but there is nothing after 8th HEX?so i tried For i = 1 To Len(hexnum)-1 Step 2 ...this time...textbox didnt show anything...+ the same error came up...
My application is reading in data from the serial port. The packet format uses 1 byte to tell the data length. The problem is as I am reading each byte in as a char when I try to get the value of the received character (using Asc(cRxd)) it only works up to values of 127, any bytes received that are over 127 are received as 63. I noticed that this was the default parity replace value, but I have parity.none set and I also changed the parity replace value. The received byte is always 63. I have tried reading the data using .ReadByte but this gives the same result - only works on values below 128.
I'm creating a program, and as part of it I'm storing a customer ID, which will be automatically generated using some form of combination of the customer's first name and surname? My thought so far has been to declare individual characters as Char and then put them together to automatically generate a customer ID? Problem being
How I can clear last char in textbox in c# when I press key like D0 (mean when I press D0 clear 0 in my textbox)? Or don't let me enter 0? You know I don't want user cant enter number in textbox .