[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using a C-language API DLL

Posted on 1997-10-08
4
Medium Priority
?
207 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
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 opening and writing to files in the C programming language.

656 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