Does Specifying The OutAttribute On ByRef Internal Methods Currently Do Anything

Jul 19, 2011

VB.NET doesn't have out parameters, but you can specify <Out()> ByRef on COM and P/Invoke methods to get the same effect for external methods.

Does specifying the same on internal methods (i.e. methods only called by .NET code) actually help the Jitter (or VB.NET compiler)? Or is it currently only useful as a programmer note.

Is it possible it could be used in a future Jitter, or is this attribute lost when compiling?

View 1 Replies


ADVERTISEMENT

Compiler - External-only Properties Or Methods - From The Internal Namespace?

Nov 30, 2009

Is there a simple way in vb.net to mask a public property or method from the internal namespace? It would be helpful as a refactoring tool to isolate internal dependencies and perhaps to enforce a non-recursion policy for external services.

View 2 Replies

What Are Classes , Objects , A Namespace , Subroutines,functions,methods,properties And Difference Between Byval And Byref

Jun 26, 2010

I want to know what are classes , objects , a namespace , subroutines,functions,methods,properties and differemce betweem byval and byref in your words.

View 18 Replies

Forms :: Internal Dataset Or Internal XML File?

May 3, 2009

Is it possible to have an internal XML dataset within a VB 08 program I ask because we at present have the program load an external XML on startup, but i would prefer this to be internal withing the program to stop other editing the XML file.

View 6 Replies

Mvc - Repository Pattern Implements Methods By Adding Add1 But Should Use Methods Of The Baseclass?

Aug 29, 2011

This is the original code in c#

public class CategoryRepository: RepositoryBase<Category>, ICategoryRepository
{
public CategoryRepository(IDatabaseFactory databaseFactory)
: base(databaseFactory)

[Code]...

Does anyone has an idea what i should change to let it work and let my UserRepository use the methods in RepositoryBase while implementing the IUserRepository?

View 1 Replies

Cant See Available Methods List When Write Object.METHODS?

Jun 24, 2011

I am working with a vb program, but there is something strange on one of my .vb code pagewhen i put the "dot" afther the object name its dont show the methods availables for this objectbut on other vb code pages i can see it. but in this one no.for exmaplethis is a piece of code: Dim sb As New StringBuilder()

View 3 Replies

Making Class Methods Instead Of Instance Methods In .NET?

Mar 29, 2010

I am not sure how clear my question is by the title, but I am trying to make Class methods instead of Instance methods in Visual Basic that way I don't have to waste memory and code creating temporary objects to execute methods that don't need instance variables.

I am not sure if you can do that in VB but I know you can in Objective-C by using either a "+" or "-" sign in front of the method declaration. And in C++ (at least I think, I can't remember) you put the static keyword or const keyword in front of the function.How would I do this in VB if it is possible? Or should I just make a separate set of functions that are not members of a class?

View 2 Replies

Byref New Object - Top Pass New Object As "byref"?

Sep 7, 2009

Below I tried to do an Example:

[Code]...

Below is the called method: Friend Sub SplitOU2(ByVal inDN As String, ByRef OUDN As Object, ByRef Organisation As Object, ByRef VerksamhetTyp As Object) By doing this I can skip to declare the in this example "useless" variable Dim VerksamhetTyp as Object = "".

View 3 Replies

2 Different Methods Using Same Object Methods?

Aug 26, 2010

Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim someproc As Process

[Code]...

View 3 Replies

Use A Usb Or Internal Camera

Oct 11, 2011

I am starting a application that will need to use a usb or included device camera to capture images. I would like to know if there are any samples or examples on how to connect to the camera and capture images. This will be using vb or c# dotnet 4.0 on vista.

View 4 Replies

When To Use ByVal And ByRef

Nov 17, 2011

I am a student and i get confused when i see a lot of ByRef and ByVal arguments in a sub procedure. Can someone make it simple for me to understand when it should be used?

View 9 Replies

C# - Internal Relationship Between Properties?

Jul 21, 2011

My issue involves relationships and cascaded effects between properties, and I'm wondering what best practices are on this.I have a class that contains a list of varying length of numbers. When editing the list, sometimes the user prefer to set a TargetSum, so that the program enforces the list will always add to this sum. I am accomplishing this by programmatically setting the final element in the list such that list sum = TargetSum. For example, if the user chooses to UseTargetSum, then sets TargetSum = 10, then creates a list of length 4, and enters 1, 4, 2 for the first 3 elements, then the final element is programmatically fixed to 3. The user cannot change the final element themselves.

I do this behind the scenes by handling all necessary events, such as a list element value change, list length change, and the UseTargetSum option change. For each event trigger, it recalculates the last element's value.It works but then there was a bug when loading saved data. If a list is loaded by sequentially adding the elements, the handlers modify each entry. Regarding the example, when the first value of 1 is entered, the handlers say "a value was just added, the sum should be 10, there is currently only one element, so it needs to be 10". So the first element gets changed to 10 behind the scenes. When the second element is next added, the handlers say "a value of 4 was just added, but the first element is already 10, so it should be zero." At the end of the load, the final list reads 10,0,0,0 instead of 1,4,2,3.

I know it is possible to rearrange the load procedure such that I get the correct list. For instance, I could avoid enabling the TargetSum event handlers until after all the data is loaded. The list would first be created as 1,4,2,3 and then the handlers would change nothing.

But this experience makes me wonder if I am opening the door for other sneaky side effects. It seems you should be able to load data without worrying too much about an implicit ordering. It also seems unusual to have "cascading" effects between class properties. Is there a more accepted approach?

The other alternative I'm considering is to only enforce TargetSum only inside UI forms. Ie, when you know it's a user making the change, then enforce the TargetSum, but otherwise leave the core class logic alone.That way database loads, etc, are left unaffected. But I guess the downside of not having ubiquitous enforcement is that opens the door of incorrect sums via some unforeseen complication.

View 1 Replies

Internal Bit-by-bit Decimal Format

Apr 7, 2012

I'm using Visual Basic .Net 2010 Express.I know, for example, that the Visual Basic ( IEEE 754 ) Internal bit-by-bit Double Format is: Bit 63 = Sign, Bits 62-52 = 11-bit Exponent, and Bits 51-0 = 52-bit Fractional Significand.But, I can't seem to find any documentation on the Internal bit-by-bit Decimal Format.There also don't seem to be any workable mechanisms for accessing the bit structure or copying the bits to another Format for internal processing and returning the result to the Decimal Format.[code]to separate the ULongVariable into bytes for convenient manipulation. A similar reverse process allows moving the manipulated bits back into the Signed Long Variable.But, methods like << and >> are not extendable to Decimals per the Microsoft Documentation ( and I tried them anyway, and confirmed that they don't work ). Nor does there appear to be any way to copy the 128-bit Decimal into two 64-bit Unsigned Long Variables, or vice-versa.

I could, of course, forgo the use of Decimals and define my own MDJDecimal consisting of two ULongs, but that seems a bit of an overkill, and its methods would likely incur significant development time, and would probably also be rather excessively slow and cumbersome.I know I could write a workable routine in Visual C++ .Net using the Unmanaged Native Assembler, but I don't know enough about how to integrate that with Visual Basic .Net code, and I don't want to irrevocably tie what I'm developing to the Intel platform.I might also be able to write it in Managed Visual C++ .Net, but, again, I don't know enough about how to integrate that with Visual Basic .Net.

View 2 Replies

Internal Margins On TextBoxes

Jul 26, 2010

I have some forms that were VS2005 forms the I moved to VS2010. The forms have a tab control and on the tabcontrol are some panel containers. If I add a multi-line textbox toa panel I'm seeing the text offset from the left margin. If I make a form from scratch the margin does not appear.Any idea where this left margin is coming from?Is there a way to set the left internal margin in code?

View 9 Replies

Modify Internal Version Of An Exe?

Mar 9, 2012

I have several VB6 exe's/dll's that I have created, when I right click on the file and get the properties it says:

File version - 4.2.0.9

Product Version - 4.02.0009

Is it possible to change the File Version? I want this to say 4.2.9.123

I want to change this programmatically, so where is the file would I find these values? Are they at a specific location?

Is this going to cause an issue registering the exe/dll's with COM if I change the internal version?

View 2 Replies

.net - ByRef Vs ByVal Clarification?

Dec 8, 2010

I've read a lot on this, but am having a hard time thinking through this tonight. (Maybe it's the hydrocodone... just had a root canal. i'm just starting on a class to handle client connections to a TCP server. Here is the code I've written thus far:

[Code]...

Now, on my Socket property, when setting the value, it is required to be ByVal. It is my understanding that the instance in memory is copied, and this new instance is passed to value, and my code sets _Socket to reference this instance in memory. Yes?

If this is true, then I can't see why I would want to use properties for anything but native types. I'd imagine there can be quite a performance hit if copying class instances with lots of members. Also, for this code in particular, I'd imagine a copied socket instance wouldn't really work, but I haven't tested it yet.

View 3 Replies

.net - Using NMock With ByRef Parameters?

Apr 29, 2009

I have to work with an API that uses a lot of by-reference parameters. I'm just beginning to use NMock, and I'm having trouble seeing how to make NMock actually modify one of those by-ref parameters to a specific value. Am I missing something, or does it just not do that? Is there a better way, short of wrapping this API?

View 1 Replies

Asp.net - .Net, EventArgs, ByRef And ByVal?

Dec 15, 2011

In VB.Net, I have an object named WorkflowButtonEventArgs that inherits from System.EventArgs.The WorkflowButtonEventArgs class contains two ByRef Properties. These are objects that are in memory, and I do not want them duplicated or copied in any way.

Can I pass the WorkflowButtonEventArgs object ByVal in VB.Net and have it still preserve the two ByRef definitions in WorkflowButtonEventArgs?Specifically, if I pass it ByVal:

Dim e As New WorkflowButtonEventArgs e has some ByRef properties RaiseEvent SomeEventName(e) ' e is passed ByVal Will the ByRef Properties/Members in e (WorkflowButtonEventArgs class) not be copied or duplicated in memory?

Long-story-short: Can I pass e ByVal, or do I need to pass it ByRef since it contains ByRef Properties?

View 3 Replies

ByRef Not Carrying Through IN Program

Oct 20, 2011

The one calls form 2 as a dialog, and passed by ref a "pointer" to the base class(abstract).[code]...

View 2 Replies

Difference Between Byref And ByVal

May 4, 2010

[Code] What is the difference between ByRef and Byval in this function. When i call this function and debug it it shows no difference the two. Can any one explain me actually what happens.

View 8 Replies

Difference Between ByRef And ByVal?

Feb 20, 2009

ByRef (a.k.a. By Reference) points to where the object is in the memory. Any changes made to the object sent ByRef should change the values of the original object ByVal (a.k.a. By Value) points to a copy of the object. Any changes made to the object shouldn't change anything in the original object

Let's make an example:

Private Sub FormLoad()
Dim a As String = "A"
Dim b As String = "B"

[code]...

The second messagebox shows Baaaa - Buuuu instead of the expected A - Buuuu... but why is that? Apparently ByVal and ByRef does exactly the same thing. It seems like it sends the reference to the object when using ByVal, instead of making a new object.

View 2 Replies

Difference Between ByVal And ByRef

Mar 27, 2012

Whenever I'm going to use a new API, I have to decide for each value whether I'm going to use byval or byref. Can someone explain me in what scenarios I should use which and why? Because lacking this knowledge kinda gives me the feeling of having no control over my code.I am aware about the other threads by people asking the same question, I have read them but its still not crystal clear for me.

View 2 Replies

Difference Between ByVal And ByRef?

Jun 5, 2012

I have seen a few people in the past confused on the usage of ByRef & ByVal in a Function/Sub's Signature. I figured i would make a simple example that demonstrates the difference of each.

Option Strict On
Public Class Form1
Dim A As Integer = 100

[code]....

If you want something you've never had, you need to do something you've never done. If you believe something to be true, then one day you will be called upon to demonstrate that truth.

View 10 Replies

Is Not Necesary To Indicate ByVal / ByRef Any More?

Feb 9, 2012

I just installed Visual Studio 2010 Service pack (proposed on Windows Update), and I can see a new feature on the "intellisense" that means when I write a Function or Sub in VB.NET it doesn't auto-complete parameters with ByRef or ByVal...

1) Is there anyway that I can configure this option back to how it was before?

2) If I don't specify ByX, which one is used by default? (it seems like it is always ByRef)

View 2 Replies

Store ByRef In A Variable?

Jun 4, 2009

Just wondering if it's possible to store a reference to an object in a variable.

I will elaborate:

[Code]...

View 5 Replies

What Is The Difference Between ByVal And ByRef

Apr 10, 2009

What is the difference between ByVal and ByRef? Please remember to mark the replies as answers if they help and unmark them if they provide no help.Welcome to the All-In-One Code Framework!

View 5 Replies

.net - Internal Server Error (500) With HttpWebRequest

Jun 20, 2012

I'm trying to connect to a remote server (from our customer) via HttpWebRequest.GetResponse but at the login page i'm always getting an exception: "The remote server returned an error: (500) Internal Server Error." In the response stream i see that i was redirected to the error-page. The code worked so far(HTTP status 200) with the old ASP-website but they'll migrate to ASP.NET soon. There's no error if i browse to the URL manually. This is the (reduced) code:

[Code]...

View 1 Replies

Anyway To Step Into Yyy.dlll Internal Code?

Nov 10, 2009

In my project, a reference xxx.dll is added. I am going to step into the code inside xxx.dll, therefore I add the project into the existing solution.So far so good for the vb.net xxx.dll file.Suppose another COM Interop.yyy.dll will be added, is there anyway to step into the yyy.dlll internal code?

View 1 Replies

Back With A Small Project For Internal Use?

Jun 3, 2011

Its been a very long time since I don't show up here.Now I am back with a small project for internal use, but I need a little help.I want to make a program that allows me to change file attributes, like 'hidden', 'read-only' and 'system'.It seems pretty simple, but I want that multiple files can be modified at once. For this I would need a list that shows the files into the interface. There is what I can't get.

I first thought on a listbox, but there is also a listview which seems much more complete, but I just don't know how to use it. I was wondering if I could make something like: I open a folder, all the items inside that folder would be listed inside the listview.I learned a bit, but not enough. I've set the listview to 'details' mode, so I can actually list items. Also, I've added three collums: one for file name, other for file size and another for file attributes. I just need to learn now how they works.

View 3 Replies

Check Internal And External Duplicates?

Aug 24, 2009

Recently, I have a requirement to develop a vb.net application wherein the input excel sheet data which has an average of 5000 records should be checked for Internal duplicates (duplicates within the same sheet) and external duplicates (duplicates which exist outside this sheet). I have gone through lot of logics..some of which are ...

- Common and currently testing out..

- First insert the excel sheet data into DB..then query by following

select distinct id,mobilenumber from scrubmaster where calltablename=<calltablename given by the uploader>

Then loop for duplicates...

[code]....

The above logic works but it takes very long time..I have tried other logics from web but they "Query timeout"...

View 1 Replies







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