VWD 2010 Express calls Win32 DLL

A

Alan T

I am looking into using Visual WebDeveloper 2010 Express edition to develope
a simple web application.
- a button on web page
- click on it
- calls a Win32 DLL function by passing a string type parameter as output
parameter
- this output parameter will be a string, in format of yyyymmdd, eg.
20101231
- print out this output parameter on a label

Any sample source code to help me get started?
 
C

Chris Dunaway

I am looking into using Visual WebDeveloper 2010 Express edition to develope
a simple web application.
- a button on web page
- click on it
- calls a Win32 DLL function by passing a string type parameter as output
parameter
- this output parameter will be a string, in format of yyyymmdd, eg.
20101231
- print out this output parameter on a label

Any sample source code to help me get started?

Which function are you going to call?

In any event, see http://www.pinvoke.net for examples of calling Win32
functions.

Chris
 
A

Alan T

Sorry, I did not make myself clear.
I have myself developed a Win32 DLL in Delphi (it does not matter anyway if
in Delphi).
eg. in Delphi DLL
function TestDateString(_Name: String; out _FileName: String): Integer;
stdcall;

_DateString is the output parameter;

Forget about the _Name parameter, I just want to test it.

Now in VWD using C# behind code when I press a button:
When I call TestDateString, it will generate a report and pass back the name
of the report in format of 'yyyymmdd' or other format, it does not matter.

I want to read the output parameter.

I know it is very elementary in C# but I am pretty new to it.




I am looking into using Visual WebDeveloper 2010 Express edition to
develope
a simple web application.
- a button on web page
- click on it
- calls a Win32 DLL function by passing a string type parameter as output
parameter
- this output parameter will be a string, in format of yyyymmdd, eg.
20101231
- print out this output parameter on a label

Any sample source code to help me get started?

Which function are you going to call?

In any event, see http://www.pinvoke.net for examples of calling Win32
functions.

Chris
 
J

Jay Williams

Alan T said:
Sorry, I did not make myself clear.
I have myself developed a Win32 DLL in Delphi (it does not matter anyway
if in Delphi).
eg. in Delphi DLL
function TestDateString(_Name: String; out _FileName: String): Integer;
stdcall;

_DateString is the output parameter;

Forget about the _Name parameter, I just want to test it.

Now in VWD using C# behind code when I press a button:
When I call TestDateString, it will generate a report and pass back the
name of the report in format of 'yyyymmdd' or other format, it does not
matter.

I want to read the output parameter.

I know it is very elementary in C# but I am pretty new to it.

Did you try passing the filename parameter with the out keyword in your c#
code?
 
A

Alan T

Did you try passing the filename parameter with the out keyword in your c#

Sorry as I am fairly new to ASP.NET as well as C#.

eg. my dll file name called TestString.dll,
the exported function:

Name: TestDateString
Parameter: _Name (type is String)
out parameter: _FileName (type is String)
Return: Integer

I guess I need to use DLLImport in my ASP.NET code behind something like:

[DLLImport("TestString.dll", PreserveSig=true, CharSet=CharSet.Unicode)]

What else do I need to declare the export function?
How to call that?

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top