[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Converting a vb application

SM

11/13/2003 9:23:00 AM

Hello group,
we are converting a VB6 application, written by other
people, for .NET Framework.
Original application depends on a DLL written in standard C.

The application communicates with an external device
using serial API functions located on the DLL.
Original developer write a VB function which makes a
call located in the DLL passing the instance and a function
pointer to a VB function. The DLL code creates an
invisible window with CreateWindow() function using
instance handle and function pointer (as WndProc,just
to handle a custom WM_xxx message).

Until the code was VB6/C code, it was OK.
Now, the code is, with a little modifications, VB.NET
and we receive an INVALID_HANDLE error on
CreateWindow() function.
I suppose the problem is on HINSTACE handle, cause
the VB.NET function used as WndProc receive a couple of
standard messages (WM_NCCREATE/WM_NCDESTROY).

We need to leave 'untouched' the DLL (now unmanaged).

How can we solve ?
Is it possible to use the VB.NET HINSTANCE in the same
way of the old VB HINSTANCE to create a new window in
a C ?

Thanks a lot,
regards
--
Stefano Mora
email: *@*
(remove *)



4 Answers

Ken Tucker [MVP]

11/13/2003 11:45:00 AM

0

Hi,

You need to use a delegate for callback functions. Hope this
helps.

http://www.elitevb.com/content/01,0075,...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdelegateclas...

Ken
--------------
"SM" <stefano_mora@hotmail.com> wrote in message
news:uUuYofcqDHA.3732@tk2msftngp13.phx.gbl...
> Hello group,
> we are converting a VB6 application, written by other
> people, for .NET Framework.
> Original application depends on a DLL written in standard C.
>
> The application communicates with an external device
> using serial API functions located on the DLL.
> Original developer write a VB function which makes a
> call located in the DLL passing the instance and a function
> pointer to a VB function. The DLL code creates an
> invisible window with CreateWindow() function using
> instance handle and function pointer (as WndProc,just
> to handle a custom WM_xxx message).
>
> Until the code was VB6/C code, it was OK.
> Now, the code is, with a little modifications, VB.NET
> and we receive an INVALID_HANDLE error on
> CreateWindow() function.
> I suppose the problem is on HINSTACE handle, cause
> the VB.NET function used as WndProc receive a couple of
> standard messages (WM_NCCREATE/WM_NCDESTROY).
>
> We need to leave 'untouched' the DLL (now unmanaged).
>
> How can we solve ?
> Is it possible to use the VB.NET HINSTANCE in the same
> way of the old VB HINSTANCE to create a new window in
> a C ?
>
> Thanks a lot,
> regards
> --
> Stefano Mora
> email: *@*
> (remove *)
>
>
>


Dakota

7/6/2013 12:02:00 PM

0

On 7/6/2013 6:51 AM, W.T.S. wrote:
> In article <7ivft8lgq5hiv9vjhklkgmdcbnsntn2d1b@4ax.com>, duckgumbo32
> @cox.net says...
>> On Sat, 06 Jul 2013 02:40:26 -0700, r@somis.org (?RLMeasures) wrote:
>>
>>> In article <MPG.2c4161d134fd0e1398c283@news.west.earthlink.net>,
>>> m14m@earthlink.net wrote:
>>>
>>>> <http://my.earthlink.net/article/int?guid=20130705/c5504d34-...
>>>> 9a47-68da88c4fb1f>
>>>>
>>>> http://tinyurl.c...
>>
>>>> Catholicism wants an 11 year old girl forced-birthed. This abomination
>>>> is happening the world over. When Catholicism rears its ugly head,
>>>> women and children suffer and die.
>>
>>> The driving force behind RCC mistakes is the org's hubris and its
>>> inability to admit that the pope is really not infallible. (1870)
>>
>> Yet there is no mistake. Infallible statements by the Pope total 2 in 2000
>> years. And the requirement that the statement be strongly suggested in
>> scripture is firm in place.
>>
>> The Immaculate Conception of the BVM and her elevation to heaven are strongly
>> suggested in Luke. And so the Pope, under the guidance of the Holy Spirit,
>> declared it God's truth for Catholics.
>>
>> You're really starting to "faulter" over your lacking of knowledge about things
>> on which you wish to pass judgment.
> The Church set a new level of "wrong" when it declared its power to
> interfere in the reproductive rights of women. The Pope and his sock
> puppet screwed the pooch big time on that one!
>
On the plus side, a large and growing number of Catholics in the USA
are living their lives without concern for their religion's position
on reproductive rights.

>
>> The pukester, KKKatholiKKK Stool.
>> ********************************************
>> Renounce, denounce and repudiate Catholicism!
>> It's too degenerate to ever fix.
>> ********************************************
>
> We are indeed Carcinoma Sapiens, destroying, by insane fecundity, that
> which we need to survive.
>>
> As always, organized religion opposes progress -
>>
> See what RELIGION does to peoples' minds: http://tinyurl.c...
>>
> Adults no longer believe in the Tooth Fairy - but they still torture and
> kill each other over ancient myths and superstitions.
>>
> "We all remember how many religious wars were fought for a religion of
> love
> and gentleness; how many bodies were burned
> alive with the genuinely kind intention of saving souls from the eternal
> fire of hell." --- Karl Popper
>>
> "When one person suffers from a delusion, it is called insanity. When
> many
> people suffer from a delusion, it is called Religion."
> --- Robert M. Pirsig
>>
> Either God wants to abolish evil and cannot, or he can but does not want
> to.
> If he wants to but cannot he is impotent. If he can
> but does not want to, he is wicked. If he neither can nor wants to, then
> he
> is both powerless and wicked.
> --- Epicurus, Greek philosopher, circa 300 B.C.
>>
> "Act of God" disasters like the Japanese earthquake expose the myth.
> Either
> God can do nothing to stop catastrophes like
> this, or he doesn't care to, or he doesn't exist. He is thus either
> impotent, evil, or imaginary.
> --- CNN Belief Blog, 3-20-11
>>
> "With or without religion, you would have good people doing good things
> and
> evil people doing evil things. But for good people
> to do evil things, that takes religion."
> --- Steven Weinberg, quoted in The New York Times, April 20, 1999
>>
> "Men never do evil so completely and cheerfully as when they do it from
> religious conviction." --- Blaise Pascal.
>>
> "Religion is regarded by the common people as true, by the wise as
> false,
> and by rulers as useful."
> --- Seneca the Younger (4? BC - 65 AD)
>>
> "Religion once ruled the world. It was called the Dark Ages." --- Ruth
> Green.
>>
> "Science flies you to the moon. Religion flies you into buildings." ---
> Victor Stenger.
>>
> "I don't believe in God because I don't believe in Mother Goose." ---
> Clarence Darrow
>>
> "As my ancestors are free from slavery, I am free from the slavery of
> religion." --- Butterfly McQueen
>>
> "Religion was invented when the first con-man met the first fool." -
> Mark
> Twain
>>
> "Faith is believing what you know ain't so." --- Mark Twain
>>
> "The God of the Old Testament is arguably the most unpleasant character
> in
> all fiction." --- Richard Dawkins
>>
> "Cult today, religion tomorrow."
>>
> http://tinyurl....
>>
> The Freedom From Religion Foundation: http:/...
> The Secular Coalition for America: www.secular.org
> Secular Student Alliance: www.secularstudents.org
> www.infidels.org
> www.humaniststudies.org
> www.atheistalliance.org
> www.americanhumanist.org
> http://tinyurl.c...
>

PATRICK

7/6/2013 2:06:00 PM

0

Dakota <markp@NOSPAMmail.com> wrote:

>On the plus side, a large and growing number of Catholics in the USA
>are living their lives without concern for their religion's position
>on reproductive rights.

REALLY?
Tell me more....

r

7/6/2013 2:29:00 PM

0

In article <kr90la$cf7$1@dont-email.me>, Dakota <markp@NOSPAMmail.com> wrote:

> On 7/6/2013 6:51 AM, W.T.S. wrote:
> > In article <7ivft8lgq5hiv9vjhklkgmdcbnsntn2d1b@4ax.com>, duckgumbo32
> > @cox.net says...
> >> On Sat, 06 Jul 2013 02:40:26 -0700, r@somis.org (?RLMeasures) wrote:
> >>
> >>> In article <MPG.2c4161d134fd0e1398c283@news.west.earthlink.net>,
> >>> m14m@earthlink.net wrote:
> >>>
> >>>> <http://my.earthlink.net/article/int?guid=20130705/c5504d34-...
> >>>> 9a47-68da88c4fb1f>
> >>>>
> >>>> http://tinyurl.c...
> >>
> >>>> Catholicism wants an 11 year old girl forced-birthed. This abomination
> >>>> is happening the world over. When Catholicism rears its ugly head,
> >>>> women and children suffer and die.
> >>
> >>> The driving force behind RCC mistakes is the org's hubris and its
> >>> inability to admit that the pope is really not infallible. (1870)
> >>
> >> Yet there is no mistake. Infallible statements by the Pope total 2 in 2000
> >> years. And the requirement that the statement be strongly suggested in
> >> scripture is firm in place.
> >>
> >> The Immaculate Conception of the BVM and her elevation to heaven are
strongly
> >> suggested in Luke. And so the Pope, under the guidance of the Holy Spirit,
> >> declared it God's truth for Catholics.
> >>
> >> You're really starting to "faulter" over your lacking of knowledge
about things
> >> on which you wish to pass judgment.
> > The Church set a new level of "wrong" when it declared its power to
> > interfere in the reproductive rights of women. The Pope and his sock
> > puppet screwed the pooch big time on that one!
> >
> On the plus side, a large and growing number of Catholics in the USA
> are living their lives without concern for their religion's position
> on reproductive rights.
>
? Women like decorations and RC churches have plenty. Women also like to
participate in real special rituals and the RCC offers one each day. IME
most Catholic women over the age of 25 realize that NFP is a reliable way
to get pregnant. For a church with the best beauty, it's gotta be the
RCC. The tradeoff with the RCC is a lack truth. (Will Durant)