[2008] Create A Pointer To A String?
Feb 3, 2009
I have just started to try to duplicate what I have done in Autohotkeys language.
What I need to do is point to a string variable - I will explain.
I'm reading from my own asci font files that contain big letters made up of characters, used for chat forums: EG.
[a_ch]
___oo___
__o__o__
_oooooo_
[Code]....
What I then want to say is a_ch=letter. But it is in a loop, so I can't do it directly. I want to point to lettername which contains the string of the variable name.
How can I point to the address of lettername?
In autohotkey language, it would be easy:
%lettername%:=letter
View 23 Replies
ADVERTISEMENT
Aug 28, 2010
I'm calling an API that returns a string pointer but I can't find anyway to return the string it points to.
Is it possible in VB.Net, I see VB6 had a STRPTR function but I can see a .net alternative.
View 3 Replies
Jul 15, 2010
I have an open source project I converted to vb.net. I solved all the errors, except for one. This is the C# line
[Code]....
View 4 Replies
Feb 10, 2010
In VB6 I have several child forms that have Subs and Controls with the same names.I need to access these Subs and Controls from public subs (in a module) that have a reference to the Active Form.[code]...
View 1 Replies
Nov 12, 2010
I'm by no means a good programmer and I'm just trying to wrap my head around some of this stuff, so please forgive me if this is a dumb question.I want the following to produce a message box that says "2", not "5":
Public Class SomeClass
Private SomeInt As Integer = 5
Private SomeListOfInts As New List(Of Integer)
[code].....
View 1 Replies
Mar 11, 2010
I have written my own function, which in C would be declared like this, using standard Win32 calling conventions:int Thing( char * command, char * buffer, int * BufSize);I have the following amount of VB figured out, which should import the dll and call this function, wrapping it up to make it easy to call Thing("CommandHere",GetDataBackHere).UPDATE:This code is now a working solution, as shown here:
Imports Microsoft.VisualBasic
Imports System.Runtime.InteropServices
Imports System
Imports System.Text
[Code]...
Updates: I got the code to build by following the help received here, and then I had forgot the As Return Type (which got me a MarshalDirectiveException PInvokeRestriction). Then I had an assertion failure inside my DLL, which lead to an SEHException. Once fixed, this works BEAUTIFULLY. There are newsgroups where people are saying this can not be done, that VB only loads managed dll assemblies (which I guess is the normal thing most VB users are used to).
View 2 Replies
Feb 2, 2010
I have been looking into delegates today, have come across them a few times but haven't understood them. I started thinking today that a Delegate is like a Pointer (for those who don't know a pointer is a reference to a location used in C++ and other languages than VB) So how much of a pointer is a delegate? what can a delegate do that a pointer/pointers cant?
Similarly does anyone else agree with me that all .NET languages should be able to do the same things, why cant i use pointers or logical shift operators in VB.NET? Would you guys think that being able to use code from any .net language within your code would be advantageous?
View 16 Replies
Dec 29, 2010
How can I declare pointer to pointer in ATL. Actually I have a handle which I want to pass by address to function. As shown below
STDMETHODIMP Function(HANDLE* hHC) //HANDLE declared as void * so actual type is void **
OR
STDMETHODIMP Function(LONG **hHC)
And want to access this function from the VB client.
View 1 Replies
Aug 31, 2010
What I want to do is either trivial, or likely impossible in the .NET framework.
I have a number of forms, with various pictureboxes, labels, etc. in each. Same names for the same items on each form. Only one form is visible at a time. What I need is some way to assign to a variable in the code which form is currently in use, such that I can reference the control on that form in a single statement.
That is, I have set up (already) references to the individual forms (call them frmForm1, frmForm2, etc.). So I can write to a textbox as:
frmForm1.textbox1.text="Hi there."
frmForm2.textbox1.text="Hello world."
What I need to be able to do is something like:
currentform = frmForm2
currentform.textbox1.text="Display on visible box"
Is such a thing even possible? Obviously, the way .Net normally wants to work is to verify everything at compile, and there is (of course) no way for it to know if whatever "currentform" points to even has a "textbox1" control.
save me a LOT of long-winded IF-THEN-ELSE to see which form is currently displayed for each and every time I want to display something. [FWIW, I *could* right everything out to every form, but I feel that would waste to much CPU time.]
View 6 Replies
Jul 21, 2009
Is there a code in which the software scans the screen and point a specified color out of that scan and mark it.
View 1 Replies
Jan 31, 2011
I have a main form "Parent" and another "child" form. When I am filling a textbox in the child form the mouse pointer disappears. Then I hit the tab key to jump to a combobox. At this time when I move the mouse, the pointer doesn't come up until I click the mouse button. This is annoying and the user of my program doesn't like it. How can I keep the mouse pointer always on top. NOte: although the main form has the parent property as true, the other child form are not defined as child forms.
View 2 Replies
Aug 6, 2009
I want to make a small application for my web designing needs that will display the color of the current pixel under the mouse pointer. I need this to work on the entire screen (no matter what form/application is in focus) and it needs to update in real time.
I'm not worried about the math or working with coordinates, but I don't know (and can't find) anything that might get the color of the pixel under the cursor on any form. I've found a small number of VB6 examples, but I'm with .NET 2008. Does anyone know of a method or anything (DLL even >.<)
View 1 Replies
Oct 5, 2010
I have a string array that represents the field names for a table I need to create. Given that the first field type is date, the second is time, and the rest are floats, what is the easiest way to create the table? I am currently using the following code, but it seems there may be a simpler, less convoluted way
vb
'read the column names from the OPC server
Dim colNames() As String = GetFileColumnNames().Split(","c)
'build command string used to create the table
[code]....
View 6 Replies
Jul 22, 2009
I have filled a DataSet from a SQL Server table and I have also set up synchronisation with a local copy (for offline use). The local copy is saved to a SQL Compact Editon database file.
1. Create the connection string to the SQLCE DB
2. Execute a stored procedure (a copy resides in the DataSet) against the SQLCE database
View 2 Replies
Apr 9, 2010
I had a look through this forum and other forums but couldn't find what I was looking for. I am new to visual basic and have spent all day trying to find the solution to the following issue.I am creating objects from a class that store information about the user of the program. Each time a user signs up the program, I need the code to create a new instance of the class, creating an object and storing information about that user. The contents of this object will then be saved into a text file.
[Code]...
View 3 Replies
Apr 16, 2009
I would like to ask for some on how to create a random string with number and letters in 8 characters long in VB 2008
View 1 Replies
Oct 12, 2009
I am trying to create a procedure which will evaluate a string expression as if it were a line of code...Kind of like what a graphing calculator does when you enter a formula. Does anyone have any experience with this in VB? I have an example of C++ code which uses CodeDom, but I am a bit rusty with my C++!
View 4 Replies
Mar 28, 2009
I'm using vb2008 Is that possible to change the pointer from left to right to right to left in the TextBox.
View 4 Replies
Feb 28, 2010
Problem: Your task is to take input from the user in string and give the following options to the user in a menu.
1- Find a String
2- Create sub-string
3- Erase a portion of a sting
4- Replace a word in the string
5- Count number of words and characters in the string without spaces.
6- Capitalize first character of each new sentence and convert the rest
of the characters to lower case.
7- Sort all the words in alphabetical order. (Use Bubble sort algorithm to perform sorting).
To perform all the above mentioned tasks you can only use pointers. Create a function to perform every task.
View 1 Replies
Jan 7, 2011
In my VB project I need to create a unique string of alphanumeric characters 4 in length from a numeric string 8 in length.This numeric string will always be 8 in length and could range from 00000001 through to 99999999
View 12 Replies
Feb 4, 2012
I was trying to call a method using Reflection on a method that has a STRING parameter.However a STRING does not have a parameterless constructor.So instead of something like.>>
Option Strict On
Option Explicit On
Option Infer Off
Public Class Form1
[code].....
View 15 Replies
May 1, 2010
I understand there are no pointers in VB.Net. I need to use something similar.The issue is that I have a structure that represent a deck of cards, with elements showing how many of each type of card there is. So I have my_deck.ace, my_deck.two, and so on.What I want to do is set a pointer called current_element that refers to any element in the structure. It may one time point to my_deck.three, and another time to my_deck.nine, and so on. It could point to any element.What I want to do is, for instance to set current_element to point to my_deck.ace, then decrementing current_element would reduce the count of aces by one.[code]that would work, but it's inelegant, I have about 30 different operations to perform, some of them using several lines of code. I'd like to avoid this if at all possible. I could tolerate doing it 2 or 3 times, but not 30.
View 8 Replies
Oct 11, 2009
I need to change the default windows pointer to this: not generally, just in my program. (Form1) There's a Pointer Control But I Dont Know What That Does.
View 7 Replies
Dec 10, 2009
I've got a 3rd party C application that's compiled to a non-.NET non-COM DLL. It has one simple function declared like so: Declare Function CapiTaxRoutine Lib "taxcommono.dll" (ByVal sInData As String, ByVal OutputData As String, ByVal intINPutLength As Long) As Integer
If I place the taxcommono.dll in my path (C:WindowsSystem32 is what I'm using because it's what the vendor recommends),I can wire up a call to the function and it works just fine.It returns a 1 or 0 for success/failure, but it also sets the value of the OutputData string parameter (using some C pointer magic I'm not familiar with) to a huge fixed width format return record that has the data I need.When I call it from a .NET .exe application, it works just fine.When I try to call it from an ASP.NET application via a referenced compiled .NET wrapper DLL, it runs but can't set that string.In order to get it to run, I can't have taxcommono.dll in my path, but rather have to place it in my Bin directory of the web project.Does anyone know of a reason it can set the pointer when called from an .exe application but not when called from a web app?The .NET wrapper DLL I'm using works when called from our ERP software, which is not web based. But when I add a reference to that same DLL in the web app, it won't give me that output value.am used to just getting a return value instead of a function setting the value of one of my input parameters.
View 1 Replies
Mar 30, 2009
im in a project using drag and drop events and.. , when i drag a label image, i need to change te cursor pointer from an image that is on a labelike the SO windows when you drag a file appears like a mirror with alfa minimun so its like the image but more transparent when i drag i need to change the cursor pointer from an image that i'm dragging by the way im, using visual studio .net and im programming in visual basic
View 6 Replies
Nov 5, 2011
Public Class Form1 Public Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As IntPtr Public Declare Function GetProcAddress Lib "kernel32" Alias "GetProcAddress" (ByVal hModule As IntPtr, ByVal lpProcName As String) As IntPtr
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim hmod As IntPtr = GetModuleHandle(Nothing) 'Work Dim addrs As IntPtr = GetProcAddress(hmod , "TestFunction") 'Not work, always NULL why??
View 3 Replies
Feb 20, 2012
How do I change my mouse cursor/icon to use a image or icon. I want to make a simple "wack a mole" type game but I dont know how to change the pointer to a icon or at least get a image to follow the pointer.
View 7 Replies
Feb 23, 2010
I have a form that has 100 text boxes with 100 coinciding labels. I want them hidden until another function populates the text boxes with data gathered elsewhere. The data could be between 1 and 100.
I would like one loop where I can assign the data to the correct text box, set it visible and set the label visible. I can not figure out how to do this in VB, or know if it is even possible.
Here is an example of what I would like to do
Dim i As Long = 1
Dim textbox As String = "textbox"
[code]....
I would also like to do this to hide all the items on the form in the on load event.
View 16 Replies
Sep 28, 2010
Private Declare Function src_simple Lib "libsamplerate.dll" (ByVal data As IntPtr, ByVal converter_type As Integer, ByVal channels As Integer) As Integer<br/>
Private Declare Function src_strerror Lib "libsamplerate.dll" (ByVal err As Integer) As IntPtr<br/>
<br/>
<StructLayout(LayoutKind.Sequential, Pack:=1)> _
[code]....
View 1 Replies
Jan 4, 2012
I'm trying to rewrite a C++ library. But I have an issue. I'm not extremely pointer-savvy. In the C++ class there is a std::vector that holds unsigned int pointers (vector<unsigned int*>), and the int pointer just points to an array of integer data.
Here is the C++ code I'm a bit unsure about:
unsigned int* relocation = m_relocations.front();
m_relocations.pop();
unsigned int* reloc = *(unsigned int **)relocation;
View 3 Replies