Structure Being 'Exposed'?

Aug 5, 2010

In my project I have a module called Functions where I have all my functions, suprisingly. I also have in there a few structures that I have made.One of those structures is called Point3D which is just used for storing x,y and z values.It looks like this:

Module Functions
'...More stuff in here...
Public Structure Point3D[code]....

However, apparently I am exposing type 'Functions.Point3D' outside the project through class 'EditBuildings'.But I dont get it because the structure is public the class is public and the constructor is public. If I make the constructor private then I can use it, but then I cant access the constructor from other forms.

View 1 Replies


ADVERTISEMENT

Get Around Non-exposed MouseClick Event?

Apr 28, 2009

I have an ActiveX component (for mapping) I am using that I need to do an action on a mouse click, but the event isn't exposed. Internally, the class seems to fire an event, as it has a LastPointClicked() method that you can call that returns the map coordinates of the last point you clicked on. I am trying to find a way to center the map on the point clicked. I could fudge it with some kind of timer that just checks to see if the LastPointClicked has changed and center if it did,

View 2 Replies

Method For Threading In A COM Exposed Assembly?

Jan 5, 2011

First let me say: I am still very inexperienced with VB.NET so there is probably something simple I am missing, or at least that's what I'm hoping. I've been writing a COM exposed wrapper class to provide access to a web service in a legacy VB6 application. I got everything pretty much working as I wanted - all the COM properties, methods and events are showing up in the VB6 app - but for one minor detail: when I used a method which made a call to the service, it was obviously only working asynchronously, so I couldn't update a progress bar or do anything else while waiting for a corresponding assembly event to fire.

[Code]...

View 2 Replies

Call WPF Application And Modify Exposed Properties?

May 25, 2010

I have a WPF Keyboard Application, it is developed in such a way that an application could call it and modify its properties to adapt the Keyboard to do what it needs to. Right now I have a file *.Keys.Set which tells the application (on open) to style itself according to that new style. I know this file could be passed as a command line argument into the application. [code]...

View 1 Replies

Raising Events In A Class Library Exposed To COM?

Dec 20, 2010

I'm trying to write a wrapper to a service, which will be used by an existing VB6 project. I've got most of the basic framework working, except for one important aspect: I can reference the wrapper in a VB6 project and subs/function calls etc. work as expected, but events do not. The events are visible in the VB6 app, but they never fire.

VB.NET Code:

Public Event Action_Response(ByVal Status as String)
Public Function TestEvent()
RaiseEvent Action_Response("Test Done")

[Code]....

So, the cmdTest button code prints 'Done' as expected, but the Action_Response event doesn't fire. Is there something else do I need to do to get the event to fire?

View 1 Replies

Audio Components Are Exposed By The .net Framework - Work With .wav Files?

Aug 18, 2010

About what audio components are exposed by the .net framework?

Can I work with .wav files? What kind of things can I do with .wav files as far as vb .net is concerned? Can I record? What should I look for when looking for info for .net related audio at msdn. Where else can I find info on this?

View 3 Replies

Limit The Default Events, Properties And Methods Exposed From A UserControl?

May 11, 2010

limit the default events, properties and methods exposed from a UserControl so it only displays to the developer the new events etc that I code myself.What i mean is I have created a UserControl with a panel and 5 buttons, written 1 Public Eventonly at this stage, I have placed an instance of the control on a form in a new project, but in the drop down menu that comes up after say (myUserControl1.), there is a massive list of options, I don't want those to appear.

View 3 Replies

Structure Inside Another Structure Receives Null Reference Error?

Jan 5, 2012

Module Module1
Public Structure structure1
Public TRANS() As structure2
End Structure
Public Structure structure2
Public X() As Integer
End Structure
End Module

View 17 Replies

Class Structure - Large Structure That Has Lots Of Properties ?

Jan 5, 2010

I'm new to VB 2008 after having spent a long time with VB6, so I apologize if this is a stupid question. But I'd really like to have this straightened out.

Let's say I have a pretty large structure that has lots of properties.

Code:

Now say that I want an internal database with about 10 instances of this structure total, describing, say, 10 different products that a store sells. When these values are loaded from a database, they remain totally static. (However, they can be different each time a program loads)

Now say that I have a class. Each instance of this class is a type of that BaseProduct structure. Meaning, each instance of the class pertains to one of the 10 types of products that the store sells. However, this class has additional properties that pertain specifically to each instance, which are not static.

Code:

Now, the problem here is... If I have 200 different transactions, each one contains an instance of BaseProduct. BaseProduct is HUGE, and is largely redundant (only 10 types possible), so I think it's a little silly to include a whole copy of it with EVERY transaction. However, the Transaction class really needs information regarding the base product it pertains to. Is there a way to, instead of declaring a New BaseProduct in the Transaction class, to simply make one of the properties of the Transaction class a pointer to a BaseProduct variable?

In VB6, I would accomplish this by making a BaseProduct(10) array, and then giving each Transaction an ID number referring to an entry in that array. But in VB 2008, using class structure, this is impossible. I can't define the BaseProduct(10) array outside of a class in a namespace, and if I define it in the actual application's form, then the class loses modularity since it relies on the application that's using it.

View 11 Replies

Converting Structure Within Structure To Byte Array For Socket

Aug 29, 2009

I am trying to communicate with an external device and i am trying to send a byte array to the external device via sockets but i am always getting a response the message size is too small so i am not sure what i have done wrong. Between the data type there should be no alignment present and all numbers are represented in little endian format. The char array is not null terminated as mentioned in the protocol specifications.

I have to send data based on a struct that embeds 2 other struct. So here's my vb.net code for the struct used to convert to byte array and the sending part.

Public Structure MESSAGETYPE_OIP_Login
Dim Header() As COMMANDHEADER
Dim UserName() As PSTRING

[Code]....

View 2 Replies

Invalid Structure Size When Marshalling C Structure To .NET

Apr 14, 2012

I'm experiencing a problem with the following c-structure:

typedef struct tagTEXTUREPROP
{
DWORD dwSize;

[Code].....

The Marshal.SizeOf obviously calculates a size of 76 and it works with the DLL function, but it leaves me with some bad feelings.

View 1 Replies

VS 2008 Convert The XML Structure Into A Class Structure?

Apr 25, 2010

I'm having a problem that's driving me crazy; I can't understand how to convert the XML structure into a class structure (that I want to use to hydrate a XML document).

The XML document looks like this:

xml
<?xml version="1.0" encoding="utf-8"?>
<artists xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.spotify.com/ns/music/1">

[code]....

View 2 Replies

Arraylist Of Structure Within Array Of Structure?

May 23, 2010

I want to make a structure within a structure. Basically it will appear like this:

Structure ID
dim CardType as string
im CardCode as string

[code]......

View 13 Replies

Assign Array Of Structure To Another Of Same Structure?

Oct 12, 2010

In Vb.net I am trying to assign an array of structure to another array of same structure[code]...

View 2 Replies

Structure With A Structure Array?

Sep 12, 2011

I have two structrures

Public Structure PhoneScheduleEntries
Dim Count As UInteger
Dim PhoneSchedule() As PhoneScheduleEntry
End Structure

View 3 Replies

How To Add To A Structure

Jun 11, 2010

I have created a public structure:

Public Structure LogicalEdge
Dim sTypeEdge As String
Dim dTotalLengthOfLines As Double
Dim lstLinesInEdge As List(Of Line)
End Structure

In my code, I create a new list of this LogicalEdge:

Dim myListOfEdges As List(Of LogicalEdge) = New List(Of LogicalEdge)

After, I create a new LogicalEdgecontainer:

LogicalEdge = New LogicalEdge

I set one of it's properties:

LogicalEdge.sTypeEdge = "endcap"

Now, I add it to the list

myListOfEdges.Add(LogicalEdge)

After looping a few times, i want to set one of the other propterties for the same item in my LogicalEdge, but when i do this:

LogicalEdge.dTotalLengthOfLines = 80.77

To look at the values in the collection, I loop through myListOfEdges collection; and I see that dTotalLengthOfLines doesn't pick up the value i have assigned to it. i thought I might need to identify which item in myListOfEdges to add it to... so i tried this:

LogicalEdge = myListOfEdges.Item(i)
LogicalEdge.dTotalLengthOfLines = 80.77

But that didn't work either.

View 2 Replies

.net - Opposite To A Structure?

Jun 29, 2011

I'm sure there is an answer to this somewhere but I'm clearly using the wrong terminology in my searches, so I apologise in advance for this inevitably being a duplicate.Take the function CType. Clearly I can cast (or at least try) a given object to a given reference type. The function will not work if trying to cast to a structure, i.e.CType(myObject, Integer)

will generate a compiler error. This I'm sure most often crops up when working with generics:

[Code]...

What is the opposite? I want only reference types so that CType doesn't fail. I can't overload the T As Structure with a plain T because it considers them identical signatures, so surely there's a keyword I'm missing somewhere?

View 1 Replies

Add A Structure To A Collection?

Sep 18, 2011

Recently I found that I'm not able to instantiate a structure for an array:

Dim mObjectLists() As New objectLayout

Ok, fair but It's an easy way to store a bunch of data in an array instead define a class. And after that I tried to define this:

Dim mObjectLists() As Collection

And add structures to the collection. But it says you should instantiate the reference object first. I searched about creating own Collection based on the base collection class but I think It's wasting time to write a code with class inheritance instead the first sample.

View 1 Replies

Add A Structure To A List

Sep 27, 2011

add a structure to a list

View 2 Replies

C# - Use A Structure Rather Than A Class?

Apr 10, 2009

In a recent project I was working I created a structure in my class to solve a problem I was having, as a colleague was looking over my shoulder he looked derisively at the structure and said "move it into a class". I didn't have any argument for not moving it into a class other than I only need it in this class but this kind of falls down because couldn't I make it a nested class?

View 5 Replies

Convert Structure From VB6 To .Net?

Dec 8, 2009

I need to convert structure from VB6 to VB.Net. This struct is used to pass to a c++ dll. The problem is that the following struct size in VB is 113, but for some reason in VB.Net is 116.

[Code]...

View 7 Replies

DllImport Using A Structure?

Jan 14, 2009

I have an unmanaged C++ dll that I am using in my program. I have successfully used several functions using DllImport. I have run into a problem with one function that takes a structure as input. I originally tried building a structure to pass to the function, but this was unsucessful. So i created a class to define the needed structure. When I pass this, I get no error message, but also no data is passed back to this variable. I have a C++ example of how to use this function, but I don't know how this translates to VB 2005. Here is how they call it in C++ .

[Code]...

View 2 Replies

Get Name Of All Variables Within Structure?

Jun 28, 2012

I have a structure type, as below

Code:
Public Structure StrFolder
Public isActive As Boolean
Public NameFolder As String[code]....

I would like to retrieve and print each variable name within a given structure (not its value). For example:

StrFolder(0).Name should print "isActive"
StrFolder(1).Name should print "NameFolder"
StrFolder(2).Name should print "URLIDNumber"
StrFolder(3).Name should print "DateOfFolder"
etc..

I would also like to know each type of an item within a structure. For example:

StrFolder(0).Type should print "Boolean"
StrFolder(1).Type should print "String"
StrFolder(2).Type should print "Integer"
StrFolder(3).Type should print "String"
etc..

View 5 Replies

Getting A Structure From Memory?

May 15, 2009

What is the best way to get a structure from memory, I know the format:

[Code]...

The structure is 53 bytes until the chat text, the message length is determined by one of the structure variables LineLength, so what is the best way to get that and put into into a structure?

View 17 Replies

Iterate Through The Structure?

Mar 26, 2009

I have a structure with types ranging from thread's to control.what im looking for is a easy way to iterate through those item like For eachbut i couldn't get for each to workis there a way to do it

View 1 Replies

Loop Through The Structure?

Jan 29, 2010

I'm sure I need to do a for each <something> in my something..but I cant figure out what..I kinda want to make a trace program for my structure so I can loop through and split out the name and the value in it..

View 12 Replies

Looping Through Structure?

Feb 16, 2010

I have an array structure called Survey and I'm attempting to loop through all the data and get it printed out. I'm trying to follow the example in my text but I must have something different.Here is my basic structure:

Structure Survey
Dim ID_Code As Integer
Dim Members As Integer

[code]....

I'm not understanding how to fix? The objects and properties to the right of "Family Size: " are getting errors saying "Value of type Integer cannot be converted to System.Drawing.Font.

e.Graphics.DrawString("Family Size: " + Home.Members, PrintFont, Brushes.Black, HorizPrintLocation, VertPrintLocation)
VertPrintLocation = VertPrintLocation + LineHeight

View 8 Replies

Need Right Data Structure

Jun 22, 2010

I have a list of a few thousand names. I actually have last name, first name, phone number, etc and more info. I'm going to make a class to contain the data. so I'll have like a people object with for example a last name field. I'm going to store these in like an array list. Lets say i have 100 items in array list. Maybe last name smith is on index 3 21 and 63. I'd like a data structure where i can easily search for smith and get indexes 3 21 and 63. Brute force is simply loop through complete array checking last name and grabbing index each time i find smith. Ideally id like to have more efficiency. In c++ I'd use a multi map but i don't see that that exists in vb.net. A dictionary wont work because its 1:1.Name of data structure, short description of how to use it and web help reference page would be nice.

View 2 Replies

Serialize A Structure To XML?

Feb 27, 2010

I'm writing a test application in order to figure out how to serialize a structure to XML. I can not get the following code to work for me and it's not obvious to me.

The following defines the structures I am attempting to serialize. I think I have the xml decoration correct - but the errors I'm receiving (see below) don't really give me much information.

Imports System.IO
Imports System.Xml.Serialization
Public Module modTestSerialization

[Code]....

View 2 Replies

Set Element Of Structure To Value

Mar 28, 2011

explain what I need to do at the bottom here? I can not figure out what is meant by setting the element of the structure to the value.. Option Strict On

[Code]....

View 2 Replies







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