Index: gpgme++/context.cpp
===================================================================
--- gpgme++/context.cpp	(revision 716872)
+++ gpgme++/context.cpp	(working copy)
@@ -480,7 +480,7 @@
 
   std::vector<Key> Context::signingKeys() const {
     std::vector<Key> result;
-    for ( unsigned int i = 0 ; gpgme_key_t key = gpgme_signers_enum( d->ctx, i ) ; ++i )
+    for ( unsigned int i = 0 ; struct _gpgme_key* key = gpgme_signers_enum( d->ctx, i ) ; ++i )
       result.push_back( Key( key, false ) );
     return result;
   }
Index: gpgme++/key.cpp
===================================================================
--- gpgme++/key.cpp	(revision 716872)
+++ gpgme++/key.cpp	(working copy)
@@ -38,9 +38,9 @@
 
   class Key::Private {
   public:
-    Private( gpgme_key_t aKey ) : key( aKey ) {}
+    Private( struct _gpgme_key* aKey ) : key( aKey ) {}
 
-    gpgme_key_t key;
+    struct _gpgme_key* key;
   };
 
   Key::Key() {
@@ -49,7 +49,7 @@
 
   Key::Key( const Null & ) : d( new Private( 0 ) ) {}
 
-  Key::Key( gpgme_key_t key, bool ref ) {
+  Key::Key( struct _gpgme_key* key, bool ref ) {
     d = new Private( key );
     if ( ref && d->key )
       gpgme_key_ref( d->key );
@@ -71,7 +71,7 @@
     return d->key == 0;
   }
 
-  gpgme_key_t Key::impl() const {
+  struct _gpgme_key* Key::impl() const {
     return d->key;
   }
 
@@ -90,7 +90,7 @@
     if ( !d->key )
       return 0;
     unsigned int count = 0;
-    for ( gpgme_user_id_t uid = d->key->uids ; uid ; uid = uid->next )
+    for ( struct _gpgme_user_id* uid = d->key->uids ; uid ; uid = uid->next )
       ++count;
     return count;
   }
@@ -99,7 +99,7 @@
     if ( !d->key )
       return 0;
     unsigned int count = 0;
-    for ( gpgme_sub_key_t subkey = d->key->subkeys ; subkey ; subkey = subkey->next )
+    for ( struct _gpgme_subkey* subkey = d->key->subkeys ; subkey ; subkey = subkey->next )
       ++count;
     return count;
   }
@@ -110,7 +110,7 @@
 
     vector<UserID> v;
     v.reserve( numUserIDs() );
-    for ( gpgme_user_id_t uid = d->key->uids ; uid ; uid = uid->next )
+    for ( struct _gpgme_user_id* uid = d->key->uids ; uid ; uid = uid->next )
       v.push_back( UserID( d->key, uid ) );
     return v;
   }
@@ -121,7 +121,7 @@
 
     vector<Subkey> v;
     v.reserve( numSubkeys() );
-    for ( gpgme_sub_key_t subkey = d->key->subkeys ; subkey ; subkey = subkey->next )
+    for ( struct _gpgme_subkey* subkey = d->key->subkeys ; subkey ; subkey = subkey->next )
       v.push_back( Subkey( d->key, subkey ) );
     return v;
   }
@@ -262,11 +262,11 @@
 
   class Subkey::Private {
   public:
-    Private( gpgme_key_t aKey, unsigned int idx )
+    Private( struct _gpgme_key* aKey, unsigned int idx )
       : key( aKey ), subkey( 0 )
     {
       if ( key )
-	for ( gpgme_sub_key_t s = key->subkeys ; s ; s = s->next, --idx )
+	for ( struct _gpgme_subkey* s = (_gpgme_subkey*)key->subkeys ; s ; s = (_gpgme_subkey*)s->next, --idx )
 	  if ( idx == 0 ) {
 	    subkey = s;
 	    break;
@@ -275,11 +275,11 @@
 	key = 0;
     }
 
-    Private( gpgme_key_t aKey, gpgme_sub_key_t aSubkey )
+    Private( struct _gpgme_key* aKey, struct _gpgme_subkey* aSubkey )
       : key( aKey ), subkey( 0 )
     {
       if ( key )
-	for ( gpgme_sub_key_t s = key->subkeys ; s ; s = s->next )
+	for ( struct _gpgme_subkey* s = key->subkeys ; s ; s = s->next )
 	  if ( s == aSubkey ) { // verify this subkey really belongs to this key
 	    subkey = aSubkey;
 	    break;
@@ -288,17 +288,17 @@
 	key = 0;
     }
 
-    gpgme_key_t key;
-    gpgme_sub_key_t subkey;
+    struct _gpgme_key* key;
+    struct _gpgme_subkey* subkey;
   };
 
-  Subkey::Subkey( gpgme_key_t key, unsigned int idx ) {
+  Subkey::Subkey( struct _gpgme_key* key, unsigned int idx ) {
     d = new Private( key, idx );
     if ( d->key )
       gpgme_key_ref( d->key );
   }
 
-  Subkey::Subkey( gpgme_key_t key, gpgme_sub_key_t subkey ) {
+  Subkey::Subkey( struct _gpgme_key* key, struct _gpgme_subkey* subkey ) {
     d = new Private( key, subkey );
     if ( d->key )
       gpgme_key_ref( d->key );
@@ -408,11 +408,11 @@
 
   class UserID::Private {
   public:
-    Private( gpgme_key_t aKey, unsigned int idx )
+    Private( struct _gpgme_key* aKey, unsigned int idx )
       : key( aKey ), uid( 0 )
     {
       if ( key )
-	for ( gpgme_user_id_t u = key->uids ; u ; u = u->next, --idx )
+	for ( struct _gpgme_user_id* u = key->uids ; u ; u = u->next, --idx )
 	  if ( idx == 0 ) {
 	    uid = u;
 	    break;
@@ -421,11 +421,11 @@
 	key = 0;
     }
 
-    Private( gpgme_key_t aKey, gpgme_user_id_t aUid )
+    Private( struct _gpgme_key* aKey, struct _gpgme_user_id* aUid )
       : key( aKey ), uid( 0 )
     {
       if ( key )
-	for ( gpgme_user_id_t u = key->uids ; u ; u = u->next )
+	for ( struct _gpgme_user_id* u = key->uids ; u ; u = u->next )
 	  if ( u == aUid ) {
 	    uid = u;
 	    break;
@@ -434,17 +434,17 @@
 	key = 0;
     }
 
-    gpgme_key_t key;
-    gpgme_user_id_t uid;
+    struct _gpgme_key* key;
+    struct _gpgme_user_id* uid;
   };
 
-  UserID::UserID( gpgme_key_t key, gpgme_user_id_t uid ) {
+  UserID::UserID( struct _gpgme_key* key, struct _gpgme_user_id* uid ) {
     d = new Private( key, uid );
     if ( d->key )
       gpgme_key_ref( d->key );
   }
 
-  UserID::UserID( gpgme_key_t key, unsigned int idx ) {
+  UserID::UserID( struct _gpgme_key* key, unsigned int idx ) {
     d = new Private( key, idx );
     if ( d->key )
       gpgme_key_ref( d->key );
@@ -478,7 +478,7 @@
     if ( !d->uid )
       return 0;
     unsigned int count = 0;
-    for ( gpgme_key_sig_t sig = d->uid->signatures ; sig ; sig = sig->next )
+    for ( struct _gpgme_key_sig* sig = d->uid->signatures ; sig ; sig = sig->next )
       ++count;
     return count;
   }
@@ -489,7 +489,7 @@
 
     vector<Signature> v;
     v.reserve( numSignatures() );
-    for ( gpgme_key_sig_t sig = d->uid->signatures ; sig ; sig = sig->next )
+    for ( struct _gpgme_key_sig* sig = d->uid->signatures ; sig ; sig = sig->next )
       v.push_back( Signature( d->key, d->uid, sig ) );
     return v;
   }
@@ -554,14 +554,14 @@
 
   class UserID::Signature::Private {
   public:
-    Private( gpgme_key_t aKey, gpgme_user_id_t aUid, unsigned int idx )
+    Private( struct _gpgme_key* aKey, struct _gpgme_user_id* aUid, unsigned int idx )
       : key( aKey ), uid( 0 ), sig( 0 )
     {
       if ( key )
-	for ( gpgme_user_id_t u = key->uids ; u ; u = u->next )
+	for ( struct _gpgme_user_id* u = key->uids ; u ; u = u->next )
 	  if ( u == aUid ) {
 	    uid = u;
-	    for ( gpgme_key_sig_t s = uid->signatures ; s ; s = s->next, --idx )
+	    for ( struct _gpgme_key_sig* s = uid->signatures ; s ; s = s->next, --idx )
 	      if ( idx == 0 ) {
 		sig = s;
 		break;
@@ -575,14 +575,14 @@
       }
     }
 
-    Private( gpgme_key_t aKey, gpgme_user_id_t aUid, gpgme_key_sig_t aSig )
+    Private( struct _gpgme_key* aKey, struct _gpgme_user_id* aUid, struct _gpgme_key_sig* aSig )
       : key( aKey ), uid( 0 ), sig( 0 )
     {
       if ( key )
-	for ( gpgme_user_id_t u = key->uids ; u ; u = u->next )
+	for ( struct _gpgme_user_id* u = key->uids ; u ; u = u->next )
 	  if ( u == aUid ) {
 	    uid = u;
-	    for ( gpgme_key_sig_t s = uid->signatures ; s ; s = s->next )
+	    for ( struct _gpgme_key_sig* s = uid->signatures ; s ; s = s->next )
 	      if ( s == aSig ) {
 		sig = s;
 		break;
@@ -596,18 +596,18 @@
       }
     }
 
-    gpgme_key_t key;
-    gpgme_user_id_t uid;
-    gpgme_key_sig_t sig;
+    struct _gpgme_key* key;
+    struct _gpgme_user_id* uid;
+    struct _gpgme_key_sig* sig;
   };
 
-  UserID::Signature::Signature( gpgme_key_t key, gpgme_user_id_t uid, unsigned int idx ) {
+  UserID::Signature::Signature( struct _gpgme_key* key, struct _gpgme_user_id* uid, unsigned int idx ) {
     d = new Private( key, uid, idx );
     if ( d->key )
       gpgme_key_ref( d->key );
   }
 
-  UserID::Signature::Signature( gpgme_key_t key, gpgme_user_id_t uid, gpgme_key_sig_t sig ) {
+  UserID::Signature::Signature( struct _gpgme_key* key, struct _gpgme_user_id* uid, struct _gpgme_key_sig* sig ) {
     d = new Private( key, uid, sig );
     if ( d->key )
       gpgme_key_ref( d->key );
Index: gpgme++/gpgmefw.h
===================================================================
--- gpgme++/gpgmefw.h	(revision 716872)
+++ gpgme++/gpgmefw.h	(working copy)
@@ -23,6 +23,10 @@
 #ifndef __GPGMEPP_GPGMEFW_H__
 #define __GPGMEPP_GPGMEFW_H__
 
+# ifdef _MSC_VER
+#  include <gpgme.h>
+# else
+
 struct gpgme_context;
 typedef gpgme_context * gpgme_ctx_t;
 
@@ -58,4 +62,6 @@
 struct _gpgme_recipient;
 typedef struct _gpgme_recipient * gpgme_recipient_t;
 
+# endif
+
 #endif // __GPGMEPP_GPGMEFW_H__
Index: gpgme++/key.h
===================================================================
--- gpgme++/key.h	(revision 716872)
+++ gpgme++/key.h	(working copy)
@@ -49,7 +49,7 @@
   public:
     Key();
     /* implicit */ Key( const Null & );
-    Key( gpgme_key_t key, bool acquireRef );
+    Key( struct _gpgme_key* key, bool acquireRef );
     Key( const Key & key );
     ~Key();
 
@@ -117,7 +117,7 @@
     unsigned int keyListMode() const;
 
   private:
-    gpgme_key_t impl() const;
+    struct _gpgme_key* impl() const;
     class Private;
     Private * d;
   };
@@ -128,8 +128,8 @@
 
   class GPGMEPP_EXPORT Subkey {
   public:
-    explicit Subkey( gpgme_key_t key=0, gpgme_sub_key_t subkey=0 );
-    Subkey( gpgme_key_t key, unsigned int idx );
+    explicit Subkey( _gpgme_key* key=0, _gpgme_subkey* subkey=0 );
+    Subkey( struct _gpgme_key* key, unsigned int idx );
     Subkey( const Subkey & other );
     ~Subkey();
 
@@ -185,8 +185,8 @@
   public:
     class Signature;
 
-    explicit UserID( gpgme_key_t key=0, gpgme_user_id_t uid=0 );
-    UserID( gpgme_key_t key, unsigned int idx );
+    explicit UserID( struct _gpgme_key* key=0, struct _gpgme_user_id* uid=0 );
+    UserID( struct _gpgme_key* key, unsigned int idx );
     UserID( const UserID & other );
     ~UserID();
 
@@ -235,8 +235,8 @@
   public:
     typedef GPGMEPP_DEPRECATED GpgME::Notation Notation;
 
-    explicit Signature( gpgme_key_t key=0, gpgme_user_id_t uid=0, gpgme_key_sig_t sig=0 );
-    Signature( gpgme_key_t key, gpgme_user_id_t uid, unsigned int idx );
+    explicit Signature( struct _gpgme_key* key=0, struct _gpgme_user_id* uid=0, struct _gpgme_key_sig* sig=0 );
+    Signature( struct _gpgme_key* key, struct _gpgme_user_id* uid, unsigned int idx );
     Signature( const Signature & other );
     ~Signature();
 