Click here to Skip to main content
16,005,209 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalexposing nested classes via webservices Pin
detroitboy17-Feb-05 5:18
detroitboy17-Feb-05 5:18 
Generalreferencing windows form in a variable Pin
Anonymous17-Feb-05 4:42
Anonymous17-Feb-05 4:42 
GeneralRe: referencing windows form in a variable Pin
Colin Angus Mackay17-Feb-05 5:04
Colin Angus Mackay17-Feb-05 5:04 
GeneralRe: referencing windows form in a variable Pin
Anonymous17-Feb-05 7:22
Anonymous17-Feb-05 7:22 
GeneralRe: referencing windows form in a variable Pin
Anonymous17-Feb-05 8:09
Anonymous17-Feb-05 8:09 
GeneralRe: referencing windows form in a variable Pin
Colin Angus Mackay17-Feb-05 8:25
Colin Angus Mackay17-Feb-05 8:25 
GeneralRe: referencing windows form in a variable Pin
Anonymous17-Feb-05 8:34
Anonymous17-Feb-05 8:34 
Generalproblem with writing into a struct Pin
Dahoolio17-Feb-05 2:49
Dahoolio17-Feb-05 2:49 
Hello there,

Sorry for the code in this article, but i need it to lay out my problem, as the code i am refering to is a "complex" struct;
I have this problem with the "complex" struct. The compiler keeps telling me the following message: The object reference is not instanciated on another object. I tried loads of methods to write into the struct but nothing seems to help... can anybody help me out??


Here are the struct definitions:


<code>
<StructLayout(LayoutKind.Sequential, pack:=1)> _
Public Class ST_TeleMeBool
'-- enum unmanagedtype ByValStr = a fixed size string of 80 chars
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> _
Public ID As String = ""
<MarshalAs(UnmanagedType.I1)> _
Public Value As Boolean
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> _
Public Qualify As String = ""
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> _
Public TypeB As String = ""
End Class
</code>


<code>
<StructLayout(LayoutKind.Sequential, pack:=1)> _
Public Class ST_TelemeOut
'-- enum unmanagedtype I2 = a 2 byte signed integer (aka short / system.int16)
<MarshalAs(UnmanagedType.I2)> _
Public CountBool As Integer
'-- enum unmanagedtype ByValArray = an array of which the maximum elementsize MUST be specified (sizeconst)
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1000)> _
Public bArray(1000) As ST_TeleMeBool
End Class
</code>


>>> Basicly, the struct ST_TelemeOut consists of 2 elements: CountBool as int and bArray(1000)of ST_TelemeBool.
As written before, i need to fill the main structure ST_TelemeOut;


<code>
with ST_TelemeOut
.CountBool = 100
end with
</code>

This causes no problems, however, when i access the array of structs, the difficulties begin....

<code>
With ST_TelemeOut
For i = 0 to .countbool
.bArray(i).ID = "My ID" & i
.bArray(i).Value = True
.bArray(i).Qualify = "My Qualifier" & i
next i
end with
</code>


The first codeline within the for loop allready crashes....Frown | :(
can anybody tell me how i need to write values in this struct??



If you make something idiotproof, someone else will make a better idiot.....
GeneralRe: problem with writing into a struct Pin
Dahoolio17-Feb-05 23:09
Dahoolio17-Feb-05 23:09 
GeneralRe: problem with writing into a struct Pin
Dahoolio17-Feb-05 23:30
Dahoolio17-Feb-05 23:30 
GeneralPeer to peer Pin
manasrahfantom17-Feb-05 0:30
manasrahfantom17-Feb-05 0:30 
QuestionHow to use com port Pin
kamal_8216-Feb-05 23:21
kamal_8216-Feb-05 23:21 
AnswerRe: How to use com port Pin
Just Greeky Creek17-Feb-05 2:05
Just Greeky Creek17-Feb-05 2:05 
GeneralWebBrowser Control Pin
Sumit Domyan16-Feb-05 22:42
Sumit Domyan16-Feb-05 22:42 
GeneralExporting Data Pin
Just Greeky Creek16-Feb-05 21:21
Just Greeky Creek16-Feb-05 21:21 
GeneralFile access on a remote pc Pin
SalieghA16-Feb-05 19:36
SalieghA16-Feb-05 19:36 
GeneralRe: File access on a remote pc Pin
Dave Kreskowiak17-Feb-05 5:03
mveDave Kreskowiak17-Feb-05 5:03 
GeneralError loading type library/DLL. Pin
jatin.mehta@gmail.com16-Feb-05 18:45
jatin.mehta@gmail.com16-Feb-05 18:45 
GeneralRe: Error loading type library/DLL. Pin
Dave Kreskowiak17-Feb-05 4:53
mveDave Kreskowiak17-Feb-05 4:53 
Questionmsn messenger style popup alert for VB app ? Pin
erajsri16-Feb-05 16:25
erajsri16-Feb-05 16:25 
AnswerRe: msn messenger style popup alert for VB app ? Pin
Dave Kreskowiak17-Feb-05 4:47
mveDave Kreskowiak17-Feb-05 4:47 
AnswerRe: msn messenger style popup alert for VB app ? Pin
cpod21-Feb-05 17:55
cpod21-Feb-05 17:55 
GeneralRE: TabControl bounding box Pin
iomasteroi16-Feb-05 15:52
iomasteroi16-Feb-05 15:52 
GeneralRe: RE: TabControl bounding box Pin
Dave Kreskowiak17-Feb-05 4:45
mveDave Kreskowiak17-Feb-05 4:45 
GeneralVB.NET ApplicationContext Unhandled Exceptions Pin
Moonark16-Feb-05 14:41
Moonark16-Feb-05 14:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.