I have a c++ file-
Example2_s.c
* this ALWAYS GENERATED file contains the RPC server stubs */
#if !defined(_M_IA64) && !defined(_M_AMD64)
#pragma warning( disable: 4049 ) /* more than 64k source lines */
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning( disable: 4211 ) /* redefine extern to static */
#pragma warning( disable: 4232 ) /* dllimport identity*/
#pragma warning( disable: 4024 ) /* array to pointer mapping*/
#pragma warning( disable: 4100 ) /* unreferenced arguments in x86 call */
#pragma optimize("", off )
#include <string.h>
#include "Example2_h.h"
#define TYPE_FORMAT_STRING_SIZE 7
#define PROC_FORMAT_STRING_SIZE 31
#define EXPR_FORMAT_STRING_SIZE 1
#define TRANSMIT_AS_TABLE_SIZE 0
#define WIRE_MARSHAL_TABLE_SIZE 0
typedef struct _Example2_MIDL_TYPE_FORMAT_STRING
{
short Pad;
unsigned char Format[ TYPE_FORMAT_STRING_SIZE ];
} Example2_MIDL_TYPE_FORMAT_STRING;
typedef struct _Example2_MIDL_PROC_FORMAT_STRING
{
short Pad;
unsigned char Format[ PROC_FORMAT_STRING_SIZE ];
} Example2_MIDL_PROC_FORMAT_STRING;
typedef struct _Example2_MIDL_EXPR_FORMAT_STRING
{
long Pad;
unsigned char Format[ EXPR_FORMAT_STRING_SIZE ];
} Example2_MIDL_EXPR_FORMAT_STRING;
static const RPC_SYNTAX_IDENTIFIER _RpcTransferSyntax =
{{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}};
extern const Example2_MIDL_TYPE_FORMAT_STRING Example2__MIDL_TypeFormatString;
extern const Example2_MIDL_PROC_FORMAT_STRING Example2__MIDL_ProcFormatString;
extern const Example2_MIDL_EXPR_FORMAT_STRING Example2__MIDL_ExprFormatString;
extern const MIDL_SERVER_INFO Example1_ServerInfo;
extern const RPC_DISPATCH_TABLE Example1_v1_0_DispatchTable;
static const RPC_SERVER_INTERFACE Example1___RpcServerInterface =
{
sizeof(RPC_SERVER_INTERFACE),
{{0xd3075f46,0x7b6b,0x4577,{0xad,0x5a,0xa4,0x7e,0x62,0x03,0x11,0x6d}},{1,0}},
{{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
(RPC_DISPATCH_TABLE*)&Example1_v1_0_DispatchTable,
0,
0,
0,
&Example1_ServerInfo,
0x04000000
};
RPC_IF_HANDLE Example1_v1_0_s_ifspec = (RPC_IF_HANDLE)& Example1___RpcServerInterface;
extern const MIDL_STUB_DESC Example1_StubDesc;
#if !defined(__RPC_WIN32__)
#error Invalid build platform for this stub.
#endif
#if !(TARGET_IS_NT50_OR_LATER)
#error You need Windows 2000 or later to run this stub because it uses these features:
#error /robust command line switch.
#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
#error This app will fail with the RPC_X_WRONG_STUB_VERSION error.
#endif
static const Example2_MIDL_PROC_FORMAT_STRING Example2__MIDL_ProcFormatString =
{
0,
{
0x32,
0x48,
NdrFcLong( 0x0 ),
NdrFcShort( 0x0 ),
NdrFcShort( 0x4 ),
NdrFcShort( 0x0 ),
NdrFcShort( 0x0 ),
0x42,
0x1,
0x8,
0x1,
NdrFcShort( 0x0 ),
NdrFcShort( 0x0 ),
NdrFcShort( 0x0 ),
NdrFcShort( 0x10b ),
NdrFcShort( 0x0 ),
NdrFcShort( 0x4 ),
0x0
}
};
static const Example2_MIDL_TYPE_FORMAT_STRING Example2__MIDL_TypeFormatString =
{
0,
{
NdrFcShort( 0x0 ),
0x11, 0x8,
0x22,
0x5c,
0x0
}
};
static const unsigned short Example1_FormatStringOffsetTable[] =
{
0
};
static const MIDL_STUB_DESC Example1_StubDesc =
{
(void *)& Example1___RpcServerInterface,
MIDL_user_allocate,
MIDL_user_free,
0,
0,
0,
0,
0,
Example2__MIDL_TypeFormatString.Format,
1,
0x50002,
0,
0x700022b,
0,
0,
0,
0x1,
0,
0,
0
};
static const RPC_DISPATCH_FUNCTION Example1_table[] =
{
NdrServerCall2,
0
};
static const RPC_DISPATCH_TABLE Example1_v1_0_DispatchTable =
{
1,
(RPC_DISPATCH_FUNCTION*)Example1_table
};
static const SERVER_ROUTINE Example1_ServerRoutineTable[] =
{
(SERVER_ROUTINE)Output
};
static const MIDL_SERVER_INFO Example1_ServerInfo =
{
&Example1_StubDesc,
Example1_ServerRoutineTable,
Example2__MIDL_ProcFormatString.Format,
Example1_FormatStringOffsetTable,
0,
0,
0,
0};
#pragma optimize("", on )
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#endif /* !defined(_M_IA64) && !defined(_M_AMD64)*/
When i compile it asks me to insert the #include"stdafx.h" in my code.When i do that it shows me a lot of linking errors.I know that "stdafx.h" need to be the 1st line. After some googling i thought to include the #if !defined(_M_IA64) && !defined(_M_AMD64) in my stdafx.h file. But then also it didnot work. Any suggestions?
"stdafx.h"-
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
//#if !defined(_M_IA64) && !defined(_M_AMD64)
#pragma warning( disable: 4049 )
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here
Please tell me Why did not the program work when i placed the stdafx.h above all lines and suggest a solution if possible.