Re: Can't get xp_hello sample to work

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Simon Kissane (skissane_at_gmail.com)
Date: 10/11/04


Date: 10 Oct 2004 19:28:17 -0700


"Jonathan Chong" <jonathan@3exp.com> wrote in message news:<ezw2kAQrEHA.4080@TK2MSFTNGP10.phx.gbl>...
> "Simon Kissane" <skissane@gmail.com> wrote in message
> news:82fa6638.0410072215.77b87501@posting.google.com...
> > Hi,
> >
> > I try compiling the xp_hello.dll sample using the Visual C++ Toolkit,
> > as follows:
> >
> > cl xp_hello.c /I "C:\program files\microsoft sql
> > server\80\tools\devtools\include" /LD /nologo /MT /W3 /GX /O2 /D
> > "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D
> > "XP_HELLO_EXPORTS" /YX /FD /link /dll /def:xp_hello.def
> > ..\..\..\lib\opends60.lib /machine:I386
> >
> > When I add to the server and then try to call the extended proc
> > xp_hello, I get an error 127 that entry point xp_hello can't be
> > found. But I have checked with depends.exe, and it is being exported
> > from xp_hello! The builtin extended procs (e.g. those in xpstar.dll)
> > all work fine, and running depends.exe on xpstar.dll I can't see any
> > difference between them and xp_hello.dll....
> >
> > Anyone able to help?
> >
> > Thanks
> > Simon Kissane
>
> Have you do these?
> 1. Register it in SQL with sp_addextendedproc command.
> 2. Copy your xp_hello.dll to your SQL Server \Binn directory
Yes, I have copied it to Binn and registered it with
sp_addextendedproc. I know it is loading the DLL, because it gives me
the message:
ODBC: Msg 0, Level 16, State 1
Cannot find the function xp_hello in the library xp_hello.dll. Reason:
127(The specified procedure could not be found.).

Whereas, if I use a non-existent name, e.g. xp_hello2.dll, I get the
different message:
ODBC: Msg 0, Level 16, State 1
Cannot load the DLL xp_hello2.dll, or one of the DLLs it references.
Reason: 126(The specified module could not be found.).

So the problem is not with loading the DLL; rather, it is with finding
the entry point in the DLL. But depends.exe says the entry point is
there.

I have tried both using a .DEF file (the one supplied with the sample
by MS), and with using __declspec(dllexport) before the __GetXpVersion
and xp_hello functions, and neither seems to make a difference. (i.e.
depends.exe reports dll entry point is there, but SQL Server, although
it can find the DLL, it can't find the entry point....)

Thanks
Simon Kissane



Relevant Pages

  • Re: Firefox and Sound
    ... number of loads that app performed. ... only references to entry points in the dll. ... specified entry points in it can't be found, ... but the download manager said it was only 78.8 MB. ...
    (comp.os.os2.apps)
  • Re: C coding guidelines
    ... /your/ code's entry point, then it isn't what we're talking about - ... but I'm talking specifically about Win32 GUI. ... The REAL entry point for a Win32 GUI program is WinMainCRTStartup. ... link with to produce the DLL. ...
    (comp.lang.c)
  • Re: C coding guidelines
    ... ALL dlls will be called BY THE LOADER before the program starts. ... This call will be done to a special entry point called DllMain ... For instance, in the dll you sent me, the header ...
    (comp.lang.c)
  • Re: System-wide hooking, VB+ASM
    ... >> standard entry point. ... >DLL entry point. ... >without any source code generated, another is a project with a simple DLL, ... >generated for the simple DLL does have a skeleton DllMain and that is all ...
    (microsoft.public.vb.winapi)
  • RE: Web Part Unsafe
    ... DON'T strong name your assembly, remove the old dll from the GAC, ... I add an entry to the webconfig in the wwwroot. ... > on it so there may be configuration issues. ...
    (microsoft.public.sharepoint.portalserver.development)