March 28, 2003
Do you know whether exported finction in libs (or dll's for that matter) contain any type information besides just sizes?  It seems like they should but it also seems like they don't.

"Matthew Wilson" <dmd@synesis.com.au> wrote in message news:b60upk$7p5$1@digitaldaemon.com...
> void * is the same size as int. Both 32-bits. You're kind of tunnelling through the type system, and it works because of the same size. To a processor, there is no difference between void* and int32
>
> "Jon Allen" <jallen@minotstateu.edu> wrote in message news:b60nlr$2jb$1@digitaldaemon.com...
> > > Of course!!!!!!!!!!!!!!!!!!!!!!!!! I had no idea it needed
> > > advapi32.lib....................
> > > I'm gonna shoot myself!!!!!!!!!!!
> > > (well, not so much)
> > > also, for some reason, besides src\phobos\windows.d, I have a really
old
> > > Pavel's windows.d (more complete, though), and there's where I had all
> > those
> > > weird declarations.
> > > my God!!!!!!!!!! how can a human being be sooooooooooooooo stupid?
> >
> > Heh, go figure.  Why is it always the simplest possible problem that is always the hardest to figure out?
> >
> > > By the way, dmd compiles (and links) my file just fine if I declare
> (since
> > > it's not in Walter's windows.d) RegOpenKeyA as (void *,LPCSTR,PHKEY)
or
> as
> > > (int,LPCSTR,PHKEY). why? are void* and int the same? (I know they're
> not,
> > > but still....)
> >
> > ummm...Good question.  They're both the same size.  Maybe they just both show up as double words in the lib files rather than specific types?
That
> > doesn't seem right though.
> >
> >
> > On a completely unrelated note.  Why does Microsoft have to put reply
and
> > reply to group right next to eachother?
> >
> >
> >
>
>


March 28, 2003
Carlos Santander B. wrote:
> By the way, dmd compiles (and links) my file just fine if I declare (since
> it's not in Walter's windows.d) RegOpenKeyA as (void *,LPCSTR,PHKEY) or as
> (int,LPCSTR,PHKEY). why? are void* and int the same? (I know they're not,
> but still....)

The D calling convention has type information in the signatures so they can be differentiated, but the Windows calling convention has the stack size only, which is what the @12 at the end is indicating.

March 28, 2003
They don't. While this can be an opportunity for errors, it does also present some nice opportunities. I've just been working with C# and talking to C DLL functions. By declaring the function signatures with differing, but known (by me!) to be benignly equivalent, types, I can avoid a whole load of tiresome casts throughout the C# class code. Of course, this is dangerous, but used judiciously it can be a nice thing.

"Jon Allen" <jallen@minotstateu.edu> wrote in message news:b6162e$de2$1@digitaldaemon.com...
> Do you know whether exported finction in libs (or dll's for that matter) contain any type information besides just sizes?  It seems like they
should
> but it also seems like they don't.
>
> "Matthew Wilson" <dmd@synesis.com.au> wrote in message news:b60upk$7p5$1@digitaldaemon.com...
> > void * is the same size as int. Both 32-bits. You're kind of tunnelling through the type system, and it works because of the same size. To a processor, there is no difference between void* and int32
> >
> > "Jon Allen" <jallen@minotstateu.edu> wrote in message news:b60nlr$2jb$1@digitaldaemon.com...
> > > > Of course!!!!!!!!!!!!!!!!!!!!!!!!! I had no idea it needed
> > > > advapi32.lib....................
> > > > I'm gonna shoot myself!!!!!!!!!!!
> > > > (well, not so much)
> > > > also, for some reason, besides src\phobos\windows.d, I have a really
> old
> > > > Pavel's windows.d (more complete, though), and there's where I had
all
> > > those
> > > > weird declarations.
> > > > my God!!!!!!!!!! how can a human being be sooooooooooooooo stupid?
> > >
> > > Heh, go figure.  Why is it always the simplest possible problem that
is
> > > always the hardest to figure out?
> > >
> > > > By the way, dmd compiles (and links) my file just fine if I declare
> > (since
> > > > it's not in Walter's windows.d) RegOpenKeyA as (void *,LPCSTR,PHKEY)
> or
> > as
> > > > (int,LPCSTR,PHKEY). why? are void* and int the same? (I know they're
> > not,
> > > > but still....)
> > >
> > > ummm...Good question.  They're both the same size.  Maybe they just
both
> > > show up as double words in the lib files rather than specific types?
> That
> > > doesn't seem right though.
> > >
> > >
> > > On a completely unrelated note.  Why does Microsoft have to put reply
> and
> > > reply to group right next to eachother?
> > >
> > >
> > >
> >
> >
>
>


1 2
Next ›   Last »