473,406 Members | 2,619 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,406 software developers and data experts.

can vb.net support WINAPI(_stadcall)?

jg
or would I have to use C# or C++?
Nov 30 '05 #1
7 1903
What have you tried ? See the Declare statement or the DllImport
attribute...

Patrice

--

"jg" <ju**@mail.pls> a écrit dans le message de
news:OR*************@tk2msftngp13.phx.gbl...
or would I have to use C# or C++?

Nov 30 '05 #2
jg
thank you for your prompt reply.
I should have mentioned that I want the .net dll to support WINAPI(stdcall)
by non managed client.

I did not think of dllimport. Nonetheless I will Google on ddlimport

I was running into a brick wall when it comes to exposing methods and
function with string and /or integer array to the unmanaged client when I
was using the COM interface. I tried a myriad of marshalas, pin, intptr,
varptr. Either I goofed big time or, I just did not get it.

I just found out the unmanaged client supports WINAPI(_stadcall) as well as
COM, OCX.

So I am looking at the possibility of using WINAPI(_stadcall) on my .net
class dll.

"Patrice" <no****@nowhere.com> wrote in message
news:OO**************@TK2MSFTNGP14.phx.gbl...
What have you tried ? See the Declare statement or the DllImport
attribute...

Patrice

--

"jg" <ju**@mail.pls> a écrit dans le message de
news:OR*************@tk2msftngp13.phx.gbl...
or would I have to use C# or C++?


Nov 30 '05 #3
AFAIK both VB.NET and C# are unabled to "export" DLL functions as done by
the Windows API (they are able to use existing functions).
If you want to expose functions to COM I would still try to solve the
original problem. AFAIK .NET should likely default to exposing this as safe
arrays. You could post your original problme with the effects you have to
the interop group...

I thought first you wanted to consume Windows API functions (my
understanding is now that you want actually to expose functions to the
unmanaged world).

--
Patrice

"jg" <ju**@mail.pls> a écrit dans le message de
news:%2***************@TK2MSFTNGP11.phx.gbl...
thank you for your prompt reply.
I should have mentioned that I want the .net dll to support WINAPI(stdcall) by non managed client.

I did not think of dllimport. Nonetheless I will Google on ddlimport

I was running into a brick wall when it comes to exposing methods and
function with string and /or integer array to the unmanaged client when I
was using the COM interface. I tried a myriad of marshalas, pin, intptr,
varptr. Either I goofed big time or, I just did not get it.

I just found out the unmanaged client supports WINAPI(_stadcall) as well as COM, OCX.

So I am looking at the possibility of using WINAPI(_stadcall) on my .net
class dll.

"Patrice" <no****@nowhere.com> wrote in message
news:OO**************@TK2MSFTNGP14.phx.gbl...
What have you tried ? See the Declare statement or the DllImport
attribute...

Patrice

--

"jg" <ju**@mail.pls> a écrit dans le message de
news:OR*************@tk2msftngp13.phx.gbl...
or would I have to use C# or C++?



Nov 30 '05 #4

COM is the way to go if you want to expose a .Net assembly`s methods to the
unmanaged world
regards

Michel
"jg" <ju**@mail.pls> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
thank you for your prompt reply.
I should have mentioned that I want the .net dll to support
WINAPI(stdcall) by non managed client.

I did not think of dllimport. Nonetheless I will Google on ddlimport

I was running into a brick wall when it comes to exposing methods and
function with string and /or integer array to the unmanaged client when I
was using the COM interface. I tried a myriad of marshalas, pin, intptr,
varptr. Either I goofed big time or, I just did not get it.

I just found out the unmanaged client supports WINAPI(_stadcall) as well
as COM, OCX.

So I am looking at the possibility of using WINAPI(_stadcall) on my .net
class dll.

"Patrice" <no****@nowhere.com> wrote in message
news:OO**************@TK2MSFTNGP14.phx.gbl...
What have you tried ? See the Declare statement or the DllImport
attribute...

Patrice

--

"jg" <ju**@mail.pls> a écrit dans le message de
news:OR*************@tk2msftngp13.phx.gbl...
or would I have to use C# or C++?



Nov 30 '05 #5
jg
There seem to be a lot more documentation and sample of .net consuming
WINAPI(_stadcall) than the other way. I look more so for arrays

That is why I am tempted to look into WINAPI(_stadcall) when I do have some
control over the unmanaged application. I could get the developer to
partition the unmanaged application into two DLLs: data processing and
analytical presentation, let the .net not handle menu, the internet explorer
navigation, parsing.
"m.posseth" <mi*****@nohausystems.nl> wrote in message
news:uW*************@TK2MSFTNGP11.phx.gbl...

COM is the way to go if you want to expose a .Net assembly`s methods to
the unmanaged world
regards

Michel
"jg" <ju**@mail.pls> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
thank you for your prompt reply.
I should have mentioned that I want the .net dll to support
WINAPI(stdcall) by non managed client.

I did not think of dllimport. Nonetheless I will Google on ddlimport

I was running into a brick wall when it comes to exposing methods and
function with string and /or integer array to the unmanaged client when I
was using the COM interface. I tried a myriad of marshalas, pin, intptr,
varptr. Either I goofed big time or, I just did not get it.

I just found out the unmanaged client supports WINAPI(_stadcall) as well
as COM, OCX.

So I am looking at the possibility of using WINAPI(_stadcall) on my .net
class dll.

"Patrice" <no****@nowhere.com> wrote in message
news:OO**************@TK2MSFTNGP14.phx.gbl...
What have you tried ? See the Declare statement or the DllImport
attribute...

Patrice

--

"jg" <ju**@mail.pls> a écrit dans le message de
news:OR*************@tk2msftngp13.phx.gbl...
or would I have to use C# or C++?



Nov 30 '05 #6
jg
just for those who have to deal with legacy application that supports COM,
OCX, and WINAPI(_stadcall),
I worked out the COM interface fro function out array parametns.
For example
' Caller proto:
' Int32 lSz, lsz2
' String lstrOut[]
' Int32 lPos[]
' lSz = objClass.Parse(sIn, ref lsz2, ref lstrOut, ref lPos)
' the result lsz2 and lSz are same of course due to adj made here

Public Function Parse(ByVal sIn As String, <Out()> ByRef iCnt As Integer, _

<Out()> <MarshalAs(UnmanagedType.LPArray, ArraySubType:=UnmanagedType.LPStr,
SizeParamIndex:=1)> ByRef sOut As String(), _

<Out()> <MarshalAs(UnmanagedType.LPArray, ArraySubType:=UnmanagedType.LPStr,
SizeParamIndex:=1)> ByRef lPos As Integer()) As Integer

sOut = Split(sIn, vbTab)

Dim sdebugMsg As String = "0, >>", s As String

Dim i As Integer = 0

iCnt = 0

iCnt = sOut.GetUpperBound(0)

Dim pos(iCnt) As Integer

If iCnt > 0 Then

pos(0) = 1

i = 1

For Each s In sOut

sdebugMsg &= s

If i < iCnt Then

pos(i) = s.Length + 1

sdebugMsg &= vbCrLf & pos(i) & vbTab

End If

Next

lPos = pos

iCnt += 1

Else

End If

' MsgBox("sOut.GetUpperBound()=" & sOut.GetUpperBound(0) & vbCrLf & "values
are" & vbCrLf & sdebugMsg, MsgBoxStyle.OKOnly, "IeStringClass.Parse")

'MsgBox(sOut)

Return iCnt

End Function


Dec 1 '05 #7
jg
I just found the form handle event by itself in the class will let me
initialize but I still get object problem that I will post on another thread

"m.posseth" <mi*****@nohausystems.nl> wrote in message
news:uW*************@TK2MSFTNGP11.phx.gbl...

COM is the way to go if you want to expose a .Net assembly`s methods to
the unmanaged world
regards

Michel
"jg" <ju**@mail.pls> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
thank you for your prompt reply.
I should have mentioned that I want the .net dll to support
WINAPI(stdcall) by non managed client.

I did not think of dllimport. Nonetheless I will Google on ddlimport

I was running into a brick wall when it comes to exposing methods and
function with string and /or integer array to the unmanaged client when I
was using the COM interface. I tried a myriad of marshalas, pin, intptr,
varptr. Either I goofed big time or, I just did not get it.

I just found out the unmanaged client supports WINAPI(_stadcall) as well
as COM, OCX.

So I am looking at the possibility of using WINAPI(_stadcall) on my .net
class dll.

"Patrice" <no****@nowhere.com> wrote in message
news:OO**************@TK2MSFTNGP14.phx.gbl...
What have you tried ? See the Declare statement or the DllImport
attribute...

Patrice

--

"jg" <ju**@mail.pls> a écrit dans le message de
news:OR*************@tk2msftngp13.phx.gbl...
or would I have to use C# or C++?



Jan 3 '06 #8

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

Similar topics

0
by: jg | last post by:
just for those who have to deal with legacy application that supports COM, OCX, and WINAPI(_stadcall) - c-style?, I worked out the COM interface for function out array parameters. For example...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
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...

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.