473,225 Members | 1,513 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,225 software developers and data experts.

External dll

Hi!

I have a problem in calling a function from an external dll source.
Prototype for a function is given in vb code

Declare Function GetMessageData Lib "c:\windows\system\smartdll.dll" (ByVal
theLength As Integer, ByRef theMessageLength As Integer, ByVal
theMessageData As String) As Integer

I would like to call this funcition from c# and I just can't seem to get a
hang of it...
Manufacturer description is very scarce...
Where should I use the string, or do I need StringBuilder, can anyone help?

Thanks,
Marino
Jun 27 '08 #1
7 1555
On Jun 10, 8:52 am, "Marino" <mar...@dir.hrwrote:
Hi!

I have a problem in calling a function from an external dll source.
Prototype for a function is given in vb code

Declare Function GetMessageData Lib "c:\windows\system\smartdll.dll" (ByVal
theLength As Integer, ByRef theMessageLength As Integer, ByVal
theMessageData As String) As Integer
I suspect that your problem comes from "ByRef theMessageLength As
Integer",
you should call the finction with (theLength, ref theMessageLength,
theMessageData)
see REF before theMessageLength
>
I would like to call this funcition from c# and I just can't seem to get a
hang of it...
Manufacturer description is very scarce...
Where should I use the string, or do I need StringBuilder, can anyone help?

Thanks,
Marino
Jun 27 '08 #2
On Jun 10, 3:52*am, "Marino" <mar...@dir.hrwrote:
Hi!

I have a problem in calling a function from an external dll source.
Prototype for a function is given in vb code

Declare Function GetMessageData Lib "c:\windows\system\smartdll.dll" (ByVal
theLength As Integer, ByRef theMessageLength As Integer, ByVal
theMessageData As String) As Integer

I would like to call this funcition from c# and I just can't seem to get a
hang of it...
Manufacturer description is very scarce...
Where should I use the string, or do I need StringBuilder, can anyone help?

Thanks,
Marino
Does the function works in VB?
Is that VB.NET or VB6?

What kind of dll is it? Is it a win32 one or a COM dll?
Jun 27 '08 #3
Yes, that seems to be the problem. Thank you!
Even though that works in some functions, while other have problems.
I am currently thinking that the problem is within incompatibile types,
because I am programming in .net while this dll seems to function the best
in "old" languages...
Will keep trying...

"GArlington" <ga********@tiscali.co.ukwrote in message
news:af**********************************@s50g2000 hsb.googlegroups.com...
On Jun 10, 8:52 am, "Marino" <mar...@dir.hrwrote:
>Hi!

I have a problem in calling a function from an external dll source.
Prototype for a function is given in vb code

Declare Function GetMessageData Lib "c:\windows\system\smartdll.dll"
(ByVal
theLength As Integer, ByRef theMessageLength As Integer, ByVal
theMessageData As String) As Integer
I suspect that your problem comes from "ByRef theMessageLength As
Integer",
you should call the finction with (theLength, ref theMessageLength,
theMessageData)
see REF before theMessageLength
>>
I would like to call this funcition from c# and I just can't seem to get
a
hang of it...
Manufacturer description is very scarce...
Where should I use the string, or do I need StringBuilder, can anyone
help?

Thanks,
Marino

Jun 27 '08 #4
Marino wrote:
Yes, that seems to be the problem. Thank you!
Even though that works in some functions, while other have problems.
I am currently thinking that the problem is within incompatibile
types, because I am programming in .net while this dll seems to
function the best in "old" languages...
Will keep trying...
VB6 Integer is .NET System.Int16, not the same as C# int (which is
System.Int32)

That may be your problem.
>
"GArlington" <ga********@tiscali.co.ukwrote in message
news:af**********************************@s50g2000 hsb.googlegroups.com...
>On Jun 10, 8:52 am, "Marino" <mar...@dir.hrwrote:
>>Hi!

I have a problem in calling a function from an external dll source.
Prototype for a function is given in vb code

Declare Function GetMessageData Lib "c:\windows\system\smartdll.dll"
(ByVal
theLength As Integer, ByRef theMessageLength As Integer, ByVal
theMessageData As String) As Integer
I suspect that your problem comes from "ByRef theMessageLength As
Integer",
you should call the finction with (theLength, ref theMessageLength,
theMessageData)
see REF before theMessageLength
>>>
I would like to call this funcition from c# and I just can't seem
to get a
hang of it...
Manufacturer description is very scarce...
Where should I use the string, or do I need StringBuilder, can
anyone help?

Thanks,
Marino

Jun 27 '08 #5
This solved the problem... Strange dll, it references as though params are
long, but in some params it only accepts int16, in some int and in some
long... Very strange..

Thank you a bunch for your help!!

"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:Oc**************@TK2MSFTNGP06.phx.gbl...
Marino wrote:
>Yes, that seems to be the problem. Thank you!
Even though that works in some functions, while other have problems.
I am currently thinking that the problem is within incompatibile
types, because I am programming in .net while this dll seems to
function the best in "old" languages...
Will keep trying...

VB6 Integer is .NET System.Int16, not the same as C# int (which is
System.Int32)

That may be your problem.
>>
"GArlington" <ga********@tiscali.co.ukwrote in message
news:af**********************************@s50g200 0hsb.googlegroups.com...
>>On Jun 10, 8:52 am, "Marino" <mar...@dir.hrwrote:
Hi!

I have a problem in calling a function from an external dll source.
Prototype for a function is given in vb code

Declare Function GetMessageData Lib "c:\windows\system\smartdll.dll"
(ByVal
theLength As Integer, ByRef theMessageLength As Integer, ByVal
theMessageData As String) As Integer
I suspect that your problem comes from "ByRef theMessageLength As
Integer",
you should call the finction with (theLength, ref theMessageLength,
theMessageData)
see REF before theMessageLength

I would like to call this funcition from c# and I just can't seem
to get a
hang of it...
Manufacturer description is very scarce...
Where should I use the string, or do I need StringBuilder, can
anyone help?

Thanks,
Marino


Jun 27 '08 #6
Marino wrote:
This solved the problem... Strange dll, it references as though
params are long, but in some params it only accepts int16, in some
int and in some long... Very strange..
I highly doubt that any of the parameters are a C# long (System.Int64).
LONG in C++ and Long in VB6 are the same as .NET System.Int32.
>
Thank you a bunch for your help!!

"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:Oc**************@TK2MSFTNGP06.phx.gbl...
>Marino wrote:
>>Yes, that seems to be the problem. Thank you!
Even though that works in some functions, while other have problems.
I am currently thinking that the problem is within incompatibile
types, because I am programming in .net while this dll seems to
function the best in "old" languages...
Will keep trying...

VB6 Integer is .NET System.Int16, not the same as C# int (which is
System.Int32)

That may be your problem.
>>>
"GArlington" <ga********@tiscali.co.ukwrote in message
news:af**********************************@s50g20 00hsb.googlegroups.com...
On Jun 10, 8:52 am, "Marino" <mar...@dir.hrwrote:
Hi!
>
I have a problem in calling a function from an external dll
source. Prototype for a function is given in vb code
>
Declare Function GetMessageData Lib
"c:\windows\system\smartdll.dll" (ByVal
theLength As Integer, ByRef theMessageLength As Integer, ByVal
theMessageData As String) As Integer
I suspect that your problem comes from "ByRef theMessageLength As
Integer",
you should call the finction with (theLength, ref theMessageLength,
theMessageData)
see REF before theMessageLength
>
I would like to call this funcition from c# and I just can't seem
to get a
hang of it...
Manufacturer description is very scarce...
Where should I use the string, or do I need StringBuilder, can
anyone help?
>
Thanks,
Marino

Jun 27 '08 #7
Seems strange to me to, but if I use any other filetype other than long it
doesn''t work...

"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Marino wrote:
>This solved the problem... Strange dll, it references as though
params are long, but in some params it only accepts int16, in some
int and in some long... Very strange..

I highly doubt that any of the parameters are a C# long (System.Int64).
LONG in C++ and Long in VB6 are the same as .NET System.Int32.
>>
Thank you a bunch for your help!!

"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:Oc**************@TK2MSFTNGP06.phx.gbl...
>>Marino wrote:
Yes, that seems to be the problem. Thank you!
Even though that works in some functions, while other have problems.
I am currently thinking that the problem is within incompatibile
types, because I am programming in .net while this dll seems to
function the best in "old" languages...
Will keep trying...

VB6 Integer is .NET System.Int16, not the same as C# int (which is
System.Int32)

That may be your problem.
"GArlington" <ga********@tiscali.co.ukwrote in message
news:af**********************************@s50g2 000hsb.googlegroups.com...
On Jun 10, 8:52 am, "Marino" <mar...@dir.hrwrote:
>Hi!
>>
>I have a problem in calling a function from an external dll
>source. Prototype for a function is given in vb code
>>
>Declare Function GetMessageData Lib
>"c:\windows\system\smartdll.dll" (ByVal
>theLength As Integer, ByRef theMessageLength As Integer, ByVal
>theMessageData As String) As Integer
I suspect that your problem comes from "ByRef theMessageLength As
Integer",
you should call the finction with (theLength, ref theMessageLength,
theMessageData)
see REF before theMessageLength
>>
>I would like to call this funcition from c# and I just can't seem
>to get a
>hang of it...
>Manufacturer description is very scarce...
>Where should I use the string, or do I need StringBuilder, can
>anyone help?
>>
>Thanks,
>Marino


Jun 27 '08 #8

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

Similar topics

3
by: bba | last post by:
os:xp pro sp1 ie 6.2800.1106 For some reason any java scripts that refers to 'external' fails: example: external.menuArguments.document.body.style.zoom="100%"; error message:
0
by: Ida | last post by:
Hi, I am trying to build an dll with Microsoft Visual C++ but during the linking phase I get linking errors. Script.obj : error LNK2019: unresolved external symbol __imp__PyString_AsString...
1
by: Aravind | last post by:
we have two files: 1. rc4.c (defines one function "create_pin()") 2. MyImpl.c(calling the function "create_pin()"),This implements JNI method. 1.When I am trying to create .dll file with one...
3
by: al.cpwn | last post by:
do static and inline functions or members have internal linkage? I have been reading this newsgroup on google and found conflicting ideas. Can someone please help me understand why in some places...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
by: Maydogg6 | last post by:
I need a hand with some stubborn link errors. I'm trying to recreate and old program from 6.0 into .NET, but for some reason when I try to compile I'm getting linking errors for all my function...
6
by: sadegh | last post by:
Hi I have a problem with my program in VC++6 When I compile it, the following errors are listed. I spend a lot of time on the groups.google.com to find its reason, but none of comments could...
0
debasisdas
by: debasisdas | last post by:
This thread contains some useful tips for using External tables. USING EXTERNAL TABLE ======================= 1.THE TABLE POINTS TO EXTERNAL FILE. IF DATA IS ALTERED IN THE EXTERNAL FILE,DATA...
0
by: Ryan Gaffuri | last post by:
hlink72@hotmail.com (Eric) wrote in message news:<ab8d8b14.0308220550.54fb5f22@posting.google.com>... LNK1120 is a standard C++ error. you using Visual C++? Means your references a class that...
2
by: =?Utf-8?B?YmFzaA==?= | last post by:
Hello, I am compiling a CPP code using Visual studion .net 2003. I get the following error, despite having windldap.h and wldap32.dll in my include and lib paths. Here is the error. uuid.lib...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.