Continue On An Old Respond About System.IntPtr
Oct 18, 2010
The idea with System.IntPtr is to represent an integer whose width in bits correspond to the size of a pointer in the hardware and operating system that the CLR is running in, it's platform specific in other words. It supports 32-bit and 64-bit architectures only.This is a legacy from old-style C API's where pointers and ints were frequently treated as interchangeable. The Win32 API has many such parameters, where the width varies with the underlying architecture thus the mess with porting of code from 32-bit to 64-bit (we already did this once when going from 16-bit to 32-bit, funny how we never learn...).In practice, as is mentioned in other responses, it can be used to hold unmanaged resource handles and pointers etc that stem from the underlying Win32 functions. It can also be used to hold integers of the natural size for current platform. You can also use IntPtr.Size to dtermine the size of a pointer on the current platform.SO when you explain this to a child ;) this would be used to let program's flow at the same speed at diffrent kinds of operating systems?
View 1 Replies
ADVERTISEMENT
Nov 1, 2011
I am trying to setup a call back (delegate) in my code for the DirectSound.Notify so I will be called when the sound buffer reaches a certain postion druing play back. My Code is the following:
'Set up call back
Public Delegate Sub NotifyHandler()
'.....
Dim NotificationHandler As NotifyHandler
[code]....
View 2 Replies
Aug 10, 2010
I'm trying to get the window of a game (jedi academy) I keep getting this error Cannot convert type 'integer' to system.intrptr This is were its underlined in blue DirectCast(Me.hWndGame, IntPtr),
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.Runtime.InteropServices
[code]....
View 2 Replies
May 20, 2011
[Code]...
How do I convert this proper? (Option Strict On)
View 3 Replies
Jun 28, 2009
What is the equivalent of IntPtr of Vb.Net in Vb6? For example what'll be the equivalent of the following 2 lines in Vb6?
View 1 Replies
Aug 24, 2009
I see everywhere people use IntPtr, is there any reason I should use UIntPtr, instead?
View 2 Replies
Sep 24, 2010
How can I convert IntPtr to Int64?
vb
Convert.ToInt64(GetForegroundWindow())
error :Unable to cast object of type 'System.IntPtr' to type 'System.IConvertible'.
View 4 Replies
Jun 2, 2010
I have a function that I need to pass data to but the only type of data the function is allowed to accept as a parameter is IntPtr (yep you guessed it, Windows APIs). Would I be able to actually pass anything useful to it? In the case I'm looking at right now it would be a List(Of T) that I need to pass to the function? At the moment I'm resorting to just using a class level object that both the calling method and the function that accepts IntPtr can access, but I would like to negate the need for this if possible.
View 6 Replies
May 27, 2009
i am using SendMessage to send a message with a LPTSTR in WPARAM from a dll to my vb.net form and i get it by overriding WndProc but the problem is when using Marshal.PtrToStringAuto on the WPARAM it doesn't work, the strange thing is that if i monitor WM_SETTEXT of the form and use PtrToStringAuto to get the string from LPARAM it works, i guess mine doesn't work that's because the dll is loaded by other application.
C++ DLL Proc
Code:
LRESULT CALLBACK CallWndProc(int nCode,WPARAM wParam,LPARAM lParam)
{
[Code]...
View 6 Replies
Aug 2, 2011
This sounds like a silly question, and it may not even be possible, but say I have a MemoryStream in my code. Is it possible to get the IntPtr of said MemoryStream?
View 3 Replies
Jul 29, 2009
I need to get the address of an integer and assign it to an IntPtr to use in an API.[code]...
View 3 Replies
May 31, 2012
how to retrive the raw data of the image pointed by an intptr.The thing is the detector gives the pointer to the acquired image and I need to retrieve the image rawdata from the given intptr.
View 1 Replies
Nov 26, 2009
how I can convert an Integer of an object handle to an IntPtr?
View 2 Replies
Mar 23, 2010
I need to explicitly convert my byte array into IntPtr to pass it to the third-party api. I've been looking through Runtime.InteropServices namespace but didn't find anything suitable.
View 2 Replies
Oct 14, 2009
Always when i want to create a Executeable and i use the CodeDom Compiler i always get the Error:
The Type IntPtr is not defined
My Compiler Options:
options.ReferencedAssemblies.Add("System.dll")
[code].....
View 2 Replies
Jul 16, 2010
i need to save an array of intptrs as a part of a structure in a file, vb.net gives me "File I/O of a structure with field 'pList' of type 'IntPtr' is not valid." error, ok i figured and tried to convert them to integers and while it worked for other singular intptrs it did not for the array as it just throws me a conversion error. I then tried rebuilding the array in the new sub of the save structure and while that sorta worked(i think) it then gives a "bad size" error when saving. Im out of ideas, saving the array elements one by one would be suicide as the amount varies and is well in hundreds,
View 1 Replies
Jul 27, 2010
What is the proper way to use the Enter Key? I've triyed difrent things, now I can't get the Enter Key to respond at all, only a beep is what I get.[url]...
View 12 Replies
Oct 8, 2010
Objects whose Properties are observed for changes must implement the System.ComponentModel.INotifyPropertyChanged event to alert their WPF-element observers that a change has occurred.
If I have a Visual Basic Module whose Properties I wish to have observed by a WPF element, how should I go about routing the Properties of that Module through to the WPF, considering that Modules cannot, themselves, implement Interfaces?
EDIT: Modules are Static classes, for you C# readers, IIRC.
View 1 Replies
Jun 8, 2011
I have a datagrid and I want to delete selected row from that grid. It is working fine upto this. but I want to add some advance functioning with msgbox YES-No buttons. If user select some row and click on delete button, A msgbox with YES/No options appears. If user clicks YES, row should be deleted but if No is clicked then that row should not be deleted.
Below is the code:
view source
print?
Private Sub btnDeleteSitting_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeleteSitting.Click
MsgBox("Are you sure to DELETE?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "WARNING")
[code]....
View 2 Replies
Jan 13, 2011
I have a datagrid and I want to delete selected row from that grid. It is working fine upto this. but I want to add some advance functioning with msgbox YES-No buttons. If user select some row and click on delete button, A msgbox with YES/No options appears. If user clicks YES, row should be deleted but if No is clicked then that row should not be deleted.I have tried it many ways,
Below is the code:
Private Sub btnDeleteSitting_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeleteSitting.Click
[code]....
View 1 Replies
Jun 26, 2009
We're in a strange situation with a legacy winforms VB.NET 1.1 application using ASMX web services. Trying to send a user Token from a WindowsIdentity object as a parameter to a WebMethod. I will be adding a 'HACK: comment. System.Security.Principal.WindowsIdentity.GetCurrent().Token
The token is of type IntPtr, the first problem is the WSDL being generated doesn't support IntPtr with the error of 'unsupported type'I'm aware this is a big WTF question and sounds insecure, so any simple helpful alternatives are welcome but there are a lot of constraints on how we can change this system, including complications with the hosting environment. So I would just like to get our piece of data over to the web service to save a lot of other headaches.
[Code]...
View 1 Replies
Nov 23, 2010
How can I make buttons on a form to respond to keypress, keyup and keydown event?
View 3 Replies
Jun 16, 2011
I'm using VB.net to have a GUI on top of a commandline program.
[code]...
Which works and prints out all output from the commandline program. However at some point the commandline program ask for user interaction, eg: Type a number (1/2/3/4):But the commandline program stops after this. I suspect this is because it doesn't receive a valid option.Is there a way to capture when the commandline program wants user interaction and hold the reading of the stream to be able to enable the user to input something?
View 1 Replies
Feb 18, 2011
im trying to let my program respond to some audio commands i have downloaded the sdk an added references
and my program detects voice but doesnt respond to the command
Imports SpeechLib
Imports System.Speech
Imports System.Environment
Imports System.Speech.Recognition
[Code]...
View 10 Replies
Nov 24, 2011
I have a server making a head request to a database dump I've created. The remote server does this to make sure that it's not using excessive bandwidth when not necessary.However, due to some other circumstances outside my control this causes the script to be hit twice: once for the head request, and then another time to download the data.
What I'd like is to have the script I've written detect the head request, send back a couple of headers (e.g. last modified is right now, filesize different than before), and exit. Is there a way to do this?
View 1 Replies
Dec 26, 2011
I have a server making a head request to a database dump I've created. The remote server does this to make sure that it's not using excessive bandwidth when not necessary.However, due to some other circumstances outside my control this causes the script to be hit twice: once for the head request, and then another time to download the data.
View 1 Replies
Feb 18, 2010
I'm trying to making an auto-responding program for different Instant Messaging chat programs, like MSN or XFire.I don't know if it's possible to do this in Visual Basic. If not, feel free to post a solution in C# or C++ too.
View 3 Replies
Mar 10, 2011
I have a class, BaseSample, that uses another class, MainData, as one of its fields:
Protected _sampleData As MainData
Public Property SampleData() As MainData
Get
[code]....
MainData in turn has a collection of a class, ProcessData, as a field and ProcessData has a collection of a class, Measurement, as a field. I.e.:
MainData
|- IEnumerable (Of ProcessData)
|- IEnumerable (Of Measurement)
These classes are entities in a LINQ to SQL file. In the Measurement class, I raise the PropertyChanged event when the CrucibleOxidizedMass property changes:
Private Sub OnCrucibleOxidizedMassChanged()
RaiseEvent PropertyChanged(Me, New ComponentModel.PropertyChangedEventArgs("CrucibleOxidizedMass"))
End Sub
In the BaseSample class, I want to respond to the CrucibleOxidizedMass PropertyChanged event in any of the descendent Measurment instances. How would I do this?
View 1 Replies
Jan 21, 2011
I have a .NET class, InstrumentConnector, that has an event, StatusChanged. I want to create several instances of this class (each class handles a separate file) and respond when the StatusChanged event is raised any instance. How would I do this in .NET? Do I want to create a List(Of InstrumentConnector) or a similar IEnumerable? How do I write the event handler to respond to a particular instance's StatusChanged event?
Here is the InstrumentConnector class and the module with the StatusChanged handler:
Public Class InstrumentConnector
Private _inProcessDir As String
Private _doneDir As String
[Code].....
View 2 Replies
Feb 20, 2011
im a student Computer sciences and in my spare time i like to program using .NET no im stuck on a part with voice recognition i want to change the colour of my form using voice recognition my program does detect speech but doenst respond to the commands (i think the problem is with the grammar) i use Visual Studio 2010
[Code]...
View 8 Replies