[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thunking et al


  • To: "Charles Kaucher" <steinbr@xxxxxxxxxxxx>
  • Subject: Re: Thunking et al
  • From: "evrard_eng" <evrard_eng@xxxxxxxxxxxxx>
  • Date: Sat, 18 Dec 1999 19:21:11 -0800
  • In-reply-to: <4.1.19991210082955.01c962e0@xxxxxxxxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links

Cool I am glad, thank you for letting me know, I am interested with this
development !!

Have a nice evening!

Emmanuel

----- Original Message -----
From: Charles Kaucher <steinbr@xxxxxxxxxxxx>
To: evrard_eng <evrard_eng@xxxxxxxxxxxxx>
Sent: Saturday, December 18, 1999 8:33 PM
Subject: Thunking et al


> Many thanks for your notes on this subject.  This is what I have done this
far.
>
> In the 16-bit world, I have created an Active X Exe called CNole.exe.
> This OLE has a module with only a sub main that is blank. The class is as
> follows.
>
> //////////////////////////////////////////////////begin
>
> Private Declare Function CUMNORMAL Lib "cn.dll" (ByVal Ave As Single,
ByVal
> stanDev As Single, ByVal Zorder As Single, ByRef norm As Single) As
Integer
> Option Explicit
>
> Private Function ValidInput(Ave As Single, _
>                             stanDev As Single, _
>                             Zorder As Single) As Boolean
>     Dim bolCond As Boolean
>     bolCond = True
>
>     bolCond = (stanDev >= 0) And _
>                 IsNumeric(Ave) And _
>                 IsNumeric(stanDev) And _
>                 IsNumeric(Zorder)
>     ValidInput = bolCond
> End Function
>
>
>
> Public Function NormalDist(Ave As Single, _
>                                 stanDev As Single, _
>                                 Zorder As Single) As Single
>     Dim sngNorm As Single
>     Dim intRetValue As Integer
>
>     If ValidInput(Ave, stanDev, Zorder) Then
>         intRetValue = CUMNORMAL(CSng(Ave), CSng(stanDev), CSng(Zorder),
> sngNorm)
>     Else: sngNorm = -2
>     End If
>
>     If intRetValue = 0 Then
>         NormalDist = sngNorm
>     Else
>         NormalDist = -2
>     End If
>
> End Function
>
> ////////////////////////////////////////////////////////end
>
> I created a 16 test program that calls this and it works just fine.
>
> If I understand your comments below you cannot refer to the exe directly
in
> 32-bit but rather you must create a vb 32-bit dll that calls this.  In
other
> words, I have a 32-bit DLL in-process server  calling a16-bit out of
process
> server.  Is this correct?
>
> My suspicion is that you mean that I should compile a 16- bit DLL that
will be
> called by a 32-bit DLL.  This sounds unlikely to me though because you
want the
> 16-bit to run out of process because of the 64K memory offset.
>
> I have tried to access the CNole.exe directly with a test program in the
32-bit
> world  but I get a memory error.
>
> As for thunking, I am not sure I have done any thunking but may have
> accomplished the same thing by using the OLE interface.
>
>
>
> Chuck
>
>
> At 12:21 PM 12/10/99 -0500, evrard_eng wrote:
> >
> >Hi Chuck ,
> >
> >You right you can make a connection with VB 4 to a 32 bit dll.
> >
> >Make a 16 bit api under VB4 (16)then make a 32 bit dll under VB6 (or VB4
32
> >bit)  in this case you make a connection from TS 4 to VB 6 (32bit)
through
> >an api 16bit and an 32 bit dll !!! Cool  ?! I already did this kind of
thing
> >, we call that a thunking process .....
> >
> >It is how you can connect 32 bit VB6 or any 32 bit application to you TS4
16
> >bit......
> >
> >I love this idea.
> >
> >in your vb 4 , open a project , add bas module :
> >
> >in it add your declaration :
> >
> >Declare Function WWL_GdataHotLink Lib "xxxx" (ByVal zzzAs Integer, zzz As
> >pfnCallback, ByVal zzz As Integer, ByVal zzzz As String) As Integer
> >
> >then insert a class module
> >
> >and then you can create you function.
> >after you can compile you api.
> >
> >and you can do you dll 32 in the same way.
> >
> >
> >Actually I am using VB6
> >
> >If you connect to TS 2000 I recommand that you use dll 32 connection
> >directly.
> >
> >
> >Have a nice day !!
> >
> >Emmanuel
> >
> >
> >
> >----- Original Message -----
> >From: Charles Kaucher <steinbr@xxxxxxxxxxxx>
> >To: evrard_eng <evrard_eng@xxxxxxxxxxxxx>
> >Sent: Friday, December 10, 1999 8:37 AM
> >Subject: Re:
> >
> >
> >>
> >>
> >> At 07:39 AM 12/10/99 -0500, you wrote:
> >> >
> >> > Hi Chuck,
> >> > Yes I may have VB 4. I program since VB1 and I am a VB addicted
......
> >> > I made link between VB and PS 2000 .
> >>
> >>
> >> Hi
> >> >
> >> > Emmanuel,
> >>
> >>
> >>
> >> It is always good to find an addict when you need one. :<)
> >>
> >> Someone has already sending me a copy of VB 4.  I have VB 6.
> >> My adventure into VB is recent.  The last time I used basic was when it
> >was
> >> just Basic.  I think I am dating myself.
> >>
> >> I am interested in how you made the link and do you have any sample
code?
> >What
> >> version of VB are you using.
> >>
> >> I am working with a 16 bit DLL that I called in TS4 . I want to call it
> >and do
> >> not have the source code.  I will develop an ActiveX server in VB 4
with
> >the
> >> DLL and then I should be able to call it in a 32 bit VB environment.  I
am
> >> planning to use the DLL in other apps besides TS2000.
> >>
> >> Sound about right to you?
> >>
> >>
> >>
> >>
> >> Charles Kaucher
> >>
> >> The intelligent man who is proud of his intelligence is like the
> >> condemned man who is proud of his large cell. - Simone Weil
> >>
> >
> >
> >
> >
>