Click here to Skip to main content
15,911,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Attach child toolbar to parent toolbar Pin
Cedric Moonen18-Dec-08 2:57
Cedric Moonen18-Dec-08 2:57 
GeneralRe: Attach child toolbar to parent toolbar Pin
Pryabu18-Dec-08 18:11
Pryabu18-Dec-08 18:11 
AnswerRe: Attach child toolbar to parent toolbar Pin
Hamid_RT18-Dec-08 5:32
Hamid_RT18-Dec-08 5:32 
GeneralRe: Attach child toolbar to parent toolbar Pin
Pryabu18-Dec-08 17:45
Pryabu18-Dec-08 17:45 
QuestionHow to get the message from a service Pin
debonair12345618-Dec-08 1:00
debonair12345618-Dec-08 1:00 
AnswerRe: How to get the message from a service Pin
Mark Salsbery18-Dec-08 6:46
Mark Salsbery18-Dec-08 6:46 
GeneralRe: How to get the message from a service Pin
debonair12345618-Dec-08 17:04
debonair12345618-Dec-08 17:04 
QuestionLoading a Delphi DLL into a VC++ application Pin
Cronoz17-Dec-08 23:35
Cronoz17-Dec-08 23:35 
Hello,

I need to use a DLL which was written in Delphi in my VC++ windows forms application. However, Delphi doesn't generate a .LIB file when creating DLL's so I have to create a .LIB file manually. I have already written a .h file for the functions that I need to use. The .h code is shown below.
<br />
1	//File: CITRemote.h  <br />
2	extern "C" {  <br />
3	  <br />
4	__declspec(dllexport) void* __stdcall CITRemote_create(  <br />
5	   void *parameters );  <br />
6	  <br />
7	__declspec(dllexport) int __stdcall CITRemote_open(  <br />
8	   void* handle, void* parameters);  <br />
9	  <br />
10	__declspec(dllexport) int __stdcall CITRemote_close(  <br />
11	   void *handle );  <br />
12	}  <br />


From what I understand I need to create a .DEF file to generate a .LIB file with the LIB command: lib /def:CITRemote.def. The .DEF file I wrote is shown below.
<br />
1	;File: CITRemote.DEF  <br />
2	LIBRARY "CITREMOTE"  <br />
3	  <br />
4	EXPORTS  <br />
5	    CITRemote_open  <br />
6	    CITRemote_close  <br />
7	    CITRemote_create  <br />


The name of the DLL is CITRemote.dll and uses the STD calling convention. After I execute the LIB command, CITRemote.lib and object CITRemote.exp are created. I added the lib and exp file into my project in the 'Resource Files' filter. When i try to call for example the CITRemote_create function, I get the following error:
<br />
Linking... <br />
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification <br />
1>NTP checker.obj : error LNK2001: unresolved external symbol "extern "C" void * __stdcall CITRemote_create(void *)" (?CITRemote_create@@$$J14YGPAXPAX@Z) <br />
1>C:\Documents and Settings\Aartun\My Documents\Visual Studio 2008\Projects\NTP checker\Debug\NTP checker.exe : fatal error LNK1120: 1 unresolved externals <br />

So i guess the implementation of the function isn't found, thus meaning it doesn't link the DLL. But what am I doing wrong, did I miss something?

Thanks in advance.

Note: I'm using Visual Studio 2008 Proffesional and all the files(dll, lib, h, exp and def) are in the same directory.
AnswerRe: Loading a Delphi DLL into a VC++ application Pin
Stuart Dootson18-Dec-08 0:41
professionalStuart Dootson18-Dec-08 0:41 
Questionhow to get accuracy as well as quick interface response Pin
anilaabc17-Dec-08 21:57
anilaabc17-Dec-08 21:57 
AnswerRe: how to get accuracy as well as quick interface response Pin
Stuart Dootson17-Dec-08 22:58
professionalStuart Dootson17-Dec-08 22:58 
GeneralRe: how to get accuracy as well as quick interface response Pin
anilaabc18-Dec-08 18:10
anilaabc18-Dec-08 18:10 
QuestionCButton color change Pin
Paulraj G17-Dec-08 21:55
Paulraj G17-Dec-08 21:55 
AnswerRe: CButton color change Pin
Naveen17-Dec-08 22:34
Naveen17-Dec-08 22:34 
GeneralRe: CButton color change Pin
Paulraj G17-Dec-08 23:03
Paulraj G17-Dec-08 23:03 
GeneralRe: CButton color change Pin
CPallini17-Dec-08 23:18
mveCPallini17-Dec-08 23:18 
GeneralRe: CButton color change Pin
Naveen17-Dec-08 23:43
Naveen17-Dec-08 23:43 
GeneralRe: CButton color change Pin
Code-o-mat17-Dec-08 23:24
Code-o-mat17-Dec-08 23:24 
GeneralRe: CButton color change Pin
Naveen17-Dec-08 23:32
Naveen17-Dec-08 23:32 
GeneralRe: CButton color change Pin
Code-o-mat17-Dec-08 23:51
Code-o-mat17-Dec-08 23:51 
AnswerRe: CButton color change Pin
Iain Clarke, Warrior Programmer17-Dec-08 23:17
Iain Clarke, Warrior Programmer17-Dec-08 23:17 
GeneralRe: CButton color change Pin
Naveen17-Dec-08 23:55
Naveen17-Dec-08 23:55 
AnswerRe: CButton color change Pin
Hamid_RT17-Dec-08 23:34
Hamid_RT17-Dec-08 23:34 
AnswerRe: CButton color change Pin
Jijo.Raj18-Dec-08 0:21
Jijo.Raj18-Dec-08 0:21 
QuestionATLASSERT question Pin
monsieur_jj17-Dec-08 21:46
monsieur_jj17-Dec-08 21:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.