473,503 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

interop between VB.NET and eVC++

hi there,

i'm working on a smart application project on VB.NET. i must call API
(custom eVC++ DLL) but i have some trouble with mashalas attribute.....
i have copy/past a sample on msdn help but it's not working..
IDE says "unknown 'mashalAs' attribute".....and i don't know why....

i have try exactly the same code on a normal windows project and it work
(compile) fine...

i don't know what i've missed....

here some lines of my code...

thank a lot...

Imports System.Runtime.InteropServices

Public Class Form1

Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll" (ByRef
IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg As String)
As Int32
Nov 21 '05 #1
10 1837
MarshalAs attribute is not supported in CF - simply drop it, and your string
will be passed as LPCWSTR (note the constant part)
As for a byte array, replace ByRef with ByVal - the array will be passed
down as LPBYTE

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
hi there,

i'm working on a smart application project on VB.NET. i must call API
(custom eVC++ DLL) but i have some trouble with mashalas attribute.....
i have copy/past a sample on msdn help but it's not working..
IDE says "unknown 'mashalAs' attribute".....and i don't know why....

i have try exactly the same code on a normal windows project and it work
(compile) fine...

i don't know what i've missed....

here some lines of my code...

thank a lot...

Imports System.Runtime.InteropServices

Public Class Form1

Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll" (ByRef
IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg As
String) As Int32

Nov 21 '05 #2
oh ok.....

thank, but i have one more question...
in my eVC++ DLL some functions use non-unicode strings (unsigned char*)

how i can tell VB to call DLL with non-UNICODE string format ?

thank a lot !
"Alex Feinman [MVP]" <pu*********@alexfeinman.com> a écrit dans le message
de news: uH**************@TK2MSFTNGP09.phx.gbl...
MarshalAs attribute is not supported in CF - simply drop it, and your
string will be passed as LPCWSTR (note the constant part)
As for a byte array, replace ByRef with ByVal - the array will be passed
down as LPBYTE

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
hi there,

i'm working on a smart application project on VB.NET. i must call API
(custom eVC++ DLL) but i have some trouble with mashalas attribute.....
i have copy/past a sample on msdn help but it's not working..
IDE says "unknown 'mashalAs' attribute".....and i don't know why....

i have try exactly the same code on a normal windows project and it work
(compile) fine...

i don't know what i've missed....

here some lines of my code...

thank a lot...

Imports System.Runtime.InteropServices

Public Class Form1

Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll" (ByRef
IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg As
String) As Int32


Nov 21 '05 #3
Pass a byte array.

-Chris
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
oh ok.....

thank, but i have one more question...
in my eVC++ DLL some functions use non-unicode strings (unsigned char*)

how i can tell VB to call DLL with non-UNICODE string format ?

thank a lot !
"Alex Feinman [MVP]" <pu*********@alexfeinman.com> a écrit dans le message
de news: uH**************@TK2MSFTNGP09.phx.gbl...
MarshalAs attribute is not supported in CF - simply drop it, and your
string will be passed as LPCWSTR (note the constant part)
As for a byte array, replace ByRef with ByVal - the array will be passed
down as LPBYTE

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
hi there,

i'm working on a smart application project on VB.NET. i must call API
(custom eVC++ DLL) but i have some trouble with mashalas attribute.....
i have copy/past a sample on msdn help but it's not working..
IDE says "unknown 'mashalAs' attribute".....and i don't know why....

i have try exactly the same code on a normal windows project and it work (compile) fine...

i don't know what i've missed....

here some lines of my code...

thank a lot...

Imports System.Runtime.InteropServices

Public Class Form1

Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll" (ByRef
IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg As
String) As Int32



Nov 21 '05 #4
yes i have already test this....it's ok but in my VB code i can't directly
convert String to byte array..

like this..
DLLFunction ("Toto".tobytearray)

i must declare one byte array then fill it with the string chars....then
call my function...
Dim bytearray(50) as byte
convertstring2bytearray ("toto",bytearray)
DLLFunction(bytearray)

i prefer the first method....but how i can implement the toByteArray method
to the string class ?

thank a lot .

"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le message
de news: Ow**************@TK2MSFTNGP15.phx.gbl...
Pass a byte array.

-Chris
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
oh ok.....

thank, but i have one more question...
in my eVC++ DLL some functions use non-unicode strings (unsigned char*)

how i can tell VB to call DLL with non-UNICODE string format ?

thank a lot !
"Alex Feinman [MVP]" <pu*********@alexfeinman.com> a écrit dans le
message
de news: uH**************@TK2MSFTNGP09.phx.gbl...
> MarshalAs attribute is not supported in CF - simply drop it, and your
> string will be passed as LPCWSTR (note the constant part)
> As for a byte array, replace ByRef with ByVal - the array will be
> passed
> down as LPBYTE
>
> --
> Alex Feinman
> ---
> Visit http://www.opennetcf.org
> "Eric BOUXIROT" <ri****@rickou.net> wrote in message
> news:41**********************@news.free.fr...
>> hi there,
>>
>> i'm working on a smart application project on VB.NET. i must call API
>> (custom eVC++ DLL) but i have some trouble with mashalas
>> attribute.....
>> i have copy/past a sample on msdn help but it's not working..
>> IDE says "unknown 'mashalAs' attribute".....and i don't know why....
>>
>> i have try exactly the same code on a normal windows project and it work >> (compile) fine...
>>
>> i don't know what i've missed....
>>
>> here some lines of my code...
>>
>> thank a lot...
>>
>> Imports System.Runtime.InteropServices
>>
>> Public Class Form1
>>
>> Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll" (ByRef
>> IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg As
>> String) As Int32
>>
>>
>
>



Nov 21 '05 #5
Use the Encoding class to change it.

-Chris
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
yes i have already test this....it's ok but in my VB code i can't directly
convert String to byte array..

like this..
DLLFunction ("Toto".tobytearray)

i must declare one byte array then fill it with the string chars....then
call my function...
Dim bytearray(50) as byte
convertstring2bytearray ("toto",bytearray)
DLLFunction(bytearray)

i prefer the first method....but how i can implement the toByteArray method to the string class ?

thank a lot .

"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le message de news: Ow**************@TK2MSFTNGP15.phx.gbl...
Pass a byte array.

-Chris
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
oh ok.....

thank, but i have one more question...
in my eVC++ DLL some functions use non-unicode strings (unsigned char*)

how i can tell VB to call DLL with non-UNICODE string format ?

thank a lot !
"Alex Feinman [MVP]" <pu*********@alexfeinman.com> a écrit dans le
message
de news: uH**************@TK2MSFTNGP09.phx.gbl...
> MarshalAs attribute is not supported in CF - simply drop it, and your
> string will be passed as LPCWSTR (note the constant part)
> As for a byte array, replace ByRef with ByVal - the array will be
> passed
> down as LPBYTE
>
> --
> Alex Feinman
> ---
> Visit http://www.opennetcf.org
> "Eric BOUXIROT" <ri****@rickou.net> wrote in message
> news:41**********************@news.free.fr...
>> hi there,
>>
>> i'm working on a smart application project on VB.NET. i must call API >> (custom eVC++ DLL) but i have some trouble with mashalas
>> attribute.....
>> i have copy/past a sample on msdn help but it's not working..
>> IDE says "unknown 'mashalAs' attribute".....and i don't know why....
>>
>> i have try exactly the same code on a normal windows project and it

work
>> (compile) fine...
>>
>> i don't know what i've missed....
>>
>> here some lines of my code...
>>
>> thank a lot...
>>
>> Imports System.Runtime.InteropServices
>>
>> Public Class Form1
>>
>> Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll" (ByRef
>> IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg As
>> String) As Int32
>>
>>
>
>



Nov 21 '05 #6
an small example ?

thank a lot !
"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le message
de news: Oa**************@TK2MSFTNGP15.phx.gbl...
Use the Encoding class to change it.

-Chris
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
yes i have already test this....it's ok but in my VB code i can't
directly
convert String to byte array..

like this..
DLLFunction ("Toto".tobytearray)

i must declare one byte array then fill it with the string chars....then
call my function...
Dim bytearray(50) as byte
convertstring2bytearray ("toto",bytearray)
DLLFunction(bytearray)

i prefer the first method....but how i can implement the toByteArray

method
to the string class ?

thank a lot .

"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le

message
de news: Ow**************@TK2MSFTNGP15.phx.gbl...
> Pass a byte array.
>
> -Chris
>
>
> "Eric BOUXIROT" <ri****@rickou.net> wrote in message
> news:41**********************@news.free.fr...
>> oh ok.....
>>
>> thank, but i have one more question...
>> in my eVC++ DLL some functions use non-unicode strings (unsigned
>> char*)
>>
>> how i can tell VB to call DLL with non-UNICODE string format ?
>>
>> thank a lot !
>>
>>
>> "Alex Feinman [MVP]" <pu*********@alexfeinman.com> a écrit dans le
>> message
>> de news: uH**************@TK2MSFTNGP09.phx.gbl...
>> > MarshalAs attribute is not supported in CF - simply drop it, and
>> > your
>> > string will be passed as LPCWSTR (note the constant part)
>> > As for a byte array, replace ByRef with ByVal - the array will be
>> > passed
>> > down as LPBYTE
>> >
>> > --
>> > Alex Feinman
>> > ---
>> > Visit http://www.opennetcf.org
>> > "Eric BOUXIROT" <ri****@rickou.net> wrote in message
>> > news:41**********************@news.free.fr...
>> >> hi there,
>> >>
>> >> i'm working on a smart application project on VB.NET. i must call API >> >> (custom eVC++ DLL) but i have some trouble with mashalas
>> >> attribute.....
>> >> i have copy/past a sample on msdn help but it's not working..
>> >> IDE says "unknown 'mashalAs' attribute".....and i don't know
>> >> why....
>> >>
>> >> i have try exactly the same code on a normal windows project and it
> work
>> >> (compile) fine...
>> >>
>> >> i don't know what i've missed....
>> >>
>> >> here some lines of my code...
>> >>
>> >> thank a lot...
>> >>
>> >> Imports System.Runtime.InteropServices
>> >>
>> >> Public Class Form1
>> >>
>> >> Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll" (ByRef
>> >> IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg
>> >> As
>> >> String) As Int32
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 21 '05 #7
Dim chars as Byte() = System.Text.Encoding.ASCII.GetBytes(myString)
THis is what you need to pass down to the unmanaged code

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
an small example ?

thank a lot !
"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le
message de news: Oa**************@TK2MSFTNGP15.phx.gbl...
Use the Encoding class to change it.

-Chris
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
yes i have already test this....it's ok but in my VB code i can't
directly
convert String to byte array..

like this..
DLLFunction ("Toto".tobytearray)

i must declare one byte array then fill it with the string chars....then
call my function...
Dim bytearray(50) as byte
convertstring2bytearray ("toto",bytearray)
DLLFunction(bytearray)

i prefer the first method....but how i can implement the toByteArray

method
to the string class ?

thank a lot .

"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le

message
de news: Ow**************@TK2MSFTNGP15.phx.gbl...
> Pass a byte array.
>
> -Chris
>
>
> "Eric BOUXIROT" <ri****@rickou.net> wrote in message
> news:41**********************@news.free.fr...
>> oh ok.....
>>
>> thank, but i have one more question...
>> in my eVC++ DLL some functions use non-unicode strings (unsigned
>> char*)
>>
>> how i can tell VB to call DLL with non-UNICODE string format ?
>>
>> thank a lot !
>>
>>
>> "Alex Feinman [MVP]" <pu*********@alexfeinman.com> a écrit dans le
>> message
>> de news: uH**************@TK2MSFTNGP09.phx.gbl...
>> > MarshalAs attribute is not supported in CF - simply drop it, and
>> > your
>> > string will be passed as LPCWSTR (note the constant part)
>> > As for a byte array, replace ByRef with ByVal - the array will be
>> > passed
>> > down as LPBYTE
>> >
>> > --
>> > Alex Feinman
>> > ---
>> > Visit http://www.opennetcf.org
>> > "Eric BOUXIROT" <ri****@rickou.net> wrote in message
>> > news:41**********************@news.free.fr...
>> >> hi there,
>> >>
>> >> i'm working on a smart application project on VB.NET. i must call

API
>> >> (custom eVC++ DLL) but i have some trouble with mashalas
>> >> attribute.....
>> >> i have copy/past a sample on msdn help but it's not working..
>> >> IDE says "unknown 'mashalAs' attribute".....and i don't know
>> >> why....
>> >>
>> >> i have try exactly the same code on a normal windows project and
>> >> it
> work
>> >> (compile) fine...
>> >>
>> >> i don't know what i've missed....
>> >>
>> >> here some lines of my code...
>> >>
>> >> thank a lot...
>> >>
>> >> Imports System.Runtime.InteropServices
>> >>
>> >> Public Class Form1
>> >>
>> >> Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll"
>> >> (ByRef
>> >> IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg
>> >> As
>> >> String) As Int32
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 21 '05 #8
Take a look at the sample in MSDN:

http://msdn.microsoft.com/library/en...nvertTopic.asp
-Chris

"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
an small example ?

thank a lot !
"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le message de news: Oa**************@TK2MSFTNGP15.phx.gbl...
Use the Encoding class to change it.

-Chris
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
yes i have already test this....it's ok but in my VB code i can't
directly
convert String to byte array..

like this..
DLLFunction ("Toto".tobytearray)

i must declare one byte array then fill it with the string chars....then call my function...
Dim bytearray(50) as byte
convertstring2bytearray ("toto",bytearray)
DLLFunction(bytearray)

i prefer the first method....but how i can implement the toByteArray

method
to the string class ?

thank a lot .

"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le

message
de news: Ow**************@TK2MSFTNGP15.phx.gbl...
> Pass a byte array.
>
> -Chris
>
>
> "Eric BOUXIROT" <ri****@rickou.net> wrote in message
> news:41**********************@news.free.fr...
>> oh ok.....
>>
>> thank, but i have one more question...
>> in my eVC++ DLL some functions use non-unicode strings (unsigned
>> char*)
>>
>> how i can tell VB to call DLL with non-UNICODE string format ?
>>
>> thank a lot !
>>
>>
>> "Alex Feinman [MVP]" <pu*********@alexfeinman.com> a écrit dans le
>> message
>> de news: uH**************@TK2MSFTNGP09.phx.gbl...
>> > MarshalAs attribute is not supported in CF - simply drop it, and
>> > your
>> > string will be passed as LPCWSTR (note the constant part)
>> > As for a byte array, replace ByRef with ByVal - the array will be
>> > passed
>> > down as LPBYTE
>> >
>> > --
>> > Alex Feinman
>> > ---
>> > Visit http://www.opennetcf.org
>> > "Eric BOUXIROT" <ri****@rickou.net> wrote in message
>> > news:41**********************@news.free.fr...
>> >> hi there,
>> >>
>> >> i'm working on a smart application project on VB.NET. i must call

API
>> >> (custom eVC++ DLL) but i have some trouble with mashalas
>> >> attribute.....
>> >> i have copy/past a sample on msdn help but it's not working..
>> >> IDE says "unknown 'mashalAs' attribute".....and i don't know
>> >> why....
>> >>
>> >> i have try exactly the same code on a normal windows project and it > work
>> >> (compile) fine...
>> >>
>> >> i don't know what i've missed....
>> >>
>> >> here some lines of my code...
>> >>
>> >> thank a lot...
>> >>
>> >> Imports System.Runtime.InteropServices
>> >>
>> >> Public Class Form1
>> >>
>> >> Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll" (ByRef >> >> IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg
>> >> As
>> >> String) As Int32
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 21 '05 #9
ok thank a lot for your very quick answers...
it work fine....

"Alex Feinman [MVP]" <pu*********@alexfeinman.com> a écrit dans le message
de news: eS*************@tk2msftngp13.phx.gbl...
Dim chars as Byte() = System.Text.Encoding.ASCII.GetBytes(myString)
THis is what you need to pass down to the unmanaged code

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
an small example ?

thank a lot !
"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le
message de news: Oa**************@TK2MSFTNGP15.phx.gbl...
Use the Encoding class to change it.

-Chris
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
yes i have already test this....it's ok but in my VB code i can't
directly
convert String to byte array..

like this..
DLLFunction ("Toto".tobytearray)

i must declare one byte array then fill it with the string
chars....then
call my function...
Dim bytearray(50) as byte
convertstring2bytearray ("toto",bytearray)
DLLFunction(bytearray)

i prefer the first method....but how i can implement the toByteArray
method
to the string class ?

thank a lot .

"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le
message
de news: Ow**************@TK2MSFTNGP15.phx.gbl...
> Pass a byte array.
>
> -Chris
>
>
> "Eric BOUXIROT" <ri****@rickou.net> wrote in message
> news:41**********************@news.free.fr...
>> oh ok.....
>>
>> thank, but i have one more question...
>> in my eVC++ DLL some functions use non-unicode strings (unsigned
>> char*)
>>
>> how i can tell VB to call DLL with non-UNICODE string format ?
>>
>> thank a lot !
>>
>>
>> "Alex Feinman [MVP]" <pu*********@alexfeinman.com> a écrit dans le
>> message
>> de news: uH**************@TK2MSFTNGP09.phx.gbl...
>> > MarshalAs attribute is not supported in CF - simply drop it, and
>> > your
>> > string will be passed as LPCWSTR (note the constant part)
>> > As for a byte array, replace ByRef with ByVal - the array will be
>> > passed
>> > down as LPBYTE
>> >
>> > --
>> > Alex Feinman
>> > ---
>> > Visit http://www.opennetcf.org
>> > "Eric BOUXIROT" <ri****@rickou.net> wrote in message
>> > news:41**********************@news.free.fr...
>> >> hi there,
>> >>
>> >> i'm working on a smart application project on VB.NET. i must call
API
>> >> (custom eVC++ DLL) but i have some trouble with mashalas
>> >> attribute.....
>> >> i have copy/past a sample on msdn help but it's not working..
>> >> IDE says "unknown 'mashalAs' attribute".....and i don't know
>> >> why....
>> >>
>> >> i have try exactly the same code on a normal windows project and
>> >> it
> work
>> >> (compile) fine...
>> >>
>> >> i don't know what i've missed....
>> >>
>> >> here some lines of my code...
>> >>
>> >> thank a lot...
>> >>
>> >> Imports System.Runtime.InteropServices
>> >>
>> >> Public Class Form1
>> >>
>> >> Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll"
>> >> (ByRef
>> >> IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg
>> >> As
>> >> String) As Int32
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 21 '05 #10
asciibytes = System.Text.Encoding.ASCII.GetBytes("Hello World")

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/...ity/newsgroups

"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
an small example ?

thank a lot !
"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le
message de news: Oa**************@TK2MSFTNGP15.phx.gbl...
Use the Encoding class to change it.

-Chris
"Eric BOUXIROT" <ri****@rickou.net> wrote in message
news:41**********************@news.free.fr...
yes i have already test this....it's ok but in my VB code i can't
directly
convert String to byte array..

like this..
DLLFunction ("Toto".tobytearray)

i must declare one byte array then fill it with the string chars....then
call my function...
Dim bytearray(50) as byte
convertstring2bytearray ("toto",bytearray)
DLLFunction(bytearray)

i prefer the first method....but how i can implement the toByteArray

method
to the string class ?

thank a lot .

"Chris Tacke, eMVP" <ct****@spamfree-opennetcf.org> a écrit dans le

message
de news: Ow**************@TK2MSFTNGP15.phx.gbl...
> Pass a byte array.
>
> -Chris
>
>
> "Eric BOUXIROT" <ri****@rickou.net> wrote in message
> news:41**********************@news.free.fr...
>> oh ok.....
>>
>> thank, but i have one more question...
>> in my eVC++ DLL some functions use non-unicode strings (unsigned
>> char*)
>>
>> how i can tell VB to call DLL with non-UNICODE string format ?
>>
>> thank a lot !
>>
>>
>> "Alex Feinman [MVP]" <pu*********@alexfeinman.com> a écrit dans le
>> message
>> de news: uH**************@TK2MSFTNGP09.phx.gbl...
>> > MarshalAs attribute is not supported in CF - simply drop it, and
>> > your
>> > string will be passed as LPCWSTR (note the constant part)
>> > As for a byte array, replace ByRef with ByVal - the array will be
>> > passed
>> > down as LPBYTE
>> >
>> > --
>> > Alex Feinman
>> > ---
>> > Visit http://www.opennetcf.org
>> > "Eric BOUXIROT" <ri****@rickou.net> wrote in message
>> > news:41**********************@news.free.fr...
>> >> hi there,
>> >>
>> >> i'm working on a smart application project on VB.NET. i must call

API
>> >> (custom eVC++ DLL) but i have some trouble with mashalas
>> >> attribute.....
>> >> i have copy/past a sample on msdn help but it's not working..
>> >> IDE says "unknown 'mashalAs' attribute".....and i don't know
>> >> why....
>> >>
>> >> i have try exactly the same code on a normal windows project and
>> >> it
> work
>> >> (compile) fine...
>> >>
>> >> i don't know what i've missed....
>> >>
>> >> here some lines of my code...
>> >>
>> >> thank a lot...
>> >>
>> >> Imports System.Runtime.InteropServices
>> >>
>> >> Public Class Form1
>> >>
>> >> Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll"
>> >> (ByRef
>> >> IN_title() As Byte, <MarshalAs(UnmanagedType.LPStr)> ByRef IN_msg
>> >> As
>> >> String) As Int32
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 21 '05 #11

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

Similar topics

0
2414
by: devgru | last post by:
I've developed several programs for the Pocket PC in eMbedded Visual C (API calls only, no MFC). All of these programs made use of a third-party DLL called SecureTrial (www.zedev.com) to create...
0
1037
by: SkyRender | last post by:
Hello. I'm currently developing an application in eVC++ which will be compiled as a DLL and included in a VB.NET PocetPC program. I compile in eVC++ having included the sms.h header file and...
0
1308
by: Systems001 | last post by:
Anyone had these issues with EVC 4 Debugger? When debugging to an actual unit (in this case, Dell Axim, CE OS V4) The debugger will only stop on occasion at break points, if at all. And once...
0
1811
by: Boris | last post by:
I install embeeded visual C++ sp2 (eVC 4.0) on new instalation of windows XP pro en SP1 () (with no update). Then I to install SDK for windows ce dot.net 4.2. Installation failed with error...
0
935
by: drblow | last post by:
Hi there! I'm new here, and I'm just starting to learn a little about coding, so please be gentle with me! :0) I have DL'ed EVC++4 from MS, and installed it OK. But when I try to create a new...
1
1141
by: Eric BOUXIROT | last post by:
hi there, i have som etrouble when i call a custom DLL (made with eVC++) ..my function take char* (non unicode) to display it (after convert to unicode) DLLEXPORT long F_BDO_MessageBoxOK(char...
3
2241
by: Eric BOUXIROT | last post by:
hi, i must convert all of these eVC++ prototypes to use with VB.NET.... DLLEXPORT long F_BDO_MessageBoxOK(char *IN_title, char *IN_msg ); DLLEXPORT long F_BDO_MessageBoxOUINON(char *IN_title,...
0
1052
by: Eric BOUXIROT | last post by:
hi there, i want to debug a dll made with EVC++. the application is under VB.NET. in EVC++ project settings i have set this : in debug tab i set in category general remote executable path and...
0
962
by: Rick | last post by:
hi all ! i need your HELP ! (it's long to explain but it's needed) i have a big problem (for me) with my APP/DLL i have made an Application with VB.NET for Compact framework that call an...
0
7192
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
7064
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...
1
6974
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
5559
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,...
1
4991
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...
0
3158
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...
0
1492
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 ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
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...

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.