Bum 19
New Member
Hello all,
I have a C dll I need to tap into and some C code to interpret to vb.net 2005, but am so far unsuccessful. I just get the generic "runtime has encountered a fatal error at XXXXXX memory". I think my prob is passing the variables. Also, I know the * refers to pointers, but not sure how to interpret them. Hope someone can help...
'Here is the C Code: - enum XXXXStatus {StatusUnknown = 0,
-
Processed,
-
NoSuchSession,
-
NoSuchInfo,
-
ReadOnlyInfo,
-
InvalidInfo,
-
NotYetImplemented = -1};
-
-
enum DataEncoding {EncodingUnknown = 0,
-
NoValue,
-
ZeroTerminatedString,
-
Short16,
-
Int32,
-
Double64,
-
Boolean8,
-
Char8,
-
BinaryByte8
-
};
-
-
#define XXXX_INFO_ID_LENGTH 32
-
-
struct XXXXSessionInfoParameter {
-
char InfoID[XXXX_INFO_ID_LENGTH];
-
int InfoValueLength; /* Total bytes */
-
enum DataEncoding InfoEncoding;
-
int InfoDataCount; /* Number of values or elements */
-
void *InfoData;
-
};
-
-
-
struct XXXXSessionInfoResponse {
-
enum XXXXStatus Status;
-
char InfoID[XXXX_INFO_ID_LENGTH];
-
int InfoParameterCount;
-
struct XXXXSessionInfoParameter *InfoParameterList;
-
};
-
-
-
struct XXXXSessionInfoResponse __declspec (dllexport) *XXXXGetSessionInfo (unsigned long SessionID, char *InfoID);
'here's the call in C:
Info = XXXXGetSessionI nfo (SessionID, “SystemInventor y”) 'now here's what I have sofar in VB.net: - Public Enum DataEncoding
-
EncodingUnknown = 0
-
NoValue
-
ZeroTerminatedString
-
Short16
-
Int32
-
Double64
-
Boolean8
-
Char8
-
BinaryByte8
-
End Enum
-
-
Public Enum XXXXStatus
-
StatusUnknown = 0
-
Processed
-
NoSuchSession
-
NoSuchInfo
-
ReadOnlyInfo
-
InvalidInfo
-
RequestComplete
-
NotYetImplemented = -1
-
End Enum
-
-
<DllImport("XXXXapi.dll", EntryPoint:="XXXXGetSessionInfo", ExactSpelling:=False, CharSet:=CharSet.Unicode)> _
-
Public Function XXXXGetSessionInfo(ByVal SessionID As ULong, ByRef InfoID As String) As XXXXSessionInfoResponse
-
End Function
-
-
Public Class XXXXSessionInfoParameter
-
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public InfoID As String
-
Public InfoValueLength As Integer ' Total bytes
-
Public InfoEncoding As DataEncoding
-
Public InfoDataCount As Integer ' Number of values or elements
-
Public InfoData As IntPtr
-
End Class
-
-
Public Class XXXXSessionInfoResponse
-
Public Status As XXXXStatus
-
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public InfoID As String
-
Public InfoParameterCount As Integer
-
Public InfoParameterList As XXXXSessionInfoParameter
-
End Class
'heres the call I use in vb.net: - dim Info As XXXXSessionInfoResponse
-
-
'please note sessionID was given in earlier code not shown
-
Info = XXXXGetSessionInfo(SessionID, "SystemInventory")
Thanks in advance! B
0 1104 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Dica |
last post by:
i've used the sample code from msdn to create an encyption/decryption
assembly as found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp
i'm able to encrypt and then decrypt data okay as in the following code:
// encrypt the data //
Encryptor enc = new Encryptor(EncryptionAlgorithm.TripleDes);
byte key = Encoding.ASCII.GetBytes("0123456789012345");
|
by: Neo Geshel |
last post by:
This works:
<form>
<asp:TextBox id="name" />
<%= name.ClientID %>
</form>
But this DOES NOT work:
<form>
|
by: Neo Geshel |
last post by:
This works:
<form>
<asp:TextBox id="name" />
<%= name.ClientID %>
</form>
But this DOES NOT work:
<form>
|
by: poornesh K V |
last post by:
This is the details:
I have a Form : ProjectDetails
This form is made up of a TabControl : maintabctrl1 (Say 10 pages)
Each page has a subform : subForm1
This subForm1 has tabcontrol : tabctl1(say 10 pages)
|
by: ratsat |
last post by:
I have a database with over 100,000 records and the dates are all stored as text fields 01-JAN-1999. I need to convert them to a date field and have tried numerous options on my own and in examples posted on threads. I am in a crunch to get this done, need a quick fix from the experts! Thanks!
| |
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |