C# - What Is Point Of Using GC.AddMemoryPressure With An Unmanaged Resource

Jul 19, 2009

I've read about this issue on MSDN and on CLR via c#.Imagine we have a 2Mb unmanaged HBITMAP allocated and a 8 bytes managed bitmap pointing to it. What's the point of telling the GC about it with AddMemoryPressure if it is never going to be able to make anything about the object, as it is allocated as unmanaged resource, thus, not susceptible to garbage collections?

View 3 Replies


ADVERTISEMENT

VS 2008 Set A Point Without Setting Point.x And Point.y Separately

Jun 4, 2009

I hve been working with points a lot recently, and I have been wondering if there is a way to set a point without setting point.x and point.y separately. For example for (3, 5): Point1 = (3, 5) But that isn't right

View 4 Replies

Finding A Point On A Diagonal Line When Have The Start Point And End Point Of The Line?

Feb 14, 2011

I have a Diagonal line drawn on a picture box on my forum and i need to know if the user has clicked the line I have the Start point and End Point of the Line and the mouse x,y location So i basically need to find out if the x,y of the mouse is on the line.

View 2 Replies

VS 2010 : Search For Text Within A String (Starting Point And Ending Point)?

Dec 31, 2010

I'm trying to extract a piece of text from within the string, defining both a starting point and an ending point. For instance, say I want to search for the text found between "That is a " and " car" in the string "That is a red car", so it would return "red".I know you can use .SelectionStart and SelectionLength, but the length of the word can change, so the selection length can vary. What I want is to establish a specific starting point and a specific ending point from which to extract the text from the string.

View 5 Replies

VS 2010 Loop In A Variable And Grab Info From Point A To Point B?

May 24, 2010

I want to know if its possible to loop in a variable and grab info from point a to point b

This is what I have stored in my Variable

PHP
</div> <!-- div reviews end white-space:nowrap; margin-bottom:5px; class="reviews" -->
<div class="list_address">

[Code].....

View 11 Replies

Add Point And Delete Point When The User Clicks The Picture?

Jul 29, 2009

i have a picturebox which displays a map i have 2 modes add point and delete point when the user clicks the picture it creates a point on the picture where the user has clicked that works perfectly its when i try and delete the point when it doesent work :/ i have all the points loading from an xml file this is the code i have:

[Code]...

basicly i want it to when the user clicks the point it fines the x any y in the xml delete the node then delete all the points on the map then reload them all according to the xml

View 9 Replies

Calculating Point-to-point Directions On A 2-D Grid?

Mar 11, 2012

I'm trying to calculate the direction between two points on a two-dimensional grid. Actually I want to determine if that vector is within a range of two values. Suppose the grid's origin is 0,0 at the upper left corner, and 0 degrees represents north. I have a point A on that grid. I want to know if a line from point A to point B on the grid is within a range of directions between 111.8 degrees (a little south of east) and 158.2 (a little east of south). Those are approximations; the 111.8 is 90 degrees plus the arctangent of 2/5, and 158.2 is 180 minus that value. I worked out a series of calculations worthy of a medieval astronomer, but I suspect there is a simpler way. I'm going to have to do this for a variety of other vectors, and I'd like to generalize

View 4 Replies

Construct An Icon Setting Point By Point

Feb 20, 2010

I know how I can construct an icon setting point by point, but that isn't what I want. I want to use a bitmap file or a jpeg -is easy to convert an jpeg to an bitmap- and built an icon that looks like this picture.

View 2 Replies

Draw Arc From Start Point, End Point And Radius?

Jan 17, 2009

I want to make a drawing application which needs a few drawing functions I cant handle myself as im not very mathematicly inclined The first on the list of functions is to create an arc from a start point, end point and radius. The method signature is as followes.

Function CreateArc(byval StartPoint as PointF, EndPoint as PointF, Raduis as single) As PointF()
'Code to create an array of points...

[Code]....

View 1 Replies

Finding Resource ID Or Index Of A String/icon Resource?

Mar 4, 2010

I need to refer to some strings using an "indirect string" in the registry. It should be in this form:

@filename,resource

MSDN: "If the resource value is zero or greater, the number becomes the index of the string in the binary file. If the number is negative, it becomes a resource ID."How can I find out either of these numbers for my resources that only have names in VB? I also need the ID/index for the exe's icon.

View 2 Replies

Draw Line From One Point To Another Point?

Apr 10, 2012

I have a DataGridView that will occasionally have a RowError icon displayed in the RowHeader (shown below)I have code that displays a small form when the users mouse moves over the row header or clicks the row header.I would like to draw aline from the top-left of the form to the middle-right of the row header.I basically want to point from the form to the error icon.

View 1 Replies

Move From Point A To Point B Along An Angle?

Mar 14, 2009

I need to move an ellipse from a known point on the screen to another known point on the screen.

I've tried using For.....Loops with less than desired results.

I can't remember everything I've tried, a lot of trial and error has been layed to waste. Lol

I've ended up with this code after putting together what I've tried, what I've learned elsewhere, and a couple of posts I've read on here.

All I want to do is move the ellipse from one point to the other along a straight line that forms the angle between the two points (X1,Y1) and (X2,Y2), make it grow from 2 pixels at it's start, to about 80 pixels by the time it reaches half way, then shrink from 80 pixels back down to 2 pixels by the time it reaches the point (X2,Y2).

Easier said than done.

Here's what I have at the present.....

Dim W As Integer
Dim H As Integer
Dim Num As Integer

[Code].....

....This seems like such a simple task, yet it's been a week since I came up with the idea, and I've had little success.

View 6 Replies

Moving From Point (200, 100) To Point (300, 400) Repeatedly?

May 9, 2010

come out with the codes for moving the mouse pointer from point (200, 100) to point (300, 400), repeatedly. Using VB 2008.

View 8 Replies

Scrape HTML, From Point A To Point B?

Jul 28, 2010

I looked around the forum can't find something really simple.I want to scrape everything between the

<!-- google_ad_section_start -->
to
<div class="ad_editorial-sponsorship"></div>

copy it and use it right after it's website and I navigate using webbrowser1.

View 12 Replies

(GAME)rotate Image Facing Mouse Cursor, Move Image From Point A To Point B?

Jun 21, 2010

i want to work on a shooting game,and i already have a code for the rotation of the image but i have a few problemFirst problem(for the tank /ship): i want the image to AUTOMATICALLY rotate facing the mouse cursor,i know how to rotate but but i dont know how to convert the location of the mouse to an angle that the image will face,,

View 1 Replies

Resource File / - Separate Resource DLL ?

Feb 5, 2010

I have a resource file that I include in my shared code library that has all of my re-usable classes in it (all the resources go into their own namespace). Now, what is the best practice regarding resources... should I include them in the same DLL, or should I have a seperate resource DLL and/or are there any benefits from seperating them out into their own file.

View 8 Replies

Use Unmanaged C++ Dll In .net?

Jan 8, 2010

i need to pass commands through a C++ dll to vb.net and the other way around. is there some code that needs to be in the C++ dll to make it work? im not good at C++ at all,

View 5 Replies

Any Method Into Unmanaged Lua?

Oct 9, 2010

im trying to make a simple wrapper for lua. The only problem so far is that lua only accepts a method in a specific format.Delegate Function LuaC Function(ByVal lua_state As IntPtr) As Integer..That is how lua wants the method to look like. So it only accepts a function that looks like this: [code]

View 2 Replies

Use Dll In Unmanaged C++ Project?

Jan 5, 2010

I created a vb.net dll called "WSdll.dll".I compiled it, created a type library (tlb), and registered it globally(gacutil)..It includes a file called wsutils.vb, which includes a namespace called "wsutils".In the namespace, there's an interface (with attribute) called "IWSconnection", and a class called "WSconnection".The interface and class are public, as are all methods and properties.[code]...

View 2 Replies

.net - Load An Unmanaged DLL From A Stream?

May 18, 2012

I have an application written in .NET 4.0 that needs to load in memory a native DLL (written C). At the moment I am using a P/Invoke call to LoadLibrary passing the path where the DLL is located. This works, but due to the fact that this DLL comes from a DB, I would like to know if it is possible loading it through a stream, avoiding then the necessity to store the DLL somewhere in the filesystem.

View 2 Replies

Allow Calls From Unmanaged Code?

May 5, 2009

I have an application which has been succesfully installed on a number of different client machines.

The problem I now have is that I have been asked to allow third party applications, possibly written in a non .net language set to plug into my application and execute some of the code. Just a handfull of properties and half a dozen methods.

Now I can wrap up these properties/methods, make them public and have them in their own project which will be part of my solution but I have no idea where to go from here.

How do I make this portion of my application accessible to a third party application written in unmanaged code ?

View 1 Replies

C# - ASP.NET Load Unmanaged Dll From Bin Folder

May 25, 2010

Question: I use an embedded Firebird database in ASP.NET.

Now, Firebird has a .NET wrapper around native dlls.

The problem is, with the ASP.NET compilation and execution process, the dlls get shadow copied to a temporary folder. Unfortunately, only the .NET dlls, and not the native dll.

See [URL] for details.

Now, this makes it necessary to put the unmanaged dll somewhere into the system32 directory (or any other directory in the path environment variable).

Now, I want to change the wrapper/native dll (opensource), so it loads the dlls also if they are only in the bin folder.

Now, my problem is, how can I, in .NET, load an unmanaged dll from an absolute path ? The absolute path is determined at runtime, not at compile-time...

View 2 Replies

Call Function From An Unmanaged DLL?

Feb 17, 2010

I have an unmanaged DLL and need to call one of its functions. Here's the [code]...

View 5 Replies

Connect An Unmanaged DirectX To .NET?

Sep 20, 2009

Maybe this is not true ... But how to connect an unmanaged DirectX to VB.NET? For anyone dll I use <DllImport()>, but Unmaged DirectX have interface.... Than I tried use "<ComImport(), Guid(...)...>", but I do not know how to use COM interfaces Maybe I did not really understand COM technolgy... I tried find documentation "how to use com interfaces", but found nothing.

View 1 Replies

Function Calls To Unmanaged DLL From VB

Jun 12, 2009

I'm having some trouble finding the syntax for making function calls to unmanaged DLLs in VB.NET. Let's just assume there's a function "Connected" in unmanaged DLL "Connector.DLL". I want to call this function by creating an abstract function call to it.

I've seen some code out there that looks something like
[DllImport("Connector.DLL")]
Public Shared Function Connect(ByVal intPort)
But that syntax doesn't work for me.

View 2 Replies

Passing Parameters To Unmanaged C Api

Mar 3, 2010

I need to call a function in an unmanaged .dll written in C lang from vb.net. The function declaration looks like this [code]Now the behavior of this function is that it copies some data in argument "reply" and returns a numeric value which signals its pass/fail status. How do i pass it a string object so that it can copy data. Following is how i access this function.[code]When the call completes, returned status is absolutely fine but there is nothing in string "str". What is it that i am missing. I'm not sure about the string object that i am passing as argument.

View 3 Replies

Passing Parameters To Unmanaged C Api?

Mar 3, 2010

I need to call a function in an unmanaged .dll written in C lang from vb.net. The function declaration looks like thisLONG _stdcall ReadInfo(char *reply);Now the behavior of this function is that it copies some data in argument "reply" and returns a numeric value which signals its pass/fail status. How do i pass it a string object so that it can copy data.Following is how i access this function.

View 2 Replies

Vb6 - Passing A Structure To Unmanaged Dll?

Feb 22, 2011

I'm migrating some VB6 code to VB.net,the code contains a structure that contains 1d arrays, 2d arrays, and few other variables.The general outline of the Vb.net structure is as under

[code]...

The call to the dll is declared as under Public Declare Sub getState Lib "val.dll" (ByRef state As Test)Elsewhere on this site I realized that we have to "marshal" the structure to allow it to be compatible with the unmanaged code that is about to accept it.However I still receiving runtime errors when running the code, I don't have any clue of how to use the System.Runtime.InteropServices.Marshal class.What would be the correct way to pass this structure to the dll?EDIT: The original VB6 data type is

[code]...

View 1 Replies

Icons From Resource File - Use Files Inside Of Resource File In Apps?

Feb 26, 2011

So i created resource file New --> new file --> Native Resource Template Then added icons with custom id, like "x", "u_100", .. so i understand, what the files (in my case icons) is.. And i saved as 32-bit resource file (*.res) So i have a question, how can i use these files inside of resource file in my apps? i know how to add icons in to my app.. Me.Icon = New Icon(C:/icon.ico)

View 6 Replies

Calculate The Width Of That Triangle At 1/3 Of The Distance From The Point + 2/3 Of The Distance From The Point?

Mar 30, 2012

assuming i have an isoceles triangle, where i know the height + base width, how

can i calculate the width of that triangle at 1/3 of the distance from the point + 2/3 of the distance from the point?

i thought it'd be simply 1/3 base width + 2/3 base width, but my drawing is +/- a few pixels when i resize it?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved