www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - Platform SDK

reply Fabiuccio <fabienstein eeaaoo.com> writes:
Hi folks!!!

Is it possible to use Microsoft's Platform SDK
libraries and header files for building applications
with the DMC++ compiler, or the binary formats are
non compatible ?

In case it is, would be a great improvement on the outdated
DM includes/libs.

Thanks.
Jun 26 2002
parent reply Jan Knepper <jan smartsoft.cc> writes:
I am working on that, but haven't been able to finish the job
yet.
One of the problems is regenerating the import libraries which I
'patched' IMPLIB for so it actually check an header file for the
prototypes and adds the proper  n to the function name.

Jan



Fabiuccio wrote:

 Hi folks!!!

 Is it possible to use Microsoft's Platform SDK
 libraries and header files for building applications
 with the DMC++ compiler, or the binary formats are
 non compatible ?

 In case it is, would be a great improvement on the outdated
 DM includes/libs.

 Thanks.
Jun 26 2002
next sibling parent reply Fabiuccio <fabienstein eeaaoo.com> writes:
Folgorato da brillante idea, Jan Knepper ha scritto il 26 Jun 2002  
(news:3D19D9A6.4B56D6C2 smartsoft.cc):

 I am working on that, but haven't been able to finish the job
 yet.
 One of the problems is regenerating the import libraries which I
 'patched' IMPLIB for so it actually check an header file for the
 prototypes and adds the proper  n to the function name.
 
 Jan
There is already an IMPDEF on the CYGWIN forum (www.cygwin.com/ml/cygwin/1997-04/msg00221.html) that makes the job creating a .DEF file with the import numerals as well. The .lib file creation then is straightforward. The issue I was asking for is whether there is binary compatibility foe the between the produced object files and the MS PDSK libraries,i.e. if the linker is able to do its job. Thanx.
Jun 26 2002
parent Jan Knepper <jan smartsoft.cc> writes:
Fabiuccio wrote:

 Folgorato da brillante idea, Jan Knepper ha scritto il 26 Jun 2002
 (news:3D19D9A6.4B56D6C2 smartsoft.cc):

 I am working on that, but haven't been able to finish the job
 yet.
 One of the problems is regenerating the import libraries which I
 'patched' IMPLIB for so it actually check an header file for the
 prototypes and adds the proper  n to the function name.

 Jan
There is already an IMPDEF on the CYGWIN forum (www.cygwin.com/ml/cygwin/1997-04/msg00221.html) that makes the job creating a .DEF file with the import numerals as well. The .lib file creation then is straightforward.
What do you mean? I do not think any you can actually add the proper n to the exported names of a .DLL without the prototype of the function. I am not about to hand write the .DEF files... My patched IMPLIB does it all for me.
 The issue I was asking for is whether there is binary compatibility
 foe the between the produced object files and the MS PDSK
 libraries,i.e. if the linker is able to do its job.
I don't think so as MS dropped the n from their exported names. DMC++ requires those... Jan
Jun 26 2002
prev sibling parent reply Christof Meerwald <cmeerw web.de> writes:
On Wed, 26 Jun 2002 11:11:34 -0400, Jan Knepper wrote:
 Fabiuccio wrote:
 Is it possible to use Microsoft's Platform SDK
 libraries and header files for building applications
 with the DMC++ compiler, or the binary formats are
 non compatible ?
I am working on that, but haven't been able to finish the job yet. One of the problems is regenerating the import libraries which I 'patched' IMPLIB for so it actually check an header file for the prototypes and adds the proper n to the function name.
Why not use the libraries included in Microsoft's Platform SDK? You just have to convert them: - use "link /lib /convert" (using the Microsoft linker included in the Platform SDK) to convert the libraries to the old COFF format - use DMC's coff2omf to convert the libraries to OMF works for me. bye, Christof -- http://cmeerw.org JID: cmeerw jabber.at mailto cmeerw at web.de ...and what have you contributed to the Net?
Jun 27 2002
next sibling parent fractal clark.net writes:
In article <affftv$287b$1 digitaldaemon.com>, Christof Meerwald says...

On Wed, 26 Jun 2002 11:11:34 -0400, Jan Knepper wrote:
 Fabiuccio wrote:
 Is it possible to use Microsoft's Platform SDK
 libraries and header files for building applications
 with the DMC++ compiler, or the binary formats are
 non compatible ?
I am working on that, but haven't been able to finish the job yet.
Am using download version of 8.29, and just ran into M$ SDK out of date win32/include and out of date lib problem. I also see that the distributed kernel32.lib was last made in 1996. True, not much has changed, but there have been changes. I have a very slow internet connection, and when I check M$DN site, they say 200MB download for core SDK. Yikes! Not to rush, but I'm trying to use some thread safe synchronization objects, and I don't want to hack something in if you have more up to date win32\include and M$ core lib in the works. So, how long until finish modern SDK header and lib for M$ core API? TIA, Richard
Sep 20 2002
prev sibling next sibling parent Jan Knepper <jan smartsoft.cc> writes:
Christof Meerwald wrote:

 On Wed, 26 Jun 2002 11:11:34 -0400, Jan Knepper wrote:
 Fabiuccio wrote:
 Is it possible to use Microsoft's Platform SDK
 libraries and header files for building applications
 with the DMC++ compiler, or the binary formats are
 non compatible ?
I am working on that, but haven't been able to finish the job yet. One of the problems is regenerating the import libraries which I 'patched' IMPLIB for so it actually check an header file for the prototypes and adds the proper n to the function name.
Why not use the libraries included in Microsoft's Platform SDK? You just have to convert them: - use "link /lib /convert" (using the Microsoft linker included in the Platform SDK) to convert the libraries to the old COFF format
These switches do not seem to exist for .NET's link...
Sep 20 2002
prev sibling parent reply Jan Knepper <jan smartsoft.cc> writes:
Christof Meerwald wrote:

 Why not use the libraries included in Microsoft's Platform SDK? You just
 have to convert them:

  - use "link /lib /convert" (using the Microsoft linker included in the
Platform
 SDK) to convert the libraries to the old COFF format
  - use DMC's coff2omf to convert the libraries to OMF
VC98's LIB (not LINK) actually does have the /convert switch and indeed if you do: LIB /convert shell32.lib followed by COFF2OMF shell32.lib It seems that a compatible .lib is being created... However... At first sight it seems to miss all the IID's and CLSID's... (So does the IMPLIB I patched for now, but I hope to fix that some day). Jan
Sep 20 2002
parent reply Christof Meerwald <cmeerw web.de> writes:
On Fri, 20 Sep 2002 09:15:11 -0400, Jan Knepper wrote:
 Christof Meerwald wrote:
  - use "link /lib /convert" (using the Microsoft linker included in the
Platform
 SDK) to convert the libraries to the old COFF format
VC98's LIB (not LINK) actually does have the /convert switch and indeed if you do: LIB /convert shell32.lib
But AFAIK "lib /convert shell32.lib" is the same as "link /lib /convert shell32.lib" (I guess lib is just a small wrapper around "link /lib") bye, Christof -- http://cmeerw.org JID: cmeerw jabber.at mailto cmeerw at web.de ...and what have you contributed to the Net?
Sep 20 2002
parent reply Jan Knepper <jan smartsoft.cc> writes:
Christof Meerwald wrote:

 On Fri, 20 Sep 2002 09:15:11 -0400, Jan Knepper wrote:
 Christof Meerwald wrote:
  - use "link /lib /convert" (using the Microsoft linker included in the
Platform
 SDK) to convert the libraries to the old COFF format
VC98's LIB (not LINK) actually does have the /convert switch and indeed if you do: LIB /convert shell32.lib
But AFAIK "lib /convert shell32.lib" is the same as "link /lib /convert shell32.lib" (I guess lib is just a small wrapper around "link /lib")
Tried, that, not with VC98, and it didn't work. It does not really make sense though to convert a library with a 'link' command... Could be just me...
Sep 20 2002
parent reply "Phill" <phillbert pacific.net.au> writes:
I also tried this method and had the same result
as Jan ie:
======================
Symbol Undefined _IID_IDirectDraw7
Lines Processed: 130061  Errors: 1  Warnings: 1
Build failed
=======================
Has anyone found a way around this problem?

Phill.

Has anyone solved this problem?
"Jan Knepper" <jan smartsoft.cc> wrote in message
news:3D8B90C0.E6789619 smartsoft.cc...
 Christof Meerwald wrote:

 On Fri, 20 Sep 2002 09:15:11 -0400, Jan Knepper wrote:
 Christof Meerwald wrote:
  - use "link /lib /convert" (using the Microsoft linker included in
the Platform
 SDK) to convert the libraries to the old COFF format
VC98's LIB (not LINK) actually does have the /convert switch and
indeed if you do:
 LIB /convert shell32.lib
But AFAIK "lib /convert shell32.lib" is the same as "link /lib /convert shell32.lib" (I guess lib is just a small wrapper around "link /lib")
Tried, that, not with VC98, and it didn't work. It does not really make sense though to convert a library with a 'link'
command... Could
 be just me...
Apr 10 2003
next sibling parent "Matthew Wilson" <dmd synesis.com.au> writes:
I don't know what else you have tried, but a relatively simple, albeit
hacky, way around this is to define the symbol internally.

const IID IID_IDirectDraw7 = { ... }

The value of IID_IDirectDraw7 will *never* change, so this should be fine.

However, you may want to insulate your code from a multiply defined symbol,
if IID_IDirectDraw7 becomes linked in the future. A way to get around this
is

// in global header
#define    IID_IDirectDraw7    IID_IDirectDraw7_internal


// in implementationfile.cpp
const IID IID_IDirectDraw7_internal = { ... };

That way even if/when you link to IID_IDirectDraw7 it'll all compile and
link and work no problem.

Naturally it's a little unattractive, since it's a #define, but because of
the immutability of IID values it is safe.


"Phill" <phillbert pacific.net.au> wrote in message
news:b73dpf$281n$1 digitaldaemon.com...
 I also tried this method and had the same result
 as Jan ie:
 ======================
 Symbol Undefined _IID_IDirectDraw7
 Lines Processed: 130061  Errors: 1  Warnings: 1
 Build failed
 =======================
 Has anyone found a way around this problem?

 Phill.

 Has anyone solved this problem?
 "Jan Knepper" <jan smartsoft.cc> wrote in message
 news:3D8B90C0.E6789619 smartsoft.cc...
 Christof Meerwald wrote:

 On Fri, 20 Sep 2002 09:15:11 -0400, Jan Knepper wrote:
 Christof Meerwald wrote:
  - use "link /lib /convert" (using the Microsoft linker included in
the Platform
 SDK) to convert the libraries to the old COFF format
VC98's LIB (not LINK) actually does have the /convert switch and
indeed if you do:
 LIB /convert shell32.lib
But AFAIK "lib /convert shell32.lib" is the same as "link /lib
/convert
 shell32.lib" (I guess lib is just a small wrapper around "link /lib")
Tried, that, not with VC98, and it didn't work. It does not really make sense though to convert a library with a 'link'
command... Could
 be just me...
Apr 10 2003
prev sibling next sibling parent "Nic Tiger" <nictiger progtech.ru> writes:
I've faced this problem couple months ago (mainly with DirectShow GUIDs),
and found the cause and solution.

Cause: VC uses 'struct __declspec(uuid("..."))' constructions hidden via
MIDL_INTERFACE macro

Solution: I wrote special parser which went through all headers and
extracted all GUIDs into separate sources, then compiled them and added to
library.

I doubt if this lib becomes copyrighted, so I don't publish it here, but you
are free to contact me directly and I will send it to you (in zip it is 48
Kb).

Nic Tiger.


"Phill" <phillbert pacific.net.au> сообщил/сообщила в новостях следующее:
news:b73dpf$281n$1 digitaldaemon.com...
 I also tried this method and had the same result
 as Jan ie:
 ======================
 Symbol Undefined _IID_IDirectDraw7
 Lines Processed: 130061  Errors: 1  Warnings: 1
 Build failed
 =======================
 Has anyone found a way around this problem?

 Phill.

 Has anyone solved this problem?
 "Jan Knepper" <jan smartsoft.cc> wrote in message
 news:3D8B90C0.E6789619 smartsoft.cc...
 Christof Meerwald wrote:

 On Fri, 20 Sep 2002 09:15:11 -0400, Jan Knepper wrote:
 Christof Meerwald wrote:
  - use "link /lib /convert" (using the Microsoft linker included in
the Platform
 SDK) to convert the libraries to the old COFF format
VC98's LIB (not LINK) actually does have the /convert switch and
indeed if you do:
 LIB /convert shell32.lib
But AFAIK "lib /convert shell32.lib" is the same as "link /lib
/convert
 shell32.lib" (I guess lib is just a small wrapper around "link /lib")
Tried, that, not with VC98, and it didn't work. It does not really make sense though to convert a library with a 'link'
command... Could
 be just me...
Apr 10 2003
prev sibling parent reply Jan Knepper <jan smartsoft.us> writes:
Yeah, create a file with the necessary IID's in there. Such as attached for
example...
Good luck!
Jan



Phill wrote:

 I also tried this method and had the same result
 as Jan ie:
 ======================
 Symbol Undefined _IID_IDirectDraw7
 Lines Processed: 130061  Errors: 1  Warnings: 1
 Build failed
 =======================
 Has anyone found a way around this problem?

 Phill.

 Has anyone solved this problem?
 "Jan Knepper" <jan smartsoft.cc> wrote in message
 news:3D8B90C0.E6789619 smartsoft.cc...
 Christof Meerwald wrote:

 On Fri, 20 Sep 2002 09:15:11 -0400, Jan Knepper wrote:
 Christof Meerwald wrote:
  - use "link /lib /convert" (using the Microsoft linker included in
the Platform
 SDK) to convert the libraries to the old COFF format
VC98's LIB (not LINK) actually does have the /convert switch and
indeed if you do:
 LIB /convert shell32.lib
But AFAIK "lib /convert shell32.lib" is the same as "link /lib /convert shell32.lib" (I guess lib is just a small wrapper around "link /lib")
Tried, that, not with VC98, and it didn't work. It does not really make sense though to convert a library with a 'link'
command... Could
 be just me...
Apr 10 2003
parent reply "Phill" <phillbert pacific.net.au> writes:
I found an even simpler way from the Microsoft
website, just add the following line before including
ddraw.h like this:

#define INITGUID
#include "ddraw.h"

This fixes  all of the IID's

Thanks to all  for your suggestions.

Phill.

"Jan Knepper" <jan smartsoft.us> wrote in message
news:3E95F5B7.14C29C84 smartsoft.us...
 Yeah, create a file with the necessary IID's in there. Such as attached
for
 example...
 Good luck!
 Jan



 Phill wrote:

 I also tried this method and had the same result
 as Jan ie:
 ======================
 Symbol Undefined _IID_IDirectDraw7
 Lines Processed: 130061  Errors: 1  Warnings: 1
 Build failed
 =======================
 Has anyone found a way around this problem?

 Phill.

 Has anyone solved this problem?
 "Jan Knepper" <jan smartsoft.cc> wrote in message
 news:3D8B90C0.E6789619 smartsoft.cc...
 Christof Meerwald wrote:

 On Fri, 20 Sep 2002 09:15:11 -0400, Jan Knepper wrote:
 Christof Meerwald wrote:
  - use "link /lib /convert" (using the Microsoft linker included
in
 the Platform
 SDK) to convert the libraries to the old COFF format
VC98's LIB (not LINK) actually does have the /convert switch and
indeed if you do:
 LIB /convert shell32.lib
But AFAIK "lib /convert shell32.lib" is the same as "link /lib
/convert
 shell32.lib" (I guess lib is just a small wrapper around "link
/lib")
 Tried, that, not with VC98, and it didn't work.
 It does not really make sense though to convert a library with a
'link'
 command... Could
 be just me...
---------------------------------------------------------------------------- ----
 #include <stdjak.h>

 #include <stdio.h>

 #include <objbase.h>



 static IID              IIDFromString     ( LPOLESTR );
 static CLSID            CLSIDFromString   ( LPOLESTR );



 extern "C" {

 const IID               IID_IWebBrowser2           = IIDFromString   (
L"{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}" );
 const IID               IID_IHTMLAnchorElement     = IIDFromString   (
L"{3050f1da-98b5-11cf-bb82-00aa00bdce0b}" );
 const IID               IID_IHTMLDocument2         = IIDFromString   (
L"{332c4425-26cb-11d0-b483-00c04fd90119}" );
 const IID               IID_IHTMLElement           = IIDFromString   (
L"{3050f1ff-98b5-11cf-bb82-00aa00bdce0b}" );
 const IID               IID_IHTMLImgElement        = IIDFromString   (
L"{3050f240-98b5-11cf-bb82-00aa00bdce0b}" );
 const IID               IID_IHTMLFrameBase         = IIDFromString   (
L"{3050F311-98B5-11CF-BB82-00AA00BDCE0B}" );
 const IID               IID_IHTMLFramesCollection2 = IIDFromString   (
L"{332c4426-26cb-11d0-b483-00c04fd90119}" );
 const IID               IID_IHTMLWindow2           = IIDFromString   (
L"{332c4427-26cb-11d0-b483-00c04fd90119}" );
 const IID               IID_IDocHostUIHandler      = IIDFromString   (
L"{BD3F23C0-D43E-11CF-893B-00AA00BDCE1A}" );
 const IID               IID_IHTMLTextElement       = IIDFromString   (
L"{3050f218-98b5-11cf-bb82-00aa00bdce0b}" );
 const IID               IID_IHTMLFormElement       = IIDFromString   (
L"{3050f1f7-98b5-11cf-bb82-00aa00bdce0b}" );
 const IID               IID_IHTMLSelectElement     = IIDFromString   (
L"{3050f244-98b5-11cf-bb82-00aa00bdce0b}" );
 const IID               IID_IHTMLInputElement      = IIDFromString   (
L"{3050f5d2-98b5-11cf-bb82-00aa00bdce0b}" );
 const CLSID             CLSID_WebBrowser           = CLSIDFromString (
L"{8856F961-340A-11D0-A96B-00C04FD705A2}" );
 };



 static IID  IIDFromString ( LPOLESTR  str )
 {
    CLSID             clsid;
    IID               tmp;
    HRESULT           result;
    static TCHAR      message  [ 128 ];


    if ( ( result = CLSIDFromString ( str, &clsid ) ) != S_OK )
    {
       sprintf ( message, "CLSIDFromString %ld", result );
       MessageBox ( 0, message, __FUNC__, MB_ICONERROR | MB_OK );
 //    iMessage :: Report ( iMessage :: ButtonOk, __FUNC__, 0,
"CLSIDFromString %ld", result );
    }

    if ( ( result = IIDFromString  ( str, &tmp ) ) != S_OK )
    {
       sprintf ( message, "IIDFromString %ld", result );
       MessageBox ( 0, message, __FUNC__, MB_ICONERROR | MB_OK );
 //    iMessage :: Report ( iMessage :: ButtonOk,  __FUNC__, 0, "%s",
__FILE__ );
    }

    return ( tmp );
 }



 static CLSID  CLSIDFromString ( LPOLESTR  str )
 {
    CLSID             clsid;
    HRESULT           result;
    static TCHAR      message  [ 128 ];


    if ( ( result = CLSIDFromString ( str, &clsid ) ) != S_OK )
    {
       sprintf ( message, "CLSIDFromString %ld", result );
       MessageBox ( 0, message, __FUNC__, MB_ICONERROR | MB_OK );
 //    iMessage :: Report ( iMessage :: ButtonOk, __FUNC__, 0,
"CLSIDFromString %ld", result );
    }

    return ( clsid );
 }
Apr 10 2003
parent reply Jan Knepper <jan smartsoft.us> writes:
Cool!
This might add quite a bit of 'size' to your code though...



Phill wrote:

 I found an even simpler way from the Microsoft
 website, just add the following line before including
 ddraw.h like this:

 #define INITGUID
 #include "ddraw.h"

 This fixes  all of the IID's

 Thanks to all  for your suggestions.

 Phill.
Apr 11 2003
next sibling parent "Matthew Wilson" <dmd synesis.com.au> writes:
It does. That's the reason I often eschew it in favour of the "#define _"
technique, especially when creating small COM DLLs

"Jan Knepper" <jan smartsoft.us> wrote in message
news:3E96CDB8.E3C47E7C smartsoft.us...
 Cool!
 This might add quite a bit of 'size' to your code though...



 Phill wrote:

 I found an even simpler way from the Microsoft
 website, just add the following line before including
 ddraw.h like this:

 #define INITGUID
 #include "ddraw.h"

 This fixes  all of the IID's

 Thanks to all  for your suggestions.

 Phill.
Apr 11 2003
prev sibling parent "Phill" <phillbert pacific.net.au> writes:
Ok , I see what you mean . Nic sent me a file
that has fixed the problem any way. Im just glad to
get rid of the headache and learn something new from
this. Im just another new Imigrant from Java.

Thanks
BTW, Jan your website has your old Email
address on it , I see you have a new one.
.cc -> .us

Phill.

"Jan Knepper" <jan smartsoft.us> wrote in message
news:3E96CDB8.E3C47E7C smartsoft.us...
 Cool!
 This might add quite a bit of 'size' to your code though...



 Phill wrote:

 I found an even simpler way from the Microsoft
 website, just add the following line before including
 ddraw.h like this:

 #define INITGUID
 #include "ddraw.h"

 This fixes  all of the IID's

 Thanks to all  for your suggestions.

 Phill.
Apr 11 2003