How i Creating C++ DLLs for use with WinRunner?

How i Creating C++ DLLs for use with WinRunner?

Here are the steps for creating a C++ DLL:

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

> On Step 1 of 1, select \"An Empty DLL Project,\" and click <Finish>.

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

> Select File New from the VC++ IDE.

> Select C++ Source File, name it, and click .

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

> Create our functions in the following format:


#include \"include1.h\"

#include \"include2.h\"

.

.

.

#include \"includen.h\"


#define EXPORTED extern \"C\" __declspec(dllexport)


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

<type arg2> <arg2>,

�,

<type argn> <argn>)

{

<function body>

return <some value>;

}

.

.

.

EXPORTED <return type> <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 8.

> 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.

> 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