VWD 2010 Express calls Win32 DLL

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?
 


0
Alan
6/29/2010 3:40:40 AM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

4 Replies
710 Views

Similar Articles

[PageSpeed] 28

On Jun 28, 10:40=A0pm, "Alan T" <alan_NO_SPAM_pl...@yahoo.com.au> wrote:
> I am looking into using Visual WebDeveloper 2010 Express edition to devel=
ope
> 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
0
Chris
6/29/2010 8:49:16 PM
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 


0
Alan
6/30/2010 12:03:38 AM
"Alan T" <alan_NO_SPAM_pltse@yahoo.com.au> wrote in message 
news:emqMze%23FLHA.5856@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? 


0
Jay
6/30/2010 7:13:26 PM
> 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 


0
Alan
7/1/2010 11:50:08 PM
Reply:

Similar Artilces:

June 2010 Updates
I use IE8 to go to Windows Update to check for new updates today. I see the following update detected as needed on my Windows Server 2003 R2 SP2 box: Microsoft .NET Framework 1.1 SP1 Security Update for Windows Server 2003 x86 and Windows Server 2003 R2 x86 (KB979907) My server Add/Remove Programs doesn't have Framework 1.1 listed. There is Framework 2.0 SP1 listed there. So the question is, why do I need .NET Framework 1.1 if I have .NET Framework 2.0 installed? Microsoft .NET Framework 1.1 ships as part of Windows Server 2003. Since there is updates for that Fra...

Static/shared DLL
Hi, I'm new to MFC. I try to create a simple windows dialog by choosing "MFC AppWizard (EXE)" on new project and follow the wizard. In step 3 of 4, there's a question about "How would you like to use the MFC library?" with 2 radio buttons: "As a shared DLL" and "As astatically linked library". What's the different between these 2 options? Which one to choose? I realize that the EXE is bigger in size if I choose "statically linked library". Much bigger, indeed. Please advice, thanks! -P Paul wrote: > Hi, > > I'm...

2007 TO 2010 upgrading ?
I am presently coming to the end of my trail eval period for Project 2007. I definately will be purchasing "Project" full version, not upgrade, but I keep hearing about Project 2010 coming soon. I do not want to buy Project 2007 and 6-8 weeks later see the release of Project 2010 and have to put out more money. I am looking at the Beta of 2010 and like its feel a lot which means I am going to want it. So my question is: How can I proceed in order to spend the least amount of money and in the end be using Project 2013???? Does MS have some sort of program where you ca...

DLookup Expression trouble
I have a DLookup expression in my query that I want to return the corresponding description (text) for a given ID (Autonumber, pk) in the query. My expression isn't returning the different values but rather for each one, regardless of the ID, it's returning the description that corresponds to ID #1 only. Please help me see what I'm missing. Here's my expression: DLookUp("[Parts]","[ltblParts]","[ID]=" & "[ltblParts.ID]") Thanks so much! Pamela Pamela, If numeric... =DLookup("Parts", "tblParts&...

What has happened to my 2010 posts?
I have made at least 6 posts to XP General and MovieMaker this year but when I search these two forums using my screen name I get only my 2009 postings but NONE of this years postings. ALSO, I always check the box to "Notify me of replies"and I used to get emails notifying my of replies to my posts but not any more. Samething is surely gone wrong. Can anyone help? I will have to come back and check for responses because I am sure that I will not get an email notifying me of a response although I have again checked that box below. Thank you. -- JungleJim74 "...

Moving Mailboxes Problem Excahnge 2010
I am not able to move certain mailboxes to our new exchange 2010 server. I get the error message: Error: Active Directory operation failed on {Domain Controller Name}. This error is not retriable. Additional information: Insufficient access rights to perform the operation. Active directory response: 00002098: SecErr: DSID-03150E8A, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0 The user has insufficient access rights. I even tried using the main Domain Admin account and it still will not move the box. I have to go in manually and cancel the request. I have receiced thi...

hotmail and microsoft outlook express question
hi, is there a way i can download emails from my hotmail account onto my computer, perhaps by using microsoft outlook experss or netscape messenger?? i think i can download emails from a pop3 account onto outlook express. please email me your answer, as i am not too sure how to find the answer in microsoft newsgroups. nurmohomed@hotmail.com thank you. This newsgroup is for support of Outlook 97, 98, 2000 & 2002 from the Office family for Windows PCs. For Outlook Express (OE) support try posting in one of these newsgroups: microsoft.public.inetexplorer.ie4.outlookexpress for OE 4...

Outlook Express - "Account" column
Hi. I have begun to use more than one account and would like to keep track of the origins of emails. The Account columns seems to be the foolproof way to do this (the To field often displays personal names rather than email addresses). I have enabled the Account column in OE. When I had only one account, emails were stamped with the default 'pop' description (that was set in the Properties) which is displayable in the Account column. I would like to modify 'pop' to something more descriptive for hundreds of *already existing* messages. Is this possible? This newsgroup is for s...

How to run 'detect and repair' for Outlook Express 6?
I cannot send attachments This newsgroup is for support of Outlook 97, 98, 2000, 2002 & 2003 from the Office family for Intel PCs. For Outlook Express (OE) support try posting in one of these newsgroups: microsoft.public.inetexplorer.ie4.outlookexpress for OE 4.x microsoft.public.windows.inetexplorer.ie5.outlookexpress for OE 5.x http://support.microsoft.com/newsgroups/default.aspx?ICP=GSS3&NewsGroup=microsoft.public.windows.inetexplorer.ie5.outlookexpress&SLCID=US&sd=GN&id=fh;en-us;newsgroups microsoft.public.windows.inetexplorer.ie55.outlookexpress for OE 5.5x http://...

DPM 2010 Primary Server and DPM 2007 Secondary Server
I currently have a primary DPM server protected by a secondary DPM server in another city. Primary server is runnng Win2K8 Standard R2 64-bit with DPM 2007 SP1. Secondary server is running Win2K8 Standard 32-bit with DPM SP1. I am preparing to upgrade my primary server to DPM 2010 RC. Can I continue to protect the primary server with the secondary server running DPM 2007? The secondary server is 800 miles away, and I will not be able to easily upgrade it. I want to wait until I can send someone to the DR site to install a Win2K 64-bit. Thanks. Lee -- Embrace change and d...

Office Tools in 2010
I use Office 2003 and am accustomed to reaching for Office Tools quite often. Are they included in any version of 2010? Thank you. Some are. Which specific tools are you looking for? -- -Ben- Ben M. Schorr, MVP Roland Schorr & Tower http://www.rolandschorr.com http://www.officeforlawyers.com/outlook.htm Author: The Lawyer's Guide to Microsoft Outlook 2007: http://tinyurl.com/ol4law-amazon "JJG" <not@anwhere.com> wrote in message news:ODvL4$76KHA.5708@TK2MSFTNGP02.phx.gbl... > I use Office 2003 and am accustomed to reaching for Office Tools ...

mis-matched MAPI32.DLL & CDO.DLL
In gathering information for another issue, I've discovered that the versions of MAPI32.DLL and CDO.DLL are different on my front-end Exchange 2003 +SP2 server, and on my back-end clustered servers. Both files on the front-end are version 6.5.7654.12, SP2. The files on the back-end servers are slightly older versions. Question: why would this be? due to an update that applied only to non- clustered Exchange servers (or applicable only to clustered Exchange servers? Is this an issue? Should I put the newer version files on the back-end clustered servers? Thanks in advance. ...

Exchange 2010 Database Size
I'm experimenting with Exch 2003 -> 2010 migration in my test lab, and I have a couple of questions: 1. The mailbox database is about 50 GB on disk in Exchange 2003. In Exchange 2010 it's over 100 GB! Is this normal? Is this because the page size has increased? 2. Since this database is over 100 GB, I'm inclined to break it up into smaller DBs. What's the best practice here? MS documentation now says Exchange 2010 can support DBs up to 2 TB (!) but I suspect that something much smaller is actually ideal. Suggestions? Thank you! Exchange 2010 no...

Some more about regular expression
Hi! I understand this one. MatchCollection matches = Regex.Matches("I'lgl some some is is a ", @"(?<char>\s\w+)\k<char>"); I don't understand how this one works but it gives there matches. Can somebody explain how this works. MatchCollection matches = Regex.Matches("aababb", @"(?<l>a)(?<l>\\lb)*"); //Tony Tony Johansson wrote: > Hi! > > I understand this one. > MatchCollection matches = Regex.Matches("I'lgl some some is is a ", > @"(?<char>\s\w+)\k<cha...

VWD 2010 Express Reg Key
I attempting to get a reg key for Visual Web Developer 2010 Express. After logging the profile.microsoft.com/..... page just hangs with a cirle of dots going around. Any ideas of what I can do? Thanks. I got it working. Something to do with cookie settings. "SAC" <sac@somewhere.com> wrote in message news:eBLKkycJLHA.5716@TK2MSFTNGP05.phx.gbl... >I attempting to get a reg key for Visual Web Developer 2010 Express. After >logging the profile.microsoft.com/..... page just hangs with a cirle of >dots going around. > > Any ideas of what...

can not get subdirectories in express to transfer to outlook
When I import my outlook express address book I do not get the subdirectories. what am I missing RRP <RRP@discussions.microsoft.com> wrote: > When I import my outlook express address book I do not get the > subdirectories. what am I missing You're missing the subdirectories <wink>. Outlook will import only those contacts in the Main Identity folder. You'll have to move things around while importing if you wish to reconstruct the contact hierarchy.For example, move your Main Identity contacts to a temporary subfolder. Copy the desired subfolder contacts to ...

Expressions 05-05-10
Kindly explain to us what this expression actually means. i got it from the sample database 2007 temlate Qty To Reorder: IIf([Qty Below Target Level]>0,IIf([Qty Below Target Level]<[Minimum ReOrder Quantity],[Minimum Reorder Quantity],[Qty Below Target Level]),0) The expression is designed to return one of three values. Qty To Reorder: IIf([Qty Below Target Level]>0 ,IIf([Qty Below Target Level]<[Minimum ReOrder Quantity] ,[Minimum Reorder Quantity],[Qty Below Target Level]) ,0) If the value of [Qty Below Target Level] is zero (or Less) then r...

Excel Defaulting to Outlook Express
I have a user who would like to e-mail a spreadsheet from within Excel. User clicks the send to button, and types in the e-mail address, but starts the Outlook Express wizard to create a mail account. User has Outlook 2003 on her PC, and is set to be the default e-mail client. This is only occurring on this one machine. Why has Excel decided that OE is to be used, instead of Outlook, and how do I correct this? Hi Jonathan Check out if Outlook is your mail program for Office Start>Settings>Control Panel....Internet options (Program Tab) Close Excel first before you make a change....

regsvr32 msxml3.dll ?
Any of you may explain me why if I run "regsvr32 msxnl3.dll" finally I am able to login into Money & Net.Passport ? .... after days and days of pain !! Thanks for the explanation ! Manlio Laschena s/y Amarose http://Delphi-Jedi.org In microsoft.public.money, Manlio Laschena wrote: >Any of you may explain me why if I run "regsvr32 msxnl3.dll" >finally I am able to login into Money & Net.Passport ? > >... after days and days of pain !! >Thanks for the explanation ! I think you mean msxnl3.dll Probably people assumed that your problem was caused b...

Create set based on column items feature in Pivot Tables 2010
I have a pivot table created in 2010 that I would like to use the 'create sets' feature in. However it is not enabled. The three 'sets' features are disabled as are the OLAP tools / What if analysis options on the Pivot Table options ribbon. What am i missing??? Cheers Julie Okay, found the problem - for 2010 the sets are only allowable for OLAP based Pivot Tables. :( On Nov 23, 10:16=A0am, jigsaw <jul...@consultant.com> wrote: > I have a pivot table created in 2010 that I would like to use the > 'create sets' feature in. =A0However it is not enabled....

windows 2000 outlook (not express) help function
At some point - probably in a service pack - I lost outlook help. The only thing that displays now is a page saying "What's new in Outlook 2000" and then a list of topics with the heading "What do you want to read about". I would llike to recover a normal help file with an index so that I can actually use the help function. I spent some time this morning trying to get outlook help for a "Vcard" - to no avail. Did MS really do away with the normal help function for outlook 2000 - or have I screwed something up? Any Help will be appreciated (no pun intended...

Incoherent DLL linkin
HelloWorld! This is my problem: I'm trying to create an MFC application and and MFC dll with some classes. I include the .h files (of those classes of course) into the stdafx.h of the application projet (e.g. gfxPoint.h, gfxPolygon.h ....). When I compile i receive a lot of C4273 warnings....and some LNK4217 warning.......but the program works fine! It loads the dll and does his job.... Any help? Thanks!! Ok! Google solved it! http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20949563.html > HelloWorld! > This is my problem: I'm trying to cre...

Cannot open Outlook Express 6
I received an email that was unsolicited. I tried to delete it but instead it locked Outlook Express, and since then I cannot open it. I ran Virus scans but nothing was found, and Road Runner gave that email a clean bill of health. I believe I need to reinstall just the file that opens OUtlook Express, but if that is correct, how does one get that single file, or do I have to delete the entire program. If that is the only way, will I lose my past email as I cannot open it to save it. Help This newsgroup is for support of Outlook 97, 98, 2000 & 2002 from the Office family for W...

VWD 2010 Express calls Win32 DLL
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? On Jun 28, 10:40=A0pm, "Alan T" <alan_NO_SPAM_pl...@yahoo.com.au> wrote: > I am looking into using Visual WebDeveloper 2010 Express edition to devel= ope > a ...

Visual Studio 2010 Quirk?
I am working in VS2010 and right clicked on the Project in the Solution Explorer. Add New Folder. Went into Windows Explorer and copied a few files to this folder. They don't show up in the Solution Explorer, even with a refresh. If I click on the folder and "Open Folder in Windows Explorer" it opens a folder with the URI being "visual studio 2010" Not "Visual Studio 2010" (Notice the case). There is no visual studio 2010 folder, but it shows what is in the "Visual Studio 2010" folder. The Tree view shows both!! Really strange.... I cant e...