473,666 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error: Method's type signature is not PInvoke compatible


I've got this error calling one DLL func from my VB.net app:

An unhandled exception of type
'System.Runtime .InteropService s.MarshalDirect iveException' occurred in
Test.exe
Additional information: Method's type signature is not PInvoke compatible.

Called func takes an structure as input (not as a reference/pointer) and
returns structure (not as a reference/pointer).

What should I do?
Nov 21 '05 #1
0 1705

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

Similar topics

3
1838
by: juli jul | last post by:
Hello I am getting this error: error CS0029: Cannot implicitly convert type 'System.EventHandler' to 'Janus.Windows.GridEX.ColumnActionEventHandler Here are the declarations I made(all of them written in proper classes and functions): public delegate void ChangedEventHandler(object sender, EventArgs e);
3
4098
by: Steve | last post by:
I'm trying to call some unmanaged methods from a DLL. I did this awhile ago, a couple years ago... I'm a little rusty. I will show you what I'm dealing with: <unmanaged function signature> STATUS_T WINAPI MSP430_Initialize(CHAR* port, LONG* version); </unmanaged function signature> STATUS_T is a long (typedef long STATUS_T)
8
9576
by: Brian Tkatch | last post by:
Server: DB2/SUN 8.1.6 Client: DB2 Connect Personal Edition (No 11) <URL:ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP11_WR21365/FP11_WR21365_CONPE.exe> Uninstalled old version, installed new version, and am now trying to use the CLP. <<<<<<<<<<<< For more detailed help, refer to the Online Reference Manual.
8
6650
by: Rajesh Soni | last post by:
Hi! I'm getting a PInvoke error while trying to execute the following code... declaration: Structure POINTAPI Dim x As IntPtr
4
5962
by: Zytan | last post by:
I have VB code that shows how to import a DLL function. I compiled it. I used .NET Reflector to see the C# code, and it shows this: private static extern bool MethodName( ref string astring, ref string anotherstring); I believe the function internally deals with ANSI strings (8-bit strings, what some people call ASCII, even though ASCII is only 7-
1
522
by: John | last post by:
What does this mean? Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in 'C:\My Documents\Microsoft Visual Basic\CommuniDent\CommuniDent\bin\CommuniDent.vshost.exe'. Additional Information: A call to PInvoke function 'CommuniDent!CommuniDent.frmMain::sndPlaySound' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling...
0
1059
by: hilma | last post by:
Hi all! I got this exception in My project. Please guide me: A call to PInvoke function 'MyExtRichTextBox!MyExtRichTextBox.MyExtRichTextBox+RichEditOle::CreateILockBytesOnHGlobal' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature. in this line of the library:...
1
1549
by: keerthikarani | last post by:
hi, I m using the following code in vb.net, but it shows me some error, can u explain why this error occurs and how to rectify it, but the following code works fine in vb Private Declare Function SQLDataSources Lib "odbc32.dll" _ (ByVal hEnv As Long, _ ByVal fDirection As Integer, _ ByVal szDSN As String, _ ByVal cbDSNMax As Integer, _ ByVal pcbDSN As Integer, _
1
5727
by: AGorodnov | last post by:
Hello, I'm trying to retrieve a structure in C# from a C dll. Really to say I'm not an expert programmer on both C/C#, and will appreciate any comments and suggestions. Here's a C dll coded structure, to be retrieved.. -- struct MESSAGEE { int MsgNo; int MsgType; char MsgTypeText; char MsgNoText;
0
8444
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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,...
0
8639
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7386
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
isladogs
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...
0
5664
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();...
0
4198
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.