473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

"The parameter is incorrect" when passing arguments to COM object

Hallo csharp'ers

I am trying to call a function on a COM (dll) object from managed c#
code, which will send data to another node using an already existing
bluetooth connection. However, I get a "System.ArgumentException" with
explanation "The parameter is incorrect" when calling
L2C_SendData_Issue(...)

The function declaration in C#:
L2C_SendData_Issue(object vau8BDAddr, object vu16LCID, ref object
pvau8Data, vu16DataSize)

vau8BDAddr: array of size of 6 unsigned 8 bit values
(VT_ARRAY|VT_UI1). This is the unique Bluetooth address of the target
device.

vu16LCID: unsigned 16 bit value (VT_UI2). Channel identifier (CID)
representing a local logical channel endpoint.

pvau8Data: pointer to array of unsigned 8 bit values
(VT_ARRAY|VT_UI1). Pointer to a data area to be transmitted.

vu16DataSize: unsigned 16 bit value (VT_UI2). The parameter specifies
the size of the data to be transmitted. This value is in bytes.

My function looks like this:
public void Send(byte[] addr, byte[] data, int length)
{
object tempData = (object) data;
ushort tempLength = (ushort)length;

try
{
pL2C.L2C_SendData_Issue((object)addr, (object)var_LCID, ref tempData,
tempLength);
}
catch(Exception ex) {Log("Exception occured: " + ex.Message);};
}

I don't know which parameter that causes the error, but I suspect the
3rd (ref object). Any suggestions? Please help!
Nov 15 '05 #1
0 3717

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

Similar topics

14
by: lawrence | last post by:
To call I would do something like: $headline = McSelectJustOneField::callDatastore("cbHeadline"); Is this the correct use of the static keyword, to implement a Singleton design?
14
by: David B. Held | last post by:
I wanted to post this proposal on c.l.c++.m, but my news server apparently does not support that group any more. I propose a new class of exception safety known as the "smart guarantee". ...
34
by: Pmb | last post by:
I've been working on creating a Complex class for my own learning purpose (learn through doing etc.). I'm once again puzzled about something. I can't figure out how to overload the assignment...
24
by: Charles Crume | last post by:
Hello; My "index.htm" page has 3 frames (content, navigation bar, and logo). I set the "SRC" of the "logo" frame to a blank gif image and then want to change it's contents after the other two...
11
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
1
by: Paul Tomlinson | last post by:
Question about a System.Threading.Timer object and the "state" object you pass to it... Timer stateTimer = new Timer( = new TimerCallback( OnTimer ), o, 1000, 1000); I have an array of timer...
3
by: Ralph Purtcher-Wydenbruck | last post by:
This is a worrying bug, and indicates a potential problem in the Framework CLR. This bug affected a project I was working on, which behaved differently when run from the Visual Studio IDE than when...
5
by: Sam | last post by:
Hi everyone Could anyone help me understand the usage of the "New" keyword I'm new to VB.Net. 1. Why do we use the "New" keyword on some object type variables such as the myPen of the...
1
by: William Cruz | last post by:
Can anyone help me with this piece of code. - I keep on getting the error message "The object exporter specified was not found" If i change it to run on my local machine it works fine, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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,...

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.