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
1403 Views

Similar Articles

[PageSpeed] 32

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:

MNY97 Has Stopped Making Outgoing Calls
When trying to send payments that are listed as ready to send, the Call Progress window hangs. There is a flashing down arrow in task bar at bottom of screen. Windows Task Manager says that MNY is running, but there is no indication that the call is being made; i.e., no activity at the DSL modem or at the windows sys tray Internet icon (Two computer monitors). I used WinTaskMgr to end the task. Reopened MNY and same problem occurs. Have not rebooted computer. Can use browser as normally done. XPSpro. Can anyone suggest cause/remedy ? Thanks. ~ Vince ~ Have determined that error ...

running 2010 office beta ... where is the help notes?
I can not find any answers to my questions? Isnt there a beta 2010 forum or somewhere specific to go for questions. ie My outlook want to stay in Work offline mode and I want to change that to work online ... where do I go? I am having some smtp email issues too? 553 errors... same setup worked ok on 2003 version? Where is the info??????????? http://social.technet.microsoft.com/Forums/en/office2010general/threads "PJ" <PJ@discussions.microsoft.com> wrote in message news:BAD1BF4C-3AD8-4B9E-AFE7-0A8E75D7C49C@microsoft.com... :I can not find any answers to...

Outlook 2002 to Outlook Express 6 Import Question
I recently activated Outlook Express 6 and did an import from Outlook 2002. I had four PST files in Outlook 2002 due to the large amount of mail that I archive. When I ran the import wizard in Outlook Express, only the folders from one of the PSTs was listed. How do I import the other folders from the unlisted PSTs? Thanks much in advance for your advice. Eric Hercules, CA Import of what? Contacts? Messages? Something else? OE will only import from your default PST. -- Russ Valentine [MVP-Outlook] "Eric Pena" <anonymous@discussions.microsoft.com> wrote in message ...

problem when starting Outlook 2010
Hi all, After installing Office 2010 (RTM) I get the following error when trying to run Outlook: 'Cannot start MS Outlook. Cannot open the Outlook window' This seems to be a weird problem, as I have read serveral other postings referring to this problem but none of the solutions mentionend seems to be applicable for me. This is what I've tried: - removed office14 per KB928218 - removed leftovers of a 2010Beta installation with a MS tool called 'Windows Installer CleanUp' - removed all mail and data -accounts with 'ControlPanel > Mail' - rem...

DPM 2010, Issue trying to set up a protection group. (SQL 2008, SP
After installing DPM 2010 i tried to create a SQL protection group, but the system keeps telling me that i do not meet the requirements for the Protection group... Being SQL 2005 sp3, Server 2008. Or SQL 2008, Server 2008 The current configuration (Server 2008 R2, DPM 2010) (Physical) The SQL server I am trying to protect is 2008 R2 (Physical), SQL 2008 SP1. Is this a case of the dpm server not knowing the updated service pack version number. Is there a way to fix this or update the DPM 2010 server? Can you refresh the DPM agent on the SQL server from DPM Adminis...

=<expr> function call
Greetings, I am new to the MS Access product, but have experience writing DB middle ware in other environments. Right now my challenge is this: I want to write an expression in a report control that is a complex expression of the record fields. I see how to directly write an expression referring to the record fields like [Customer Name] and so on, and I also see how to make a function call passing one or more fields as function arguments as above, but what I really want to do is pass a reference to the current record, and then within my function be able to refer to all the different fiel...

Outlook Express Automatically comes up
How do I stop my Outlook Express from coming up automatically when I start up my computer? Shirley Wine wrote: > How do I stop my Outlook Express from coming up > automatically when I start up my computer? Ask in a newsgroup for Outlook Express which is a component of Internet Explorer. This newsgroup is for Outlook which is a component of Office. Outlook and Outlook Express are not the same product, they are not code derivatives or siblings of each other, nor are they a full and lite version of the same product. They are DIFFERENT products. -- _____________________________________...

Spell Check disabled in Outlook Express 6
When I try to spell check an outgoing email message, the spell check feature is shaded out. I have Microsoft Office installed, so what's the problem. Shouldn't the spell checker from Excel or Word kick in? Any help would be greatly appreciated Thanks 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.x microsoft.public.windows.inetexplorer.ie5.outlookexpress for OE 5.x http://support.microsoft.com...

DPM 2010 Console Crashes
Hi, We are running the RC version of DPM 2010 on a fresh install of Windows 2008 R2. We do not use library sharing and we have not imported any settings from another instance of DPM. The tape library is a fibre connected HP MSL4048. In Device Manager and HP diagnostics the tape device is working fine but when we try to Inventory Library/ Rescan /Refresh it crashes the DPM console. At the moment we cannot back up to tape. Backups to disk seem ok as well. Anyone seen this before? -- Many Thanks Can you please check the library drivers version which is being tested ...

Simple Round call results in Arithmetic overflow
Hi, I'm a bit dazzled why this statement won't work in T-SQL : Select Round(9.990000, 0) The error I get is : Arithmetic overflow error converting expression to data type numeric. The result should be : 10 I've tried this in SQL 2005,2008 and 2008 R2 (Error message if from R2), didn't find anything in BOL either Select ROUND(19.99, 0) works just fine Is this a bug or not? We develop accounting software and for us this is a dangerous bug. Submitted via EggHeadCafe - Software Developer Portal of Choice Assemblies in Folder Debug Build Checker h...

Project Server 2010 Question
I have a general Project Server 2010 question that I am hoping someone might be able to answer. Currently Project Server 2007 doesnt really support a distributed architecture - does anyone know if there any plans for this in 2010? Hi Chicagohunter, Try posting your question to the forum for Microsoft Project Server 2010. http://social.technet.microsoft.com/Forums/en-US/projectserver2010general/threads I hope this helps. Let us know how you get along. Julie Project MVP Visit http://project.mvps.org/ for the FAQs and additional information about Microsoft Project ...

PreTranslateMessage not called in modeless dialog
This is a really tricky one! Please read on ;) I have a dialog-based MFC application with a main window A which fires up a modeless dialog B exported by an MFC extension DLL. Now, when I press <TAB> to change focus, nothing happens and this is printed in the Output window: Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003). First-chance exception at 0x7c812a5b in MedSpeech.exe: Microsoft C++ exception: COleException @ 0x0012f8e0. This is due to GetNextDlgTabItem() returning NULL (winocc.cpp, line 536). Basically, none of the standard dialog keys are work...

PowerPoint 2010 won't open
I'm checking out Office 2010 on two computers, on running Vista, the other Windows 7. Everything works fine on both machines, except PowerPoint will not open on the Windows 7 computer. I've tried uninstalling and reinstalling Office 2010, but PowerPoint still will not open. Any suggestions for fixing this? ...

Urgent: Calling an MFC ActiveX dll hosting CHtmlView from C# Class Library
Hi, I have wriiten a MFC ActiveX Control using Visual Studio .Net. By defaut it gave me ocx file as an output. Based on my readings, ActiveX Ocx and Dll are a same thing, so i just changed the file extension to DLL in the project output file option under Project Properties. It generated a dll and registrered it and i am able browse it properly in the Object Browser. I added a reference to it in a C# Class Library Project and it made the wrapper ending with control's name ending with Lib. Problem is when i call an ordinary method of the ActiveX from the C# Libarary, it works fine but when...

SaveBarState fails when it is called from a thread #2
Hi, In my application, I use SaveBarState() for persisting control bar state. The code fragment is something like this. void CMainFrame::OnSavePersistance() { SaveBarState(_T("My Persistence")); // Saves some information to an xml file } Since my xml saving takes some time I changed the code to execute in a thread UINT ThreadFn(LPVOID pParam) { CMainFrame* pThis = (CMainFrame*)pParam; pThis->SaveBarState(_T("My Persistence")); return 0; } void CMainFrame::OnCntrlbartst() { AfxBeginThread( ThreadFn, this ); } But, now in the thread function SaveBarState...

What is best practice for using one of multiple .dll's
I have an application that uses one of a selection of about five .dll's depending on the user's environment. Each .dll has the same methods and properties but in this case, uses a different video player. The application is a conversion from VB6 where the dll name was read from the registry and a generic object created so the program didn't have to change references to the object's objects and methods... something like: videoPlayer = GetString(HKEY_LOCAL_MACHINE, "Software\Velocedge", "VideoPlayer") Set videoCtl = CreateObject(videoPlayer) ...

outlook 2010.wrote in word works and saved can not open
saved work in beta2010 word work not able to open any suggestions If you want to guarantee other programs can open the files created by the beta, save as the old doc format. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM How many email accounts are in your main Outlook profile? http:/...

Access 2010 very slow with Sharepoint 2010
working with access 2010 is so slow, every table to open (Sharepoint) and query (even in design mode) takes a long, long time. what could this be? =?Utf-8?B?YW1hY2g=?= <amach@discussions.microsoft.com> wrote in news:2523FCCE-609B-4EEB-ABA7-84DB08745B5F@microsoft.com: > working with access 2010 is so slow, every table to open > (Sharepoint) and query (even in design mode) takes a long, long > time. what could this be? What's the bandwidth between you and the Sharepoint server? -- David W. Fenton http://www.dfenton.com/ usenet at dfenton ...

2010
I have a hyper-v machine protected to a 250GB disk volume with co-location enabled, 74GB is in use. I then created a new protection group to backup a second hyper-v machine and ticked the co-location option. It seems DPM is going to create a new co-locate volume on the disk. Can't DPM use the same volumes accross protection groups? Chris Co-location is limited to the same datasource under the same Protection Group. You cannot co-locate datasources across of Protection Groups. You cannot co-locate datasources of different types in the same volume either. Thanks, --A...

Upgrading Outlook Express and Microsoft mail to Outlook 2007
Hi all, I have two computers running Outlook Express on XP, and Microsoft Mail running on Vista. I want to install Outlook 2007 on the Vista machine and end up with both data sets running under Outlook on the Vista machine, and acting as two separate Identities or Profiles. Can anyone point me in the right direction on how to do the backups/ restores? Is there an order of operations needed because I'm using two machines with different operating systems and versions of mail programs? Any help would be much appreciated Thanks john Does "both data sets" mean that you have two d...

Run-time error 5:Invalid procedure call or argument
Run-time error 5:Invalid procedure call or argument I have been running a small app to backup OE for years (same app without updates its) and now all of a sudden I am getting the above error message. Does anyone have any idea what could be causing this message to pop up? Oh, the app is Outlook Express Freeby Backup and Outlook Express Quickie Backup. I feel certain the problem is with the OS its self [X-post to OE General] The author withdrew OE Freebie Backup over 5 years ago. You should only be using OE Quick Backup now. Docster wrote: > Run-time error 5:Inval...

Random number generator expression used
My final year (Statistics degree) project is concerned with the PRNG in MS Excel. It was stated by the lecturer in Simulation Studies that this PRNG was no good for simulation purposes .. the cycle length is not long enough. So that I can test this statement I need to be able to run the in-built PRNG so that it repeats the sequence of generated random numbers. This cannot be done in situ as there are not enough cells available (max 16k ?). I would propose to run the PRNG as a VBA macro - or stand_alone in VB6 - but for that I need to obtain the mathematical expression that is used ...

Outlook Express Spell Check #3
I get the error: "An error occurred while spelling was being checked. I use W2K and MSWord '97. The spell check works in Word. Thank you Hellerjonathan@hotmail.com <anonymous@discussions.microsoft.com> wrote: > I get the error: "An error occurred while spelling was > being checked. > > I use W2K and MSWord '97. The spell check works in Word. Ask in an Outlook Express newsgroup. -- Brian Tillman ...

ODBC an GP 2010
I've just finished an upgrade from V8 to GP 2010 (and to a new Win 2008 server). The server is fine. I had the install create the ODBC at each of 17 workstations. None of them work. I've tested the ODBC and it fails to connect to the server. I cannot create a new Native 10.0 Client connection either. I can create a SQL connection using Named Pipes but it appears that cannot be used for GP 2010. Workstations are all XP 32 bit, server is 64 bit. Not sure if this is a GP 2010 issue or not but I'm hoping to not have to bring them back to V8!! -- Gina Hoener, MCT Sum...

Cannot Install CRM4.0 Laptop Client on Win7 RTM with SQL Express
I have installed a SQL2008Express CRM instance on test laptop with a clean Win7 RTM. When installing the CRM outlook client it fails. Log shows Action start 16:21:51: SetPerm. CustomAction SetPerm returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) Action ended 16:21:51: SetPerm. Return value 3. Action ended 16:21:51: INSTALL. Return value 3. Action ended 16:21:51: ExecuteAction. Return value 3. Action 16:21:51: SetupCompleteError. Action start 16:21:51: SetupCompleteError. Info 2898.For TahomaBold10 textstyle, the system created a...