Hi,

I've been tasked with writing a .dll to interface with GroupWise, in Visual
Studio C++ 6.0. This .dll is used by a Windows Service.

Currently, we already have two such .dlls: One is for Lotus, and one for
Exchange.

Ok, so I spent Thursday and Friday reading the documentation and running the
samples, then I coded over the weekend and all day today. I've got
everything written and compiling. I also I have played extensively with the
MAIL sample program included in the SDK, and so I've unit tested most of my
code in there. I'm feeling good about everything, but I have a big problem:
I can't build my .dll. I am new to c++, but not to c nor to programming.

Below is what I get when I try to compile, followed by the .mak file. Note:
The warnings are caused by including stdafx.h. I get the same warnings with
the MAIL sample, and yet everything will run just fine. You can see its
successful build log at the end of the message (I'm including stdafx.h so
that I get the warnings, too).


--------------------Configuration: MyGroupWise - Win32
Release--------------------
Compiling...
GroupWiseInterface.cpp
C:\PISource\Current\Applications\PIEmailSrv\MyGrou pWise\gwoapi.h(10941) :
warning C4099: 'Folder' : type name first seen using 'struct' now seen using
'class'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\shldisp.h(2364) : see
declaration of 'Folder'
C:\PISource\Current\Applications\PIEmailSrv\MyGrou pWise\gwoapi.h(10947) :
warning C4099: 'Folder2' : type name first seen using 'struct' now seen
using 'class'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\shldisp.h(2712) : see
declaration of 'Folder2'
C:\PISource\Current\Applications\PIEmailSrv\MyGrou pWise\gwoapi.h(10953) :
warning C4099: 'Folder3' : type name first seen using 'struct' now seen
using 'class'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\shldisp.h(3003) : see
declaration of 'Folder3'
MyGroupWise.cpp
C:\PISource\Current\Applications\PIEmailSrv\MyGrou pWise\gwoapi.h(10941) :
warning C4099: 'Folder' : type name first seen using 'struct' now seen using
'class'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\shldisp.h(2364) : see
declaration of 'Folder'
C:\PISource\Current\Applications\PIEmailSrv\MyGrou pWise\gwoapi.h(10947) :
warning C4099: 'Folder2' : type name first seen using 'struct' now seen
using 'class'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\shldisp.h(2712) : see
declaration of 'Folder2'
C:\PISource\Current\Applications\PIEmailSrv\MyGrou pWise\gwoapi.h(10953) :
warning C4099: 'Folder3' : type name first seen using 'struct' now seen
using 'class'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\shldisp.h(3003) : see
declaration of 'Folder3'
Generating Code...
Linking...
Creating library Release/MyGroupWise.lib and object
Release/MyGroupWise.exp
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWAttachment
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWAttachments
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWAddress
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWMessage
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWMessages
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWFolder
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWAccount3
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_CLSID_GroupWare
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWSession2
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWMessageList
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWFormattedText
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWRecipient
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWRecipients
GroupWiseInterface.obj : error LNK2001: unresolved external symbol
_IID_IGWFolders
Release/MyGroupWise.dll : fatal error LNK1120: 14 unresolved externals
Error executing link.exe.

MyGroupWise.dll - 15 error(s), 6 warning(s)



# Microsoft Developer Studio Generated NMAKE File, Based on MyGroupWise.dsp
!IF "$(CFG)" == ""
CFG=MyGroupWise - Win32 Debug
!MESSAGE No configuration specified. Defaulting to MyGroupWise - Win32
Debug.
!ENDIF

!IF "$(CFG)" != "MyGroupWise - Win32 Release" && "$(CFG)" != "MyGroupWise -
Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "MyGroupWise.mak" CFG="MyGroupWise - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "MyGroupWise - Win32 Release" (based on "Win32 (x86) Dynamic-Link
Library")
!MESSAGE "MyGroupWise - Win32 Debug" (based on "Win32 (x86) Dynamic-Link
Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF

!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF

!IF "$(CFG)" == "MyGroupWise - Win32 Release"

OUTDIR=.\Release
INTDIR=.\Release
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros

ALL : "$(OUTDIR)\MyGroupWise.dll" "$(OUTDIR)\MyGroupWise.bsc"


CLEAN :
-@erase "$(INTDIR)\apigw.obj"
-@erase "$(INTDIR)\apigw.sbr"
-@erase "$(INTDIR)\GroupWiseInterface.obj"
-@erase "$(INTDIR)\GroupWiseInterface.sbr"
-@erase "$(INTDIR)\Misc.obj"
-@erase "$(INTDIR)\Misc.sbr"
-@erase "$(INTDIR)\MyGroupWise.obj"
-@erase "$(INTDIR)\MyGroupWise.pch"
-@erase "$(INTDIR)\MyGroupWise.res"
-@erase "$(INTDIR)\MyGroupWise.sbr"
-@erase "$(INTDIR)\RegistryKey.obj"
-@erase "$(INTDIR)\RegistryKey.sbr"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\StdAfx.sbr"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\MyGroupWise.bsc"
-@erase "$(OUTDIR)\MyGroupWise.dll"
-@erase "$(OUTDIR)\MyGroupWise.exp"
-@erase "$(OUTDIR)\MyGroupWise.lib"

"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "NT" /D "WIN32" /D
"_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_AFXEXT"
/FR"$(INTDIR)\\" /Fp"$(INTDIR)\MyGroupWise.pch" /Yu"stdafx.h"
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c

..c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

..cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

..cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

..c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

..cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

..cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\MyGroupWise.res" /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\MyGroupWise.bsc"
BSC32_SBRS= \
"$(INTDIR)\apigw.sbr" \
"$(INTDIR)\GroupWiseInterface.sbr" \
"$(INTDIR)\Misc.sbr" \
"$(INTDIR)\MyGroupWise.sbr" \
"$(INTDIR)\RegistryKey.sbr" \
"$(INTDIR)\StdAfx.sbr"

"$(OUTDIR)\MyGroupWise.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<

LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:windows /dll /incremental:no
/pdb:"$(OUTDIR)\MyGroupWise.pdb" /machine:I386 /def:".\MyGroupWise.def"
/out:"$(OUTDIR)\MyGroupWise.dll" /implib:"$(OUTDIR)\MyGroupWise.lib"
DEF_FILE= \
".\MyGroupWise.def"
LINK32_OBJS= \
"$(INTDIR)\apigw.obj" \
"$(INTDIR)\GroupWiseInterface.obj" \
"$(INTDIR)\Misc.obj" \
"$(INTDIR)\MyGroupWise.obj" \
"$(INTDIR)\RegistryKey.obj" \
"$(INTDIR)\StdAfx.obj" \
"$(INTDIR)\MyGroupWise.res"

"$(OUTDIR)\MyGroupWise.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<

!ELSEIF "$(CFG)" == "MyGroupWise - Win32 Debug"

OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros

ALL : "$(OUTDIR)\MyGroupWise.dll" "$(OUTDIR)\MyGroupWise.bsc"
"..\..\..\Bin\MyGroupWise.dll" "..\..\..\Bin\MyGroupWise.pdb"


CLEAN :
-@erase "$(INTDIR)\apigw.obj"
-@erase "$(INTDIR)\apigw.sbr"
-@erase "$(INTDIR)\GroupWiseInterface.obj"
-@erase "$(INTDIR)\GroupWiseInterface.sbr"
-@erase "$(INTDIR)\Misc.obj"
-@erase "$(INTDIR)\Misc.sbr"
-@erase "$(INTDIR)\MyGroupWise.obj"
-@erase "$(INTDIR)\MyGroupWise.pch"
-@erase "$(INTDIR)\MyGroupWise.res"
-@erase "$(INTDIR)\MyGroupWise.sbr"
-@erase "$(INTDIR)\RegistryKey.obj"
-@erase "$(INTDIR)\RegistryKey.sbr"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\StdAfx.sbr"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\MyGroupWise.bsc"
-@erase "$(OUTDIR)\MyGroupWise.dll"
-@erase "$(OUTDIR)\MyGroupWise.exp"
-@erase "$(OUTDIR)\MyGroupWise.ilk"
-@erase "$(OUTDIR)\MyGroupWise.lib"
-@erase "$(OUTDIR)\MyGroupWise.pdb"
-@erase "..\..\..\Bin\MyGroupWise.dll"
-@erase "..\..\..\Bin\MyGroupWise.pdb"

"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D
"_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_AFXEXT"
/FR"$(INTDIR)\\" /Fp"$(INTDIR)\MyGroupWise.pch" /Yu"stdafx.h"
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c

..c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

..cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

..cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

..c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

..cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

..cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\MyGroupWise.res" /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\MyGroupWise.bsc"
BSC32_SBRS= \
"$(INTDIR)\apigw.sbr" \
"$(INTDIR)\GroupWiseInterface.sbr" \
"$(INTDIR)\Misc.sbr" \
"$(INTDIR)\MyGroupWise.sbr" \
"$(INTDIR)\RegistryKey.sbr" \
"$(INTDIR)\StdAfx.sbr"

"$(OUTDIR)\MyGroupWise.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<

LINK32=link.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib comctl32.lib /nologo /subsystem:windows /dll /incremental:yes
/pdb:"$(OUTDIR)\MyGroupWise.pdb" /debug /machine:I386
/def:".\MyGroupWise.def" /out:"$(OUTDIR)\MyGroupWise.dll"
/implib:"$(OUTDIR)\MyGroupWise.lib" /pdbtype:sept
DEF_FILE= \
".\MyGroupWise.def"
LINK32_OBJS= \
"$(INTDIR)\apigw.obj" \
"$(INTDIR)\GroupWiseInterface.obj" \
"$(INTDIR)\Misc.obj" \
"$(INTDIR)\MyGroupWise.obj" \
"$(INTDIR)\RegistryKey.obj" \
"$(INTDIR)\StdAfx.obj" \
"$(INTDIR)\MyGroupWise.res"

"$(OUTDIR)\MyGroupWise.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<

OutDir=.\Debug
TargetName=MyGroupWise
InputPath=.\Debug\MyGroupWise.dll
SOURCE="$(InputPath)"

"..\..\..\Bin\MyGroupWise.dll" "..\..\..\Bin\MyGroupWise.pdb" : $(SOURCE)
"$(INTDIR)" "$(OUTDIR)"
<<tempfile.bat
@echo off
attrib -R ..\..\..\Bin\$(TargetName).dll
copy $(OutDir)\$(TargetName).dll ..\..\..\Bin\$(TargetName).dll
attrib -R ..\..\..\Bin\$(TargetName).pdb
copy $(OutDir)\$(TargetName).pdb ..\..\..\Bin\$(TargetName).pdb
<<


!ENDIF


!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("MyGroupWise.dep")
!INCLUDE "MyGroupWise.dep"
!ELSE
!MESSAGE Warning: cannot find "MyGroupWise.dep"
!ENDIF
!ENDIF


!IF "$(CFG)" == "MyGroupWise - Win32 Release" || "$(CFG)" == "MyGroupWise -
Win32 Debug"
SOURCE=.\apigw.cpp

"$(INTDIR)\apigw.obj" "$(INTDIR)\apigw.sbr" : $(SOURCE) "$(INTDIR)"
"$(INTDIR)\MyGroupWise.pch"


SOURCE=.\GroupWiseInterface.cpp

"$(INTDIR)\GroupWiseInterface.obj" "$(INTDIR)\GroupWiseInterface.sbr" :
$(SOURCE) "$(INTDIR)" "$(INTDIR)\MyGroupWise.pch"


SOURCE=.\Misc.cpp

"$(INTDIR)\Misc.obj" "$(INTDIR)\Misc.sbr" : $(SOURCE) "$(INTDIR)"
"$(INTDIR)\MyGroupWise.pch"


SOURCE=.\MyGroupWise.cpp

"$(INTDIR)\MyGroupWise.obj" "$(INTDIR)\MyGroupWise.sbr" : $(SOURCE)
"$(INTDIR)" "$(INTDIR)\MyGroupWise.pch"


SOURCE=.\MyGroupWise.rc

"$(INTDIR)\MyGroupWise.res" : $(SOURCE) "$(INTDIR)"
$(RSC) $(RSC_PROJ) $(SOURCE)


SOURCE=.\RegistryKey.cpp

"$(INTDIR)\RegistryKey.obj" "$(INTDIR)\RegistryKey.sbr" : $(SOURCE)
"$(INTDIR)" "$(INTDIR)\MyGroupWise.pch"


SOURCE=.\StdAfx.cpp

!IF "$(CFG)" == "MyGroupWise - Win32 Release"

CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "NT" /D "WIN32" /D
"_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_AFXEXT"
/FR"$(INTDIR)\\" /Fp"$(INTDIR)\MyGroupWise.pch" /Yc"stdafx.h"
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c

"$(INTDIR)\StdAfx.obj" "$(INTDIR)\StdAfx.sbr" "$(INTDIR)\MyGroupWise.pch" :
$(SOURCE) "$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<


!ELSEIF "$(CFG)" == "MyGroupWise - Win32 Debug"

CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D
"_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_AFXEXT"
/FR"$(INTDIR)\\" /Fp"$(INTDIR)\MyGroupWise.pch" /Yc"stdafx.h"
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c

"$(INTDIR)\StdAfx.obj" "$(INTDIR)\StdAfx.sbr" "$(INTDIR)\MyGroupWise.pch" :
$(SOURCE) "$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<


!ENDIF


!ENDIF



Deleting intermediate files and output files for project 'mail - Win32
Debug'.
--------------------Configuration: mail - Win32 Debug--------------------
Compiling resources...
Compiling...
abook.cpp
main.cpp
c:\pisource\thirdparty\gwsdk\gwobjapi\sample\mail\ cpp\gwoapi.h(10941) :
warning C4099: 'Folder' : type name first seen using 'struct' now seen using
'class'
c:\program files\microsoft sdk\include\shldisp.h(2364) : see
declaration of 'Folder'
c:\pisource\thirdparty\gwsdk\gwobjapi\sample\mail\ cpp\gwoapi.h(10947) :
warning C4099: 'Folder2' : type name first seen using 'struct' now seen
using 'class'
c:\program files\microsoft sdk\include\shldisp.h(2712) : see
declaration of 'Folder2'
c:\pisource\thirdparty\gwsdk\gwobjapi\sample\mail\ cpp\gwoapi.h(10953) :
warning C4099: 'Folder3' : type name first seen using 'struct' now seen
using 'class'
c:\program files\microsoft sdk\include\shldisp.h(3003) : see
declaration of 'Folder3'
msg.cpp
sendmail.cpp
util.cpp
Linking...

Mail.exe - 0 error(s), 3 warning(s)