Click here to Skip to main content
15,905,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDeclaration question... Pin
drjake23-Jul-04 7:20
drjake23-Jul-04 7:20 
GeneralRe: Declaration question... Pin
palbano23-Jul-04 8:07
palbano23-Jul-04 8:07 
GeneralRe: Declaration question... Pin
drjake23-Jul-04 8:16
drjake23-Jul-04 8:16 
GeneralRe: Declaration question... Pin
palbano23-Jul-04 8:27
palbano23-Jul-04 8:27 
GeneralRe: Declaration question... Pin
drjake23-Jul-04 8:56
drjake23-Jul-04 8:56 
GeneralRe: Declaration question... Pin
Henry miller26-Jul-04 8:21
Henry miller26-Jul-04 8:21 
GeneralRe: Declaration question... Pin
Ravi Bhavnani23-Jul-04 8:54
professionalRavi Bhavnani23-Jul-04 8:54 
QuestionError Registering DLL but not .EXE ?? Pin
Pradhip23-Jul-04 6:55
Pradhip23-Jul-04 6:55 
Hello ,

We are trying to access some functions written in our
"SAP R-3 system" using a remote function call. SAP R-3 also generates C Code which we can use to compile interfaces that can test these functions. The text file that comes as a help file when we generate code says that it is meant for generating executable. It however mentions nothing about the code being generated not being fit for using as a dll.

I generated C Code for one such function and then made an .exe project using Visual C++ and tested it and it seems to work fine just as the documentation claims.

However when I use the same code to create a Visual C++ dll projet everything works and I get to the point of making the dll. But when I register the .dll file using REGSVR32 I get an error that reads

"the dll was loaded but the DLL Server Register Entry point was not found."

I do not know, what is it that I am doing wrong here.
Or rather my question would be

1). What special things need to be added or removed or taken care of in my C Code when I am trying to compile it into a DLL

2). I am attaching the code below, that I am using to compile into a DLL. Please feel free to have a look and tell me if there is something you feel that's causing the
trouble.

Any help with this is deeply appreciated.

Regards ,
Pradhip.S
-----------------------------------------------------------
// Code generated by SAP and Visual C++ together.
// SAPCConnect.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "saprfccl.h"

#if !defined(SAPonWINDOWS) && !defined(SAPonNT)
#define __min(a,b) (((a)<(b))?(a):(b))
#define OUT(text,pos) printf("%*.0s",pos,text); printf("%s\n",text); if (outfile!=NULL) fprintf(outfile,"=%s\n",text)
#endif
#define NL printf("\n")


BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}



/*
------------------------------------------------------------------------
SAP AG - R/3 Remote Function Call Interface Generation
RFC_ANSIC_CL_EXP EN 46C
07/19/2004 20:49
Complete ANSI C client example
saprfccl.c
------------------------------------------------------------------------
*/





static FILE *infile,*outfile,*logfile;


void LOG(const RFC_HANDLE hRfc, const char *text,const char *str)
{ if (logfile!=NULL) { fprintf(logfile,"%d %s %s\n",hRfc,text,str); fflush(logfile); } }


typedef void (WIN_DLL_EXPORT_FLAGS * RFC_HELP)(const char *topic, const char *subtopic, const char *text);
static RFC_HELP rfc_help;

void WIN_DLL_EXPORT_FLAGS hlp_y_sd_coa_shipinfo_down(const char *topic, const char *subtopic, const char *text);

void help(const char *topic, const char *subtopic, const char *text)
{

/* general help */
if (strcmp(topic,"h")==0) {
OUT("This is a client example programm for SAP Remote Function Call.",6);
OUT("The program was generated by the R/3 RFC Interface Generator.",6);
OUT("For further information about the example see saprfc cl.txt.",6);
OUT("To get help using the example, answer '?' on any item.",6);
OUT("The example has been generated for function module:",6); NL;
OUT("- Y_SD_COA_SHIPINFO_DOWN",8);
OUT(" Lieferinfo an Versandsubsystem.",8); NL; }

/* program arguments help */
if (strcmp(topic,"l")==0) {
OUT("To logon answer 'y' and type in destination, client, user etc.",6);
OUT("Otherwise perform logon using following program arguments:",6); NL;
OUT("-d <destination>",8);
OUT("-c <client>",8);
OUT("-u <user>",8);
OUT("-p <password>",8);
OUT("-l <language>",8);
OUT("-2 R/2 connection",8);
OUT("-3 R/3 connection",8);
OUT("-h <hostname>",8);
OUT("-s <system number="">",8);
OUT("-g <gateway host="">",8);
OUT("-x <gateway service="">",8);
OUT("-t trace",8);
OUT("-i <filename> input from file",8);
OUT("-o <filename> output to file",8);
OUT("-log <filename> log events file",8);
OUT("-? this text",8); NL; }

/* logon help */
if (strcmp(topic,"li")==0) {
if (strcmp(subtopic,"destination")==0) {
OUT("name of the R/3 or R/2 system, e.g 'C11'.",8); NL; }
if (strcmp(subtopic,"client")==0) {
OUT("R/3 or R/2 client number, e.g. '000'.",8); NL; }
if (strcmp(subtopic,"user")==0) {
OUT("R/3 user or R/2 CPI-C user.",8); NL; }
if (strcmp(subtopic,"password")==0) {
OUT("R/3 password or R/2 CPI-C password.",8); NL; }
if (strcmp(subtopic,"language")==0) {
OUT("system language of the R/3 or R/2 system, e.g. 'E'.",8); NL; }
if (strcmp(subtopic,"mode")==0) {
OUT("determines R/3 or R/2 connection.",8); NL; }
if (strcmp(subtopic,"hostname")==0) {
OUT("hostname of the R/3 application server, e.g. 'hs0000'.",8); NL; }
if (strcmp(subtopic,"system number")==0) {
OUT("system number of the R/3 System, e.g. '00'.",8); NL; }
if (strcmp(subtopic,"gateway host")==0) {
OUT("hostname of the R/3 or R/2 gateway, e.g. 'is0000'.",8); NL; }
if (strcmp(subtopic,"gateway service")==0) {
OUT("name of the R/3 or R/2 gateway service, e.g. 'sapgw00'",8); NL; }
if (strcmp(subtopic,"trace")==0) {
OUT("trace written to 'dev_rfc'.",8); NL; } }

/* input help */
if (strcmp(topic,"i")==0) {
OUT("To input function module parameters, answer 'y' and type in",6);
OUT("parameter values and append table rows if necessary.",6); NL; }
if ((strcmp(topic,"isi")==0)||(strcmp(topic,"esi")==0)) {
OUT("To fill in the structure, answer 'y' and type in structure fields.",10); NL; }
if ((strcmp(topic,"iso")==0)||(strcmp(topic,"eso")==0)) {
OUT("To display the structure fields, answer 'y'.",10); NL; }
if (strcmp(topic,"ti")==0) {
OUT("To append a table row, answer 'y' and type in table row fields.",10); NL; }
if (strcmp(topic,"to")==0) {
OUT("To get the table row and display the row fields, answer 'y' or '*' for all rows.",10); NL; }
if (strcmp(topic,"xi")==0) {
OUT("Terminates the function. To raise the exception, answer 'y'.",10); NL; }
if (strcmp(topic,"xo")==0) {
OUT("Terminated the called function.",10); NL; }
if (strcmp(topic,"c")==0) {
OUT("To call the function module, answer 'y'.",6); NL; }
if (strcmp(topic,"a")==0) {
OUT("To call the function module again, answer 'y'.",6); NL; }

/* end info */
if (strcmp(topic,"end")==0) {
OUT("Thank you for using the SAP Business Application Programming Interface",2);
OUT("and SAP Remote Function Call.",2); NL; }

if (rfc_help!=NULL) rfc_help(topic, subtopic, text);

}

void INS(const char *topic,const char *subtopic,const char *text,const unsigned pos,const unsigned len,char *str)
{
int c=0;
do { printf("%*.0s",pos,text); printf("%-*s : ",len,text);
if (infile!=NULL) { /* read from input file comparing input event (text) */
do { c=getc(infile); if (c==EOF) { OUT("error reading input file",0); exit(1); }
fgets(str,1024,infile); *(str+strlen(str)-1) = '\0'; } while ((c!='=')||(strcmp(text,str)!=0));
c=getc(infile); if (c==EOF) { OUT("error reading input file",0); exit(1); }
fgets(str,1024,infile); *(str+strlen(str)-1) = '\0'; printf("%s\n",str); } /* cut CR/LF and stdout */
else
gets(str); /* read from stdin */
if (outfile!=NULL) fprintf(outfile,"=%s\n<%s\n",text,str); /* write output file */
if (str[0]=='?') help(topic,subtopic,text); } while (str[0]=='?');
return;
}
void OUTS(const char *text,const unsigned pos,const unsigned len,char *str)
{
printf("%*.0s",pos,text); printf("%-*s : %s\n",len,text,str);
if (outfile!=NULL) fprintf(outfile,"=%s\n>%s\n",text,str);
return;
}

#define SETCHAR(var,str) memcpy(var,str,__min(strlen(str),sizeof(var))); \
if (sizeof(var)>strlen(str)) memset(var+strlen(str),' ',sizeof(var)-strlen(str))
#define GETCHAR(var,str) sprintf(str,"%.*s",sizeof(var),var)

#define SETDATE(var,str) memcpy(var,str,__min(strlen(str),sizeof(var))); \
if (sizeof(var)>strlen(str)) memset(var+strlen(str),'0',sizeof(var)-strlen(str))
#define GETDATE(var,str) sprintf(str,"%.*s",sizeof(var),var)

#define SETFLOAT(var,str) *var=atof(str);
#define GETFLOAT(var,str) sprintf(str,"%f",var);

#define SETINT(var,str) *var=atol(str);
#define GETINT(var,str) sprintf(str,"%ld",var);

#define SETNUM(var,str) memcpy(var+(sizeof(var)-__min(strlen(str),sizeof (var))),str,__min(strlen(str),sizeof(var))); \
if (sizeof(var)>strlen(str)) memset(var,'0',sizeof(var)-strlen(str))
#define GETNUM(var,str) sprintf(str,"%.*s",sizeof(var),var)

#define SETTIME(var,str) memcpy(var,str,__min(strlen(str),sizeof(var))); \
if (sizeof(var)>strlen(str)) memset(var+strlen(str),'0',sizeof(var)-strlen(str))
#define GETTIME(var,str) sprintf(str,"%.*s",sizeof(var),var)

#define SETINT1(var,str) *var=atoi(str);
#define GETINT1(var,str) sprintf(str,"%hu",var);

#define SETINT2(var,str) *var=atoi(str);
#define GETINT2(var,str) sprintf(str,"%d",var);

#define SETBYTE(var,str) str2nbyte(str,var,sizeof(var))
#define GETBYTE(var,str) nbyte2str(str,var,sizeof(var))

void str2nbyte(char *str,unsigned char *byte,size_t size)
{
/* convert string to byte, e.g. str "818283" to byte 'abc' */
size_t c; char tmp[1024]; int i;
strcpy(tmp,str); for (c=0;c<strlen(tmp);++c) tmp[c]="toupper(tmp[c]);
" for="" (c="strlen(tmp);c<(size<<1);c++)" ;
="" {="" sscanf(&="" tmp[c<<1],"%2x",&="" i);="" byte[c]="i;" }
}

void="" nbyte2str(char="" *str,unsigned="" char="" *byte,size_t="" size)
{
="" *="" convert="" byte="" to="" string,="" e.g.="" 'abc'="" str="" "818283"=""
="" size_t="" c;
="" (="" c="0;" c<size;="" c++="" )="" sprintf(="" &str[c<<1],="" "%02x",="" );
="" str[size<<1]="0;
}

#define" setbcd(var,str,dec)="" str2nbcd(str,var,sizeof(var),dec)
#define="" getbcd(var,str,dec)="" nbcd2str(str,var,sizeof(var),dec)

void="" str2nbcd(char="" *bcd,size_t="" size,="" int="" decimals)
{
="" string="" bcd,="" "+012.3"="" bcd="" '01230c'="" length="" 3="" decimals="" 2="" s[1024],*p;="" c,="" strs="size<<1;
" if="" (str[0]="='-')" {s[strs-1]="D" ;="" str++;}
="" else="" (p="strchr(str,'.'))" *(p++)="0;" p="str+strlen(str);
" (strlen(str)="">c) memcpy(s,str+strlen(str)-c,c);
else {memset(s,'0',c-strlen(str)); memcpy(s+c-strlen(str),str,strlen(str));}
while((*p) && (c < strs-1)) s[c++]=*(p++);
while(c < strs-1) s[c++]='0';
str2nbyte(s,bcd,size);
}

void nbcd2str(char *str,unsigned char *bcd,size_t size,int decimals)
{
/* convert bcd to string, e.g. bcd '01230C' length 3 decimals 2 to str "+012.30" */
char s[1024]; size_t c, strs=size<<1;
nbyte2str(s,bcd,size);
if (s[strs-1]=='D') *(str++)='-'; else *(str++)='+';
for(c=0;c<strs-decimals-1;c++) *(str++)="s[c];
" if="" (decimals="">0) { *(str++)='.'; while (c<strs-1) *(str++)="s[c++];}
" *str="0;
}

static" char*="" str2upper(char="" *str)
{
="" unsigned="" i;
="" for="" (i="0;i<strlen(str);++i)" str[i]="toupper(str[i]);
" return="" str;
}

#ifdef="" saponwindows
#include="" <graph.h="">
static void getpassword(char *password,int length)
{
short activeChild;
int i = 0 ;
if (infile!=NULL) { INS("li","password","password",6,35,password); return; }
printf("%6.0s",""); printf("%-35s : ","password"); activeChild = _wggetactive();
if (activeChild != -1) _wgclose(activeChild);
activeChild = _wgopen("Logon"); _wgsetactive(activeChild); _outtext("password : ");
while ((*password++ = (char) _inchar()) != '\r') { if (i++ >= length - 1) break; }
*(--password) = 0; _wgclose (activeChild);
if (password[-i]=='?') printf("?\n"); else if (password[-i]==0) printf("\n"); else printf("*\n");
if (outfile!=NULL) { fprintf(outfile,"=%s\n","password"); if (password[-i]=='?') fprintf(outfile," 0) strncpy(lDestination,str2upper(s),3);
INS("li","client","client [101]",6,35,s);
if (strlen(s) > 0) strncpy(lClient,s,3);
do { INS("li","user","user",6,35,s); } while (s[0]==0);
if (strlen(s) > 0) strncpy(lUser,str2upper(s),12);
do { getpassword(s,sizeof(s)); if (s[0]=='?') help("li","password",""); } while ((s[0]=='?')||(s[0]==0));
if (strlen(s) > 0) strncpy(lPassword,str2upper(s),10);
INS("li","language","language [EN]",6,35,s);
if (strlen(s) > 0) strncpy(lLanguage,str2upper(s),1);
INS("li","mode","mode [R/3]/R/2",6,35,s);
if (strlen(s) > 0) strncpy(lMode,s,3);
if (strcmp(lMode,"R/2")==0) {
do { INS("li","gateway host","gateway host [clr3e10 ]",6,35,s); } while (s[0]==0);
if (strlen(s) > 0) strncpy(lGwhost,s,30);
do { INS("li","gateway service","gateway service [sapgw10 ]",6,35,s); } while (s[0]==0);
if (strlen(s) > 0) strncpy(lGwservice,s,30); }
else {
INS("li","hostname","hostname [clr3e10]",6,35,s);
if (strlen(s) > 0) strncpy(lHostname,s,30);
INS("li","system number","system number [10]",6,35,s);
if (strlen(s) > 0) strncpy(lSysnr,s,2);
INS("li","gateway host","gateway host [clr3e10]",6,35,s);
if (strlen(s) > 0) strncpy(lGwhost,s,30);
INS("li","gateway service","gateway service [sapgw10 ]",6,35,s);
if (strlen(s) > 0) strncpy(lGwservice,s,30); }
INS("li","trace","trace on/[off]",6,35,s);
if (strlen(s) > 0) strncpy(lTrace,s,3); NL;

/* logon settings */
RfcOptions->destination = lDestination;
RfcOptions->client = lClient;
RfcOptions->user = lUser;
RfcOptions->password = lPassword;
RfcOptions->language = lLanguage;
if (strcmp (lMode,"R/2")==0) {
RfcOptions->mode = RFC_MODE_CPIC;
if (lGwhost[0] == 0) RfcConnoptCpic->gateway_host = NULL;
else RfcConnoptCpic->gateway_host = lGwhost;
if (lGwservice[0] == 0) RfcConnoptCpic->gateway_service = NULL;
else RfcConnoptCpic->gateway_service = lGwservice;
RfcOptions->connopt = RfcConnoptCpic; }
else {
RfcOptions->mode = RFC_MODE_R3ONLY;
if (lHostname[0] == 0) RfcConnoptR3only->hostname = NULL;
else RfcConnoptR3only->hostname = lHostname;
if (lSysnr[0] != 0) RfcConnoptR3only->sysnr = atoi(lSysnr);
if (lGwhost[0] == 0) RfcConnoptR3only->gateway_host = NULL;
else RfcConnoptR3only->gateway_host = lGwhost;
if (lGwservice[0] == 0) RfcConnoptR3only->gateway_service = NULL;
else RfcConnoptR3only->gateway_service = lGwservice;
RfcOptions->connopt = RfcConnoptR3only; }
if ((0 == strcmp(lTrace,"on"))||(0==strcmp(lTrace,"ON"))) RfcOptions->trace = 3;
else RfcOptions->trace = 0;

/* open connection */
OUT("Opening...",4); NL; hRfc = RfcOpen(RfcOptions); LOG(hRfc,"RfcOpen called","");
return hRfc;
}

void WIN_DLL_EXPORT_FLAGS rfc_error(char *operation)
{
#ifdef SAPonNT
char s[16];
#endif
RFC_ERROR_INFO RfcErrorInfo;
OUT("RFC error",0);
OUTS("operation/code",0,15,operation);
memset(&RfcErrorInfo,0,sizeof(RfcErrorInfo));
RfcLastError(&RfcErrorInfo);
OUTS("key",0,15,RfcErrorInfo.key);
OUTS("status",0,15,RfcErrorInfo.status);
OUTS("message",0,15,RfcErrorInfo.message);
OUTS("internal status",0,15,RfcErrorInfo.intstat); NL;
RfcClose (RFC_HANDLE_NULL);
#ifdef SAPonNT
INS("","","Quit? [y]",4,24,s);
#endif
exit(1);
}

/*
------------------------------------------------------------------------

Call function Y_SD_COA_SHIPINFO_DOWN
exporting
IN_VBELN structure VBELN length 10 number of fields 1
importing
OUT_SHIPREC structure YSD_COASHP length 475 number of fields 34
tables
exceptions

------------------------------------------------------------------------
*/

RFC_RC WIN_DLL_EXPORT_FLAGS y_sd_coa_shipinfo_down(RFC_HANDLE hRfc
,VBELN *eInVbeln
,YSD_COASHP *iOutShiprec
,char *xException)
{

/* RFC variables */
RFC_PARAMETER Exporting[2];
RFC_PARAMETER Importing[2];
RFC_TABLE Tables[1];
RFC_RC RfcRc;
char *RfcException = NULL;

/* install structures */

if (handleOfVBELN==0) {

RfcRc = RfcInstallStructure("VBELN",
typeOfVBELN,
ENTRIES(typeOfVBELN),
&handleOfVBELN);

if (RfcRc != RFC_OK) rfc_error("RfcInstallStructure"); }

if (handleOfYSD_COASHP==0) {

RfcRc = RfcInstallStructure("YSD_COASHP",
typeOfYSD_COASHP,
ENTRIES(typeOfYSD_COASHP),
&handleOfYSD_COASHP);

if (RfcRc != RFC_OK) rfc_error("RfcInstallStructure"); }

/* define export params */

Exporting[0].name = "IN_VBELN";
Exporting[0].nlen = 8;
Exporting[0].type = handleOfVBELN;
Exporting[0].leng = sizeof(VBELN);
Exporting[0].addr = eInVbeln;

Exporting[1].name = NULL;

Tables[0].name = NULL;

/* call function module */
RfcRc = RfcCall(hRfc,"Y_SD_COA_SHIPINFO_DOWN",Exporting,Tables);
LOG(hRfc,"RfcCall called","");

switch (RfcRc) {

case RFC_OK :

/* define import params */

Importing[0].name = "OUT_SHIPREC";
Importing[0].nlen = 11;
Importing[0].type = handleOfYSD_COASHP;
Importing[0].leng = sizeof(YSD_COASHP);
Importing[0].addr = iOutShiprec;

Importing[1].name = NULL;

/* receive results */
RfcRc = RfcReceive(hRfc,Importing,Tables,&RfcException);
LOG(hRfc,"RfcReceive called","");

switch (RfcRc) {
case RFC_SYS_EXCEPTION : strcpy(xException,RfcException);
case RFC_EXCEPTION : strcpy(xException,RfcException); }

}

return RfcRc;
}

RFC_RC WIN_DLL_EXPORT_FLAGS cll_y_sd_coa_shipinfo_down(RFC_HANDLE hRfc)
{

/*
---------------------------------------------------
begin of caller example code
replace the example code with your code
---------------------------------------------------
*/

/* RFC variables */
static RFC_RC RfcRc;
char s[1024];

/* param variables */
VBELN eInVbeln;
YSD_COASHP iOutShiprec;
char xException[256];
char x[276];

help("f", "", "");

INS("i","","Input? [y]/n",4,24,s); NL;
while ((s[0]!='n') && (s[0]!='N')) {

/* init export parameters */
SETCHAR(eInVbeln.Vbeln,"");

/* input export parameters */
OUT("exporting",6);
OUT("IN_VBELN",8); NL;
do { INS("esi","IN_VBELN","Fill structure? y/n",4,24,s); } while (s[0]==0); NL;
if ((s[0]=='y')||(s[0]=='Y')) {
INS("esfi","IN_VBELN","VBELN",10,30,s); SETCHAR(eInVbeln.Vbeln,s);
OUT("IN_VBELN",8); NL; }

INS("c","","Call? [y]/n",4,24,s); NL;
if ((s[0]!='n') && (s[0]!='N')) { OUT("Calling...",4); NL;

/* call RFC function */
RfcRc = y_sd_coa_shipinfo_down(hRfc
,&eInVbeln
,&iOutShiprec
,xException);

switch (RfcRc) {

case RFC_OK :

/* display importing parameters */
OUT("importing",6);
OUT("OUT_SHIPREC",8); NL;
INS("iso","OUT_SHIPREC","Display structure? [y]/n",4,24,s); NL;
if ((s[0] != 'n')&&(s[0] != 'N')) {
GETCHAR(iOutShiprec.Yyshipno,s);
OUTS("YYSHIPNO",10,30,s);
GETCHAR(iOutShiprec.Yyship1,s);
OUTS("YYSHIP1",10,30,s);
GETCHAR(iOutShiprec.Yyship2,s);
OUTS("YYSHIP2",10,30,s);
GETCHAR(iOutShiprec.Yyship3,s);
OUTS("YYSHIP3",10,30,s);
GETCHAR(iOutShiprec.Yyship4,s);
OUTS("YYSHIP4",10,30,s);
GETCHAR(iOutShiprec.Yyship5,s);
OUTS("YYSHIP5",10,30,s);
GETCHAR(iOutShiprec.Yyship6,s);
OUTS("YYSHIP6",10,30,s);
GETCHAR(iOutShiprec.Yycarcod,s);
OUTS("YYCARCOD",10,30,s);
GETBCD(iOutShiprec.Yycomlbs,s, 2);
OUTS("YYCOMLBS",10,30,s);
GETBCD(iOutShiprec.Yycodfee,s, 2);
OUTS("YYCODFEE",10,30,s);
GETBCD(iOutShiprec.Yycodto,s, 2);
OUTS("YYCODTO",10,30,s);
GETBCD(iOutShiprec.Yyvarlbs,s, 2);
OUTS("YYVARLBS",10,30,s);
GETCHAR(iOutShiprec.Yynull01,s);
OUTS("YYNULL01",10,30,s);
GETNUM(iOutShiprec.Yyphone,s);
OUTS("YYPHONE",10,30,s);
GETCHAR(iOutShiprec.Yypickby,s);
OUTS("YYPICKBY",10,30,s);
GETCHAR(iOutShiprec.Yypackby,s);
OUTS("YYPACKBY",10,30,s);
GETCHAR(iOutShiprec.Yysentby,s);
OUTS("YYSENTBY",10,30,s);
GETCHAR(iOutShiprec.Yyautinv,s);
OUTS("YYAUTINV",10,30,s);
GETCHAR(iOutShiprec.Yynull02,s);
OUTS("YYNULL02",10,30,s);
GETDATE(iOutShiprec.Yyshipdt,s);
OUTS("YYSHIPDT",10,30,s);
GETCHAR(iOutShiprec.Yyswtrk,s);
OUTS("YYSWTRK",10,30,s);
GETDATE(iOutShiprec.Yyspdate,s);
OUTS("YYSPDATE",10,30,s);
GETTIME(iOutShiprec.Yysptime,s);
OUTS("YYSPTIME",10,30,s);
GETDATE(iOutShiprec.Yyinvdat,s);
OUTS("YYINVDAT",10,30,s);
GETCHAR(iOutShiprec.Yyinvno,s);
OUTS("YYINVNO",10,30,s);
GETCHAR(iOutShiprec.Yyproces,s);
OUTS("YYPROCES",10,30,s);
GETBCD(iOutShiprec.Yycrdfee,s, 2);
OUTS("YYCRDFEE",10,30,s);
GETCHAR(iOutShiprec.Yyshpwo,s);
OUTS("YYSHPWO",10,30,s);
GETCHAR(iOutShiprec.Yyshpws,s);
OUTS("YYSHPWS",10,30,s);
GETCHAR(iOutShiprec.Yyshpwcc,s);
OUTS("YYSHPWCC",10,30,s);
GETCHAR(iOutShiprec.Yybillto,s);
OUTS("YYBILLTO",10,30,s);
GETCHAR(iOutShiprec.Yydlrpo,s);
OUTS("YYDLRPO",10,30,s);
GETCHAR(iOutShiprec.Yymoney,s);
OUTS("YYMONEY",10,30,s);
GETCHAR(iOutShiprec.Yydlrcod,s);
OUTS("YYDLRCOD",10,30,s);
OUT("OUT_SHIPREC",8); NL; }

break;

case RFC_EXCEPTION :

/* exception raised */
OUT("exception",6);
do { sprintf(x,"%s raised. Help? ?/[n]",xException); INS("xo",xException,x,8,42,s); } while (s[0]=='?'); NL;

break;

case RFC_SYS_EXCEPTION : rfc_error("system exception raised");

case RFC_FAILURE : rfc_error("failure");

default : rfc_error("other failure");

}

}

do { INS("a","","Again? y/n",4,24,s); } while (s[0]==0); NL;
}

/*
---------------------------------------------------
end of caller example code
---------------------------------------------------
*/

return RfcRc;
}

/*
------------------------------------------------------------------------

main program

------------------------------------------------------------------------
*/

main(int argc, char **argv)
{

/* RFC variables */
static RFC_OPTIONS RfcOptions;
static RFC_CONNOPT_CPIC RfcConnoptCpic;
static RFC_CONNOPT_R3ONLY RfcConnoptR3only;
static RFC_ENV RfcEnv;
static RFC_HANDLE hRfc;
static RFC_RC RfcRc;
static char d;
char s[1024];
int count;

/* program arguments */
outfile = NULL; infile = NULL; logfile = NULL;
for (count=0;count
AnswerRe: Error Registering DLL but not .EXE ?? Pin
Chris Losinger23-Jul-04 9:25
professionalChris Losinger23-Jul-04 9:25 
GeneralUpdateAllViews() and Multi-Thread Pin
Danny Gilbert23-Jul-04 6:07
Danny Gilbert23-Jul-04 6:07 
GeneralRe: UpdateAllViews() and Multi-Thread Pin
vcplusplus23-Jul-04 7:21
vcplusplus23-Jul-04 7:21 
GeneralCFile question Pin
Shay Harel23-Jul-04 5:53
Shay Harel23-Jul-04 5:53 
GeneralRe: CFile question Pin
valikac23-Jul-04 6:10
valikac23-Jul-04 6:10 
GeneralRe: CFile question Pin
Shay Harel23-Jul-04 6:19
Shay Harel23-Jul-04 6:19 
GeneralPrinting question .... probably easy! Pin
mike-o23-Jul-04 5:33
mike-o23-Jul-04 5:33 
GeneralRe: Printing question .... probably easy! Pin
PJ Arends23-Jul-04 6:52
professionalPJ Arends23-Jul-04 6:52 
GeneralPossible Memory Leak issues Pin
Sameer Handa23-Jul-04 4:14
Sameer Handa23-Jul-04 4:14 
GeneralRe: Possible Memory Leak issues Pin
palbano23-Jul-04 5:56
palbano23-Jul-04 5:56 
GeneralSingleton with polymorphic classes Pin
kylur23-Jul-04 3:49
kylur23-Jul-04 3:49 
GeneralRe: Singleton with polymorphic classes Pin
palbano23-Jul-04 8:11
palbano23-Jul-04 8:11 
GeneralRe: Singleton with polymorphic classes Pin
kylur24-Jul-04 16:31
kylur24-Jul-04 16:31 
GeneralRe: Singleton with polymorphic classes Pin
palbano25-Jul-04 19:14
palbano25-Jul-04 19:14 
GeneralRe: Singleton with polymorphic classes Pin
Ryan Binns25-Jul-04 18:41
Ryan Binns25-Jul-04 18:41 
GeneralRe: Singleton with polymorphic classes Pin
kylur29-Jul-04 3:20
kylur29-Jul-04 3:20 
GeneralValidating a file path Pin
Joel Holdsworth23-Jul-04 0:20
Joel Holdsworth23-Jul-04 0:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.