?
Solved

Using a C-language API DLL

Posted on 1997-10-08
4
Medium Priority
?
206 Views
Last Modified: 2006-11-17
Environment: Windows 95 and MS VC++ 1.52
I am trying to make a call to a function in a DLL (16-bit) and I keep getting the following Prog Error:
" Your program is making an invalid dynamic link call to a .DLL file"
I do have the .lib in the import libraries of the Linker Options, in the imports section of my .def file, and in the Directories Libraries path.

Following is my program:

#define ELOG_MODULENAME   "TEST"
#include <stdio.h>      /* needed for ELOGPUB.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 lCoreConectRec = 0;  
   int  iRV            = 0;

   printf("Hello1\n");  
   
  /* RctXInitializeCORESession is the function that I have been trying to call, which is in a third-party DLL*/
   iRV = RctXInitializeCORESession( &lCoreSession,
                                    &lCoreConectRec,
                                    "RCTX_A",
                                    "FREDUSER",
                                    "" );  
   printf("Hello2\n");                                    
}

I would really appreciate any help in this matter. Thanks a million!!!
0
Comment
Question by:achimala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Srw
ID: 1255664
Do you get the error when you call RctX...(), or when you run the program?

Are you sure that the actual DLL being loaded is the 16-bit version?
0
 

Author Comment

by:achimala
ID: 1255665
I am getting the error, when I run the .exe (which means, the .exe is being created with no errors!!!). And I am sure the DLL being loaded is a 16-bit version. Some of my friends suggested that I check whether the DLLs have been registered or not. I did run the regedit and searched for them, but couldn't find them there. Is this a problem?  
0
 
LVL 7

Accepted Solution

by:
faster earned 140 total points
ID: 1255666
Your exe is windows console problem, but I remember that in VC 1.52, it does not support this yet. (probably there is noo 16 bit console program).  So your program is actually a DOS program and therefore can not use dll.

Try to create a normal windows program (which use WinMain instead of main()), and see whether it is successful.
0
 
LVL 7

Expert Comment

by:faster
ID: 1255667
By "windows console problem", I actually mean "windows console program".
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question