473,529 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Again I need help


Hy.
I have the next structure:
<StructLayout(LayoutKind.Sequential)> Structure STR_MATDATA
Public iStructure As Int32 ' Structurenr. bijv. MS_STAAL
Public Standaard As Int32 ' Standaardkwaliteit: 0 (NEE) of 1 (JA)
<MarshalAs(UnmanagedType.LPArray, SizeConst:=24)> Public
Omschrijving() As Byte ' Omschrijving van de materiaalkwaliteit, bijv.
"S235"
Public Kwaliteit As Single ' Rekenwaarde vloeispanning bij deze
kwaliteit, bijv. 235 [N/mm2]
Public Emechanica As Single ' Elasticiteitsmodulus mechanica, was
in mattgb.dat in [kN/m2], nu in [N/mm2], maar was in SVEW vermoedelijk
niet effectief in gebruik
Public Kruipcoefficient As Single ' Kruipcoefficient [-], 0 = nvt
voor staal
Public SoortelijkGewicht As Single ' Soortelijk gewicht [kN/m2],
bijv. 78.5
Public Poissoncoefficient As Single ' Poissoncoefficient nu [-],
bijv. 0.3
Public Uitzettingscoefficient As Single ' Uitzettingscoefficient
alpha [1/K], bijv. 12.e-6
Public VersieNr As Long ' TRK/4.07: Nav TWPRFMUT 3.06: toegevoegd
ivm versie-detectie in tsprofiel.mdb
Public Sub Initialize()
ReDim Omschrijving(23)
End Sub
' !!! Bufferlengte is: 56
End Structure
and the function:
Declare Function STL_GetMaterialen Lib "TWSTL408.DLL" Alias
"_STL_GetMaterialen@16" (ByVal Norm As Integer, ByVal MateriaalSoort As
Integer, ByVal maxMat As Integer, <MarshalAs(UnmanagedType.LPArray)>
ByRef StlMatGeg As STR_MATDATA) As Integer
When I try to call the function like this:
nGeg = STL_GetMaterialen(norm, MateriaalNr, MAX_GEG, Geg(0))
it give error.
Please can you help me with that.
Avy
--
avy31
------------------------------------------------------------------------
avy31's Profile: http://www.hightechtalks.com/m188
View this thread: http://www.hightechtalks.com/t2279957

Nov 23 '05 #1
2 1321
Without knowing what the unmanaged dll TWSTL408.DLL exactly expects
and without knowing your exact error description it is hard for anyone to
give you a good answer

component seems like a mechanical engineering calculator , it might have
been a good idea to write those formula`s in managed code
regards

Michel Posseth [MCP]
"avy31" wrote:

Hy.
I have the next structure:
<StructLayout(LayoutKind.Sequential)> Structure STR_MATDATA
Public iStructure As Int32 ' Structurenr. bijv. MS_STAAL
Public Standaard As Int32 ' Standaardkwaliteit: 0 (NEE) of 1 (JA)
<MarshalAs(UnmanagedType.LPArray, SizeConst:=24)> Public
Omschrijving() As Byte ' Omschrijving van de materiaalkwaliteit, bijv.
"S235"
Public Kwaliteit As Single ' Rekenwaarde vloeispanning bij deze
kwaliteit, bijv. 235 [N/mm2]
Public Emechanica As Single ' Elasticiteitsmodulus mechanica, was
in mattgb.dat in [kN/m2], nu in [N/mm2], maar was in SVEW vermoedelijk
niet effectief in gebruik
Public Kruipcoefficient As Single ' Kruipcoefficient [-], 0 = nvt
voor staal
Public SoortelijkGewicht As Single ' Soortelijk gewicht [kN/m2],
bijv. 78.5
Public Poissoncoefficient As Single ' Poissoncoefficient nu [-],
bijv. 0.3
Public Uitzettingscoefficient As Single ' Uitzettingscoefficient
alpha [1/K], bijv. 12.e-6
Public VersieNr As Long ' TRK/4.07: Nav TWPRFMUT 3.06: toegevoegd
ivm versie-detectie in tsprofiel.mdb
Public Sub Initialize()
ReDim Omschrijving(23)
End Sub
' !!! Bufferlengte is: 56
End Structure
and the function:
Declare Function STL_GetMaterialen Lib "TWSTL408.DLL" Alias
"_STL_GetMaterialen@16" (ByVal Norm As Integer, ByVal MateriaalSoort As
Integer, ByVal maxMat As Integer, <MarshalAs(UnmanagedType.LPArray)>
ByRef StlMatGeg As STR_MATDATA) As Integer
When I try to call the function like this:
nGeg = STL_GetMaterialen(norm, MateriaalNr, MAX_GEG, Geg(0))
it give error.
Please can you help me with that.
Avy
--
avy31
------------------------------------------------------------------------
avy31's Profile: http://www.hightechtalks.com/m188
View this thread: http://www.hightechtalks.com/t2279957

Nov 23 '05 #2

Hy.
Thanks for answer.
What it is in the dll file,I don't know.The part of the programm is
from an application that I was converted from Vb.6 to Vb.NET
Again:
the function:
Public Declare Function STL_GetMaterialen Lib "TWSTL408.DLL" Alias
"_STL_GetMaterialen@16" (ByVal Norm As Integer, ByVal MateriaalSoort As
Integer, ByVal maxMat As Integer, ByRef StlMatGeg As STR_MATDATA) As
Integer
the structure:
<StructLayout(LayoutKind.Sequential)> Structure STR_MATDATA
Public iStructure As Integer ' Structurenr. bijv. MS_STAAL
Public Standaard As Integer ' Standaardkwaliteit: 0 (NEE) of 1
(JA)
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=24)> Public
Omschrijving() As Byte ' Omschrijving van de materiaalkwaliteit, bijv.
"S235"
Public Kwaliteit As Integer ' Rekenwaarde vloeispanning bij
deze kwaliteit, bijv. 235 [N/mm2]
Public Emechanica As Integer ' Elasticiteitsmodulus mechanica,
was in mattgb.dat in [kN/m2], nu in [N/mm2], maar was in SVEW
vermoedelijk niet effectief in gebruik
Public Kruipcoefficient As Integer ' Kruipcoefficient [-], 0 =
nvt voor staal
Public SoortelijkGewicht As Integer ' Soortelijk gewicht
[kN/m2], bijv. 78.5
Public Poissoncoefficient As Integer ' Poissoncoefficient nu
[-], bijv. 0.3
Public Uitzettingscoefficient As Integer '
Uitzettingscoefficient alpha [1/K], bijv. 12.e-6
Public VersieNr As Long ' TRK/4.07: Nav TWPRFMUT 3.06:
toegevoegd ivm versie-detectie in tsprofiel.mdb
Public Sub Initialize()
ReDim Omschrijving(23)
End Sub
' !!! Bufferlengte is: 56
End Structure
the call of the function:
Dim geg() As STR_MATDATA
ReDim geg(19)
For i = 0 To 19
geg(i).Initialize()
Next

nget = STL_GetMaterialen(1, 1, 20, geg(0))
give the error:
An unhandled exception of type 'System.NullReferenceException' occurred
in WindowsApplication1.exe

Additional information: Object reference not set to an instance of an
object.

Any solution?
Avy
--
avy31
------------------------------------------------------------------------
avy31's Profile: http://www.hightechtalks.com/m188
View this thread: http://www.hightechtalks.com/t2279957

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
4289
by: Justin Koivisto | last post by:
OK, I found a thread that help out from a while back (Oct 9, 2002) to give me this pattern: `(((f|ht)tp://)((+)(+)?@)?()+(:\d+)?(\/+)?)`i OK, all is well and good with this until the URL is used at the end of a sentance. I am assuming that I will need a negative lookahead somehow, but I just can't wrap my mind around this one... Want...
46
5098
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") to populate a drop down but would like to use several drop downs restricting the contents of each drop down to the records pertaining to one
17
3364
by: Gabriel Mejía | last post by:
Services or applications using ActiveX Data Objects (ADO) 2.0 or greater may intermittently return empty recordsets on queries that should be returning valid results. At the time the problem occurs, the same queries successfully return the expected data when run from non-ADO sources, such as from ISQL in Microsoft SQL Server. This problem...
6
2309
by: teedilo | last post by:
We have an application with a SQL Server 2000 back end that is fairly database intensive -- lots of fairly frequent queries, inserts, updates -- the gamut. The application does not make use of performance hogs like cursors, but I know there are lots of ways the application could be made more efficient database-wise. The server code is...
6
1590
by: CJ | last post by:
Okay, same program, different issue. Thanks to the help that I was given I was able to complete my program to find variables in a list that were repeated, and display them once, and how many times they appeared in the list. And it worked great! But, being the perfectionist that I am, I wanted to make the proggie allow any size of list, and...
0
957
by: DANIEL HENEGHAN | last post by:
From Norm Matloff's newsletter To: H-1B/L-1/offshoring e-newsletter Any time you see a bunch of newspaper and magazine editorials that call on Congress to raise the H-1B, you can count on more open industry lobbying efforts to follow. The reason, of course, is that the industry lobbyists are the ones who put the editors up to writing...
2
1114
by: Lebowski | last post by:
Hi, i need your help again. I know my problems are v. easy for you, but i'm beginner in access and need a solution. I have a table like this (there is only one record for each product, but one or more record for each average quality, there are also two warehouses: #1 and #0). Product Average Warehouse name Quality A ...
9
4828
by: Tristán White | last post by:
Hi I am very new to PHP - actually, this is my second day at it, as I've only recently started a new job last week. We're a charity. I have a "No input file selected" problem. A Google search has shown me that this is a common problem, but I have tried to follow all the various instructions but none of them make any difference. First...
3
4079
by: Darth Ferret | last post by:
This thing is about to drive me crazy. I have about 50 queries in the AS400 that I need to put on a menu. Once I conquer this I have a bunch more rpg reports that I need to pass a date to. In the AS400 I have a stored procedure (SPRUNQRY) that runs the RUNQRY command with the name of the query as a parameter. In the AS400 I would type "RUNQRY...
2
2771
Sl1ver
by: Sl1ver | last post by:
Create my app.exe.config file e.g <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="MobileDBPath" value="\Program Files\database.sdf"/> <add key="WebService" value="http://localhost/SyncService.asmx"/> <add key="CSVPaths" value="\Program Files\Folder"/> </appSettings> </configuration>
0
7267
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7255
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5805
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4835
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3334
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
901
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.