Link to home
Start Free TrialLog in
Avatar of achimala
achimala

asked on

Calling a DLL from a C prog

Hi,
How to make a call to a Dll in a C program and then create an exe.
Regards,
AC
Avatar of galkin
galkin

Could you clarify what exactly you want to do. Do you want to call function in a DLL from exe written in c?
Avatar of achimala

ASKER

Alex,
Thank you so much for responding. I have the following things: (I)An exe, which calls the functions in anohter DLL: The code is:
#include <stdio.h>  
#include <stdlib.h>
#include <string.h>
#include <rctpub.h>
#include <memory.h>
#include <malloc.h>
#include <windows.h>
#include <profpub.h>
#include <gtipub.h>
#include <actmpub.h>
#include <rctmsg.h>
#include <elogpub.h>
#include <rctxpub.h>
#include <fetixpub.h>

int main ( int argc, char * argv[] )
{
   long lCoreSession   = 0;
   long lSessionFolder = 0;  
   int  iRV            = 0;

iRV = RctXInitializeCORESession(&lCoreSession,
&lSessionFolder,"ApplName","FendId"," " );
return(0);
}/*Works fine: doing what it is supposed to do*/

(II)A dll: the code for which is:
#include <windows.h>
int _export FAR CDECL RctXInitializeCORESession(lCoreSession, lSessionFolder,ApplName, FendId, FendPwd);

(III)What I am trying to do is: Create another exe (of course written in C), wherein I would like to call the DLL that I have created in step II!
(IV)The reason for doing all this is to use these exe's in my Oracle*Forms applications.
Regards,
AC
 
What 's your compiler version ?
I am using Microsoft Visual C++ version 1.52 (16-bit).
ASKER CERTIFIED SOLUTION
Avatar of emmons
emmons

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK. I am trying to think back to 1.52.
You will need to change the project parameters.
Or, look in the help search for LINK, and let it tell you how to change the linking paramters.
In the dialog for linking, you will find an edit field for "Additional Libraries" that is where you add the yourlib.lib library entry.