dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

problem with Notes C++ API with MFC in Visual Studio 2008 - lotus-notes-programmer

This is a discussion on problem with Notes C++ API with MFC in Visual Studio 2008 - lotus-notes-programmer ; Hi. Some years ago I wrote a MFC program using Visual Studio 6.0. There is some code in it which makes use of the Lotus C++ API to do some database action. The code compiles just fine in Visual Studio ...


Home > Database Forum > Other Technologies > lotus-notes-programmer > problem with Notes C++ API with MFC in Visual Studio 2008

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 04-02-2008, 09:27 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default problem with Notes C++ API with MFC in Visual Studio 2008

Hi.

Some years ago I wrote a MFC program using Visual Studio 6.0.
There is some code in it which makes use of the Lotus C++ API to do
some database action.

The code compiles just fine in Visual Studio 6.0 and was then "ported"
to Visual Studio 2003.NET with
no problems at all.

But after switching to Visual Studio 2008 (and 2005 in between) the
code could not compile anymore.

Here is an excerpt from the errors VS 2008 gives me (it's in german
but the error codes are in there):

....
1>c:\notescpp\include\global.h(1116) : error C2371: 'QWORD':
Neudefinition; unterschiedliche Basistypen
1> c:\programme\microsoft sdks\windows\v6.0a\include
\windns.h(38): Siehe Deklaration von 'QWORD'
1>c:\notescpp\include\nsfdata.h(73) : error C2371: 'DBID':
Neudefinition; unterschiedliche Basistypen
1> c:\programme\microsoft sdks\windows\v6.0a\include
\oledb.h(718): Siehe Deklaration von 'DBID'
1>c:\programme\microsoft visual studio 9.0\myprojects\stop ohne
namespace\stopview.cpp(5140) : error C2039: 'Innards': Ist kein
Element von 'tagDBID'
1> c:\programme\microsoft sdks\windows\v6.0a\include
\oledb.h(704): Siehe Deklaration von 'tagDBID'
....

To me it seems that QWORD and DBID are defined with the same names in
the Lotus API and in the MFC
include files.


I tried to work around this redefinition by using a namespace for the C
++ API by using:

namespace LN
{
#include "lncppapi.h" // Notes C++ API
}

And then changing every occurrance of Notes types and functions to
LN::function (eg. LN::LNDatabase).


The code compiles correct now but now I have a linker problem with 100+
+ errors (unresolved external symbols):
....
1>StOPDoc.obj : error LNK2001: Nicht aufgelöstes externes Symbol
""public: __thiscall LN::LNDocument::~LNDocument(void)" (??
1LNDocument@LN@@QAE@XZ)".
1>StOPView.obj : error LNK2001: Nicht aufgelöstes externes Symbol
""public: __thiscall LN::LNDocument::~LNDocument(void)" (??
1LNDocument@LN@@QAE@XZ)".
1>LeistungsBaum.obj : error LNK2019: Verweis auf nicht aufgelöstes
externes Symbol ""public: __thiscall
LN::LNDocument::~LNDocument(void)" (??1LNDocument@LN@@QAE@XZ)" in
Funktion "__catch$?OnLButtonDblClk@CLeistungsBaum@@IAEXIVCPo int@@@Z
$0".
.....

So ... is there a better (working) way of making newest version of VS
compile with the newest version of the
Lotus C++ API ?


I would appreciate every hint with guides me in the right direction.

Lars

Reply With Quote
  #2  
Old 04-11-2008, 05:34 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: problem with Notes C++ API with MFC in Visual Studio 2008

I have the same problem. Have you find any solution to resolve one?
Reply With Quote
  #3  
Old 04-14-2008, 08:29 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: problem with Notes C++ API with MFC in Visual Studio 2008

On 11 Apr., 11:34, bobi.fo...@gmail.com wrote:
> I have the same problem. Have you find any solution to resolve one?


I did not find a solution yet.

The only thing I can do is using VS 2003, which does not have this
problem.
There must be a better way ^^

Lars
Reply With Quote
  #4  
Old 11-14-2008, 08:38 AM
Database Newbie
 
Join Date: Nov 2008
Posts: 1
swang2008 is on a distinguished road
Default Re: problem with Notes C++ API with MFC in Visual Studio 2008

In project property page=> C/C++ tab => General => additional include directories

the Notes C++ API include directory should be listed prior to the Microsoft Platform SDK one.

HTH
Reply With Quote
  #5  
Old 11-10-2009, 06:30 AM
Database Newbie
 
Join Date: Nov 2009
Posts: 1
meghakolom is on a distinguished road
Default Re: problem with Notes C++ API with MFC in Visual Studio 2008

Hello All,

I am trying to compile the Notes C++ API with MFC on VS2008 and facing the linker issues.
Was there any workaround for this issue? I am not sure, but will having the Lotus notes library recompiled in VS2008 get the issue resolved?

Please let me know youe views on this.

-Megha
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 03:15 AM.