From: Alan T on
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?



From: Chris Dunaway on
On Jun 28, 10:40 pm, "Alan T" <alan_NO_SPAM_pl...(a)yahoo.com.au> wrote:
> 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
From: Alan T on
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


From: Jay Williams on
"Alan T" <alan_NO_SPAM_pltse(a)yahoo.com.au> wrote in message
news:emqMze%23FLHA.5856(a)TK2MSFTNGP02.phx.gbl...
> 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?


From: Alan T on
> Did you try passing the filename parameter with the out keyword in your c#
> code?

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