Use CPP DLL in ASP.NET Page

  • Thread starter Thread starter chint
  • Start date Start date
C

chint

Hi,

I want to use a cpp dll in one of my page, I need to call 1-2 functions,
pass value and get return. actually it is a key generator dll for my
shareware. ASProtect to be very precise, they have not provided asp.net
samples for it.

for this I first made a wrapper in VB6 activex dll, then in asp.net page
added a COM reference. but this is not working I get a file not found error.

so what is the correct way to use a cpp dll in asp.net pages. ?

please help, thanks in advance.
 
yes, I want to use a c++ dll on my asp.net page.

here is how I am trying to do.
# created a vb.net dll which is just a wrapper around the c++ dll.
successfully tested it using a .net windows app
# created a asp.net project and referenced the vb.net dll

the application is working nice on my local system, but not on my web
server. i have placed both the dlls in the 'bin' folder

but when i run it from my webserver, I get this error:
Unable to load DLL 'keygen.dll': Access is denied. (Exception from HRESULT:
0x80070005 (E_ACCESSDENIED))

any help ?
thanks


| I assume that by "cpp dll" you mean a Win32 DLL created in C++ (or other
| unmanaged code) as opposed to a .NET DLL created in managed code e.g. C#
or
| VB.NET...
|
| If so, then you need to use p/invoke: http://www.pinvoke.net/
|
| Obviously, the DLL and any support files it requires will need to be
visible
| to the webserver on which ASP.NET is running, with appropriate permissions
| etc. You have (almost) no chance of calling a DLL on the client machine...
|
|
| --
| Mark Rae
| ASP.NET MVP
| http://www.markrae.net
|
 
| Any particular reason that you did this...? In order to reference a Win32
| DLL from managed code, you use p/invoke: http://www.pinvoke.net/ - no need
| to wrap it in a .NET assembly... All that you've done here is add an
| unnecessary extra layer...

Yes, I make shareware and to convert them to trail versions I use a
antipiracy tool named ASProtect. I want to generate serial numbers which
will be send to the customers. the company provided me a c++ dll, and few
example for vb6, dephi, c++, php. but not for asp or asp.net.

I want to automate a process of generating serial numbers, the keygen url
will be called by the credit card processor which will return them a serial
number for sending to the customer.


| > The application is working on my local system, but not on my web
| > server. I have placed both the dlls in the 'bin' folder
|
| Both DLLs...? How many DLLs are we talking about...?

Two. the c++ dll and the other vb.net wrapper dll which I wrote.

Anyways, thanks for your input.

I managed to make it work by setting 'Read and Execute' permission on the
'Bin' folder.
 
thanks for ur help, I figured it out.

I needed to add 'class' to a 'web application' project instead of 'website'
project. so no need for the wrapper dll.

thanks,
 
Back
Top