API ORACLE FORMS

StevosTeen Messages postés 1 Date d'inscription jeudi 16 janvier 2003 Statut Membre Dernière intervention 23 juillet 2003 - 23 juil. 2003 à 18:20
houari2009 Messages postés 1 Date d'inscription lundi 7 janvier 2008 Statut Membre Dernière intervention 4 août 2008 - 4 août 2008 à 17:03
stevosteen

Je cherche a utiliser l'API FORMS ORACLE pour charger des modules forms .fmb mais la compilation donne:

error LNK2001: unresolved external symbol _d2fctxde_Destroy

ou _d2fctxde_Destroy est une fonction déclarée dans le d2fctx.h

Quelqu'un peut-il m'aider???
Merci

Stève

*******FormName.c

#include <StdAfx.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>

#include "d2fctx.h"
#include "d2ffmd.h"

int main (int argc, unsigned char *argv[])
{
d2fctxa ctx_attr;
d2fctx *ctx;
d2ffmd *form;
text *form_name;
/* Check arguments */
if ( argc != 2 )
{
fprintf(stderr, "USAGE: %s <filename>\n", argv[0]);
exit(1);
}
/* Create Forms API context */
ctx_attr.mask_d2fctxa = (ub4)0;
if ( d2fctxcr_Create(&ctx, &ctx_attr) != D2FS_SUCCESS )
{
fprintf(stderr, "Error creating Forms API context\n");
exit(1);
}
/* Load the form module into memory */
if ( d2ffmdld_Load(ctx, &form, argv[1], FALSE) != D2FS_SUCCESS )
{
fprintf(stderr, "Failed to load form module: %s\n", argv[1]);
exit(1);
}
/* Get the name of the form module */
if ( d2ffmdg_name(ctx, form, &form_name) != D2FS_SUCCESS )
{
fprintf(stderr, "Error getting the name of the form module\n");
}
else
{
/* Print the name of the form, then free it */
printf ("The name of the form is %s\n", form_name);
free(form_name);
}
/* Destroy the in-memory form */
if ( d2ffmdde_Destroy(ctx, form) != D2FS_SUCCESS )
{
fprintf(stderr, "Error destroying form module\n");
}
/* Close the API and destroy context */
d2fctxde_Destroy(ctx);
return 0;
}

*********D2FCTX.H
/*
NAME
D2FCTX.H -- Dev2K Forms API ConTeXt declarations

DESCRIPTION
Contains the public declarations for the Forms API ConTeXt

NOTES
The Forms API context (d2fctx) is required before any FAPI
function can be called. It's typically the first argument
passed to any FAPI function. Creating the FAPI context
initializes all the internal subsystems for the Forms API.

PUBLIC FUNCTIONS
d2fctxcr_Create - Create and initialize the FAPI context
d2fctxde_Destroy - Destroy the FAPI context and perform cleanup
d2fctxga_GetAttributes -- Get the specified attributes from the FAPI ctx
d2fctxsa_SetAttributes -- Set the specified attributes in the FAPI ctx
d2fctxcn_Connect - Connect to a database
d2fctxdc_Disconnect - Disconnect from the current database
d2fctxbv_BuilderVersion - Returns the FAPI version number
d2fctxcf_ConvertFile - Converts a file between text <-> binary
d2fctxbi_BuiltIns - returns a 2D-arr of builtin names, by package
*/

#ifndef D2FCTX
#define D2FCTX

#ifndef ORATYPES
# include "ORATYPES.H"
#endif

#ifndef D2FPRIV
# include "d2fpriv.h"
#endif

/* C++ Support */
#ifdef __cplusplus
extern "C"
{
#endif

/*
** Attribute masks for the mask_d2fctxa field of the d2fctxa structure.
** Setting an attribute mask means that the corresponding field of the
** d2fctxa structure contains data that should be processed in the
** function call. For example:
**
** {
** d2fctxa attr;
**
** attr.mask_d2fctxa = ( D2FCTXACDATA | D2FCTXAMCALLS );
** attr.cdata_d2fctxa = clientdata;
** attr.d2fmalc_d2fctxa = mymalloc;
** attr.d2fmfre_d2fctxa = myfree;
** attr.d2fmrlc_d2fctxa = myrealloc;
**
** d2fctxcr_Create(&ctx, &attr);
** }
**
** Something similar can be done for Set and Get attributes.
**
*/
#define D2FCTXACDATA 0x00000001L /* client data */
#define D2FCTXAMCALLS 0x00000002L /* Memory Callbacks */

/*
** This flag puts the API into a special "translation" mode used by
** Oracle OTM and other 3rd party localization tools. No other clients
** should set this flag - it will cause serious data corruption.
*/
#define D2FCTXATRNSMODE 0x80000000L /* Translation Mode */

typedef struct d2fctxa
{
ub4 mask_d2fctxa;
dvoid *cdata_d2fctxa; /* [CSG] */
d2fmalc d2fmalc_d2fctxa; /* [C ] */
d2fmfre d2fmfre_d2fctxa; /* [C ] */
d2fmrlc d2fmrlc_d2fctxa; /* [C ] */
} d2fctxa;

/*
** File conversion direction, used in converting fmb<->fmt conversion
** (used in d2fctxcf_ConvertFile)
*/
#define BINTOTEXT 1
#define TEXTTOBIN 2


/*
** Functions:
**
** d2fctxcr_Create - Create the Forms API context given an attribute
** mask structure. This is typically the first function call in a
** FAPI program.
**
** d2fctxde_Destroy - Destroy the Forms API context. This is typically
** the final call in a FAPI program. After this call, no further
** FAPI calls are possible.
**
** d2fctxsa_SetAttributes - Set attributes in the FAPI context after
** the context has already been created. Not all FAPI attributes
** are settable (only those marked with 'S' in the comments above).
**
** d2fctxga_GetAttributes - Get attributes from the FAPI context after
** the context has already been created. Not all FAPI attributes
** are gettable (only those marked with 'G' in the comments above).
**
** d2fctxcn_Connect - Establish a database connection given a connect
** string (username/password@database). Alternatively, you may
** directly supply an Oracle 'hstdef' pointer for the connection.
**
** d2fctxdc_Disconnect - Disconnect from the current database if one
** has been established.
**
** d2fctxbv_BuilderVersion - Return the version of the Forms API
** currently running. The format of the version number is a decimal
** number of the form 12334455, where 1 is the first digit, 2 is the
** second digit, 33 is the third digit, 4 is the fourth digit, and 5
** is the fifth digit. For example, a return value of 60052902 means
** version 6.0.5.29.2. This is the same version number shown in the
** Form Builder's "about box".
**
** d2fctxcf_ConvertFile - Convert an .fmb file to an .fmt file or vice-
** versa. The filename is the filename on disk, the modtyp is one of
** the module types (e.g. D2FFO_FORM_MODULE), and the direction is
** either BINTOTEXT or TEXTTOBIN (defined above).
**
** d2fctxbi_BuiltIns - Allocates and returns an array of an array of
** strings listing each of the PL/SQL Built-in functions, organized
** by package name. Each row of the array is an array of strings;
** the first string in each row is the package name, and the rest of
** the strings in that row are the PL/SQL Built-ins in that package.
** This routine allocates memory for each string, so it should only
** be called once in order to avoid memory leaks.
**
*/

ORA_RETTYPE(d2fstatus) d2fctxcr_Create( d2fctx **ppd2fctx,d2fctxa *d2fctx_attr );
ORA_RETTYPE(d2fstatus) d2fctxde_Destroy( d2fctx *pd2fctx );
ORA_RETTYPE(d2fstatus) d2fctxsa_SetAttributes( d2fctx *pd2fctx,
d2fctxa *pd2fct_attr );
ORA_RETTYPE(d2fstatus) d2fctxga_GetAttributes( d2fctx *pd2fctx,
d2fctxa *pd2fct_attr );
ORA_RETTYPE(d2fstatus) d2fctxcn_Connect( d2fctx *pd2fctx, text *con_str,
dvoid *phstdef);
ORA_RETTYPE(d2fstatus) d2fctxdc_Disconnect( d2fctx *pd2fctx );
ORA_RETTYPE(d2fstatus) d2fctxbv_BuilderVersion( d2fctx *pd2fctx,
number *version );
ORA_RETTYPE(d2fstatus) d2fctxcf_ConvertFile( d2fctx *pd2fctx,
text *filename,
d2fotyp modtyp,
number direction );
ORA_RETTYPE(d2fstatus) d2fctxbi_BuiltIns(d2fctx *pd2fctx, text ****pparr);

/* C++ Support */
#ifdef __cplusplus
}
#endif

#endif /* D2FCTX */

2 réponses

BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019
23 juil. 2003 à 18:34
y a pas un lib a donner au linker ?
BruNews, ciao...
0
houari2009 Messages postés 1 Date d'inscription lundi 7 janvier 2008 Statut Membre Dernière intervention 4 août 2008
4 août 2008 à 17:03
javascript:Insert_Emoticon('/imgs2/smile_approjavascript:Insert_Emoticon('/imgs2/smile_tongue.gif');ve.gif');
0
Rejoignez-nous