Questions tagged [intptr]

IntPtr is a .NET Framework platform-specific type that is used to represent a pointer or a handle.

IntPtr is a .NET Framework platform-specific type that is used to represent a pointer or a handle.

296 questions
0
votes
0 answers

IntPtr to Bitmap AccessViolationException

I have two threads. One is copying the current video frame to a memory pointer list. The other thread is consuming the memory pointers as images and scanning for qr codes. I'm having trouble getting the sequence right. If I do the following minimal…
Sean
  • 51
  • 1
  • 4
0
votes
0 answers

C# Desktop graphics

I want to highlight the mouse cursor with a red dot, but the program only draws on 3/4 of the screen. If I move the cursor to the right side of the screen, the red dot disappears. Can anyone help me, how to "use" the whole screen?…
0
votes
0 answers

Get adress of 2d Array to IntPtr in C#

I have a c program that I want to reprogram in c#. In the C program, a function is used which accesses an address of a 2d array. Dll.h int Fg_AddMem(Fg_Struct * Fg, void *pBuffer, const size_t Size, const frameindex_t bufferIndex, dma_mem…
0
votes
1 answer

ZedGraph doesn't dispose emf file after create it

I have this code below: static internal bool SaveEnhMetafileToFile(Metafile mf, string fileName) { bool bResult = false; IntPtr hEMF; hEMF = mf.GetHenhmetafile(); // invalidates mf if (!hEMF.Equals(new IntPtr(0))) { …
Ștefan Blaga
  • 404
  • 1
  • 5
  • 22
0
votes
1 answer

srp6 IntPtr to BigInteger

I have a server program which uses SRP6 for it's encryption. To accomplish this it makes use of the OpenSSL LIBEAY32.dll. It uses the BN functions and IntPtr, however I am completely mystified as to what is actually going on inside the DLL function.…
Vqf5mG96cSTT
  • 2,561
  • 3
  • 22
  • 41
0
votes
1 answer

Get all icons from a folder system32. System.ArgumentException

I'm trying to get the icons of files and folders in the folder system32, but get "System.ArgumentException" in System.Drawing.dll on different files. I create a class: [StructLayout(LayoutKind.Sequential)] public struct SHFILEINFO { public…
DartAlex
  • 264
  • 1
  • 2
  • 9
0
votes
0 answers

Raw byte[] from Hanler Intptr Mplayer.exe netcat stream

Problem in getting the raw data from wid handler of a picturebox. This code display in picturebox1 the streamed video using netcat and mplayer for low latency use. How can I get images frame by frame to do some processing on the data? I need to get…
Jean
  • 53
  • 1
  • 5
0
votes
0 answers

CLS-Compliant method to dynamically free marshal'd memory for nested IntPtr(s) in generic struct in C#

I have seen some examples that use reflection to identify fields of structs, and set their value, etc. Is there a way to identify a field of a struct as an IntPtr within a helper function which frees the marshal'd memory which is also…
BackDoorNoBaby
  • 1,445
  • 2
  • 13
  • 20
0
votes
0 answers

IntPtr parameter is not valid bitmap GetHdc

I have a problem, and i don't know how resolved.. I'm using the drive twain to do scanner some documents, and i don't get create a new BitMap when i'm scanning a big number of the files.. So.. i need help to solution this.. my code is: public static…
ipakng
  • 11
  • 1
0
votes
1 answer

c# unmanaged PInvoke AccessViolation

I have C++ DLL. When call method from this DLL in C# AccessViolation was been throwing. What in my code is wrong? Can someone help me? C++ Header part: typedef PVOID X_HANDLE; XREADER_API BOOL ReaderOpen(X_HANDLE *pxHandle); XREADER_API BOOL…
user1576474
  • 554
  • 1
  • 5
  • 10
0
votes
0 answers

Reimplementing GetHashCode()

I'm writing a profile editor in Visual Studio 2015 for a game that was written in Unity. That means that my String.GetHashCode() and the games String.GetHashCode() are not the same. The idea that I have is to simply find the games method and then…
Karlovsky120
  • 6,212
  • 8
  • 41
  • 94
0
votes
1 answer

C# How would I intercept all packets and find out the IPs through hooking?

Actually I have three questions: 1- According to Nazar Grynko answer, Is it only intercepting the three functions(send , recv,and connect) will help me to anticipate all the packet in my machine? 2- If I hooked the three functions, How to get an…
0
votes
1 answer

Getting byte[] from GetClipboardData native method

I'm trying to get the Clipboard data using this native method with C#/.NET. The problem is I'm mangling the data. Here's my code: IntPtr pointer = GetClipboardData(dataformat); int size = Marshal.SizeOf(pointer); byte[] buff = new…
CODe
  • 2,253
  • 6
  • 36
  • 65
0
votes
0 answers

Free IntPtr to IntPtr

I have class called Parent : Class Parent { String Name; IntPtr Childs; // this pointer actual type is 'Array of Child' and it was storred as unmanned array int ChildsCount;// count of 'array of Child' } and Class Child : Class Child { …
Humam Helfawi
  • 19,566
  • 15
  • 85
  • 160
0
votes
2 answers

Moving window with SetWindowPos

I'm trying to move the window of the program I am building inside of unity. I'm getting it's handle via interating through all processes in Process.GetProcesses(). Then, I'm calling SetWindowPos, but nothing happens. Here's my code. internal static…
Charles
  • 548
  • 1
  • 7
  • 25