Hi everyone,

I'm trying to call a DLL that I created using Microsoft Visual C++ 6.0
in an win32 Console
Application.The DLL contains the function(Getarray) I'd like to call
in the win32 Console
Application.I put the DLL into C:\windows\system32. As I got the error
message:
error C2065: 'Getarray' : undeclared identifier.... I put the DLL into
the directory where the executable for the win32 Console
application was to be created.But I still have the same error
message.By creating the
DLL I included in the project a .def file in order to export the DLL.I
also
specified the .lib file under Project Settings->Link->Object/Library-
Module and I can't understand why
the function can't be found.....

Thanks

Re: Calling VC++ dll in exe (VC++) by Scott

Scott
Fri Dec 07 07:12:53 PST 2007

"Lucress Carol" <incognito.me@gmx.de> wrote in message
news:b26ecb47-fce8-48ef-bf46-ed97bd736beb@w40g2000hsb.googlegroups.com...
> Hi everyone,
>
> I'm trying to call a DLL that I created using Microsoft Visual C++ 6.0
> in an win32 Console
> Application.The DLL contains the function(Getarray) I'd like to call
> in the win32 Console
> Application.I put the DLL into C:\windows\system32. As I got the error
> message:
> error C2065: 'Getarray' : undeclared identifier.... I put the DLL into
> the directory where the executable for the win32 Console
> application was to be created.But I still have the same error
> message.By creating the
> DLL I included in the project a .def file in order to export the DLL.I
> also
> specified the .lib file under Project Settings->Link->Object/Library-
> Module and I can't understand why
> the function can't be found.....
>
> Thanks

The DLL functions must be declared with a header file in your exe project,
something like
#include "dllname.h"

This declares the functions to the compiler. (The compiler does not use the
.lib or .dll files.)

--
Scott McPhillips [VC++ MVP]


Re: Calling VC++ dll in exe (VC++) by Lucress

Lucress
Sun Dec 09 23:56:18 PST 2007

On 7 Dez., 16:12, "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
wrote:
> "Lucress Carol" <incognito...@gmx.de> wrote in message
>
> news:b26ecb47-fce8-48ef-bf46-ed97bd736beb@w40g2000hsb.googlegroups.com...
>
>
>
>
>
> > Hi everyone,
>
> > I'm trying to call a DLL that I created using Microsoft Visual C++ 6.0
> > in an win32 Console
> > Application.The DLL contains the function(Getarray) I'd like to call
> > in the win32 Console
> > Application.I put the DLL into C:\windows\system32. As I got the error
> > message:
> > error C2065: 'Getarray' : undeclared identifier.... I put the DLL into
> > the directory where the executable for the win32 Console
> > application was to be created.But I still have the same error
> > message.By creating the
> > DLL I included in the project a .def file in order to export the DLL.I
> > also
> > specified the .lib file under Project Settings->Link->Object/Library-
> > Module and I can't understand why
> > the function can't be found.....
>
> > Thanks
>
> The DLL functions must be declared with a header file in your exe project,
> something like
> #include "dllname.h"
>
> This declares the functions to the compiler. (The compiler does not use the
> .lib or .dll files.)
>
> --
> Scott McPhillips [VC++ MVP]- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

I declared the DLL in the exe project as you mentioned , but I still
have the same error message.I also tried
#include "dllname.dll.h" then comes something like
fatal error C1083: Include file can't be opened: 'dllname.dll.h': No
such file or directory.....

thanks

Re: Calling VC++ dll in exe (VC++) by Scott

Scott
Mon Dec 10 07:33:36 PST 2007

"Lucress Carol" <incognito.me@gmx.de> wrote in message
news:d03bb546-822e-44ab-9954-ca9de096eca0@f3g2000hsg.googlegroups.com...
>> The DLL functions must be declared with a header file in your exe
>> project,
>> something like
>> #include "dllname.h"
>>
>> This declares the functions to the compiler. (The compiler does not use
>> the
>> .lib or .dll files.)
>>
>> --
>> Scott McPhillips [VC++ MVP]- Zitierten Text ausblenden -
>>
>> - Zitierten Text anzeigen -
>
> I declared the DLL in the exe project as you mentioned , but I still
> have the same error message.I also tried
> #include "dllname.dll.h" then comes something like
> fatal error C1083: Include file can't be opened: 'dllname.dll.h': No
> such file or directory.....
>
> thanks

Your DLL project must have a .h file that declares the DLL functions.
#include this .h file in the DLL project and in the exe project. In other
words, you have to #include a file that you create. The purpose of this
file is to make sure both projects share the same definitions for the
exported DLL functions.

--
Scott McPhillips [VC++ MVP]