Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 7

Qt-interest Archive, March 2002
WinAPI from Qt


Message 1 in thread


<<< text/html: EXCLUDED >>>


Message 2 in thread

Greetings, Oleg,

3/18/2002 11:00:13 AM, "Oleg Ivanov" <oivanov@heliosnet.ru> wrote:

>  Have anybody solved syntax problem of some Windows Platform SDK API using.
>  For example to translate such simple program fragment
>  .....   <snip> ...

I'm not sure from your e-mail what your problem is, exactly.  I had a
problem using an SDK call -- wierd compiler errors which seemed
to have to do with a macro "TEXT", which I couldn't find a definition
for.  Your problem may be similar.

My "fix" was to put the SDK calls in a method of their own -- a two-line
wrapper.  I put the method in a file which contained nothing at all related to 
Qt.  I compiled it as a dll, using MSVC 6.  All went well - no strange
messages.  Then, I put the dll into a directory on my path, and it worked.

Some "fix", eh?  If you can stand the kludge, perhaps this strategy will
work for you.

Regards,
   Jerry Barenholtz
   jerryb@saltspring.com


Message 3 in thread

Hi, Jerry.
My question is illustration of rule "think twice to say ones" .. and think more to write something.
The fact is that I haven't write pure Win32 or MFC application for a long time. So I've used Qt-style of includes: if you need some class - include *.h file where this class declared. This is wrong for WinAPI. It's wrong to include only .. say <winnt.h> if you going to use API declared there.

To solve this I've generated new empty win32 project from VS to see content of stdafx.h file an or my God!
there is only 
#include <windows.h>
!! 
An this is solve my problem.

I'm ashamed.
And your method of wrapping could be usefull too but for more complex cases.
In my case I just was in a hurry.
Thank you 
	Oleg

-----Original Message-----
From: Jerry Barenholtz [mailto:jerryb@saltspring.com]
Sent: Tuesday, March 19, 2002 12:05 PM
To: Qt-interest
Subject: Re: WinAPI from Qt


Greetings, Oleg,

3/18/2002 11:00:13 AM, "Oleg Ivanov" <oivanov@heliosnet.ru> wrote:

>  Have anybody solved syntax problem of some Windows Platform SDK API using.
>  For example to translate such simple program fragment
>  .....   <snip> ...

I'm not sure from your e-mail what your problem is, exactly.  I had a
problem using an SDK call -- wierd compiler errors which seemed
to have to do with a macro "TEXT", which I couldn't find a definition
for.  Your problem may be similar.

My "fix" was to put the SDK calls in a method of their own -- a two-line
wrapper.  I put the method in a file which contained nothing at all related to 
Qt.  I compiled it as a dll, using MSVC 6.  All went well - no strange
messages.  Then, I put the dll into a directory on my path, and it worked.

Some "fix", eh?  If you can stand the kludge, perhaps this strategy will
work for you.

Regards,
   Jerry Barenholtz
   jerryb@saltspring.com

--
 [ signature omitted ]