Define : Creating C DLLs for use with WinRunner?

Define : Creating C DLLs for use with WinRunner?

These are the steps to create a DLL that can be loaded and called from WinRunner.

> Create a new Win32 Dynamic Link Library project, name it, and click .

> On Step 1 of 1, select \"An empty DLL project,\" and click .

> Click <OK> in the New Project Information dialog.

> Select File New from the VC++ IDE.

> Select \"C++ Source File,\" name it, and click <OK>.

> Close the newly created C++ source file window.

> In Windows Explorer, navigate to the project directory and locate the .cpp file you created.

> Rename the .cpp file to a .c file

> Back in the VC++ IDE, select the FileView tab and expand the tree under the Projects Files node.

> Select the Source Files folder in the tree and select the .cpp file you created.

> Press the Delete key; this will remove that file from the project.

> Select Project Add To Project Files from the VC++ IDE menu.

> Navigate to the project directory if you are not already there, and select the .c file that we renamed above.

> Select the .c file and click <OK>. The file will now appear under the Source Files folder.

> Double-click on the .c file to open it.

> Create our functions in the following format:


#include \"include1.h\"

#include \"include2.h\"

.

.

.

#include \"includen.h\"

#define EXPORTED __declspec(dllexport)

<return type> EXPORTED <function1 name>(<type arg1> <arg1>,

<type arg2> <arg2>,

�,

<type argn> <argn>)

{

<function body>

return <some value>;

}

.

.

.

<return type> EXPORTED <functionN name>(<type arg1> <arg1>,

<type arg2> <arg2>,

�,

<type argn> <argn>)

{

<function body>

return <some value>;

}

> Choose Build <Project name>.DLL from the VC++ IDE menu.

> Fix any errors and repeat step 17.

> Once the DLL has compiled successfully, the DLL will be built in either a Debug directory or a Release directory under your project folder depending on your settings when you built the DLL.

> To change this setting, select Build Set Active Configuration from the VC++ IDE menu, and select the Configuration you want from the dialog. Click <OK>, then rebuild the project (step 17).

> All the DLLs types that you are going to create are loaded and called in the same way in WinRunner. This process will be covered once in a later section. 


By:UMANG
Date:2002-02-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related TESTING Subjective Links

TESTING Subjective interview questions and answers for experienced and fresher