Solved

Using a C-language API DLL

Posted on 1997-10-08
4
202 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
  • 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 70 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to communicate between two pc's through vb.net code ? 4 146
chcp 65001 File encoding 66 230
UPD maximums on Red Hat 6 109
Passing command line arguments in C 10 85
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…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

932 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now