[Oledb-dev] Provider question

Arvo arvox at hot.ee
Sun Apr 9 21:32:13 GMT 2006


Hello Shachar,

>>Started from scratch - deleted pgoledb tree, checked out from cvs, converted project, compiled - look attached file.
>>
> I will, as soon as I have the patience to fire up my vmware again. I do
> not run Windows on any real machine of mine.

This explains many things :) I do not run anything other than various windows versions in all my real and virtual machines. (ATM I'm busy with making setup program for our commercial app - and setup needs nasty testing from W95 to W2003...)

Well, I'll try to make driver compile better. First on VS2002, then probably will install VS2005.

------------------------------------------------------------------------
>>
>>e:\PGOLEDB\postgresql-8.0.1\src\include\c.h(575) : warning C4005: 'StrNCpy' : macro redefinition
>>        e:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ShLwApi.h(304) : see previous definition of 'StrNCpy'
>>  
>>
> Please don't worry about this one. It's actually, more or less, on purpose.

> In debug builds I'm including some internal postgresql include files.
> This allows me to see the internal Postgresql structures in the VS
> debugger. This causes some harmless conflicts of definition. The include
> takes place inside StdAfx.h on line 67. Feel free to comment it out if
> it annoys you. This warning should not happen on Release builds.

Understood. I don't comment out anything, I just wanted to know.

>>statreg.cpp is obsolete. Please remove it from your project.
>>atlimpl.cpp is obsolete. Please remove it from your project.
>>  
>>
> Do you have any idea what these messages mean?

Yes, for me they mean that postgresql 8.0.1 is obsolete :)) Using PG 8.1.3 (current stable) these errors disappeared.


>>Compiling...
>>TypeInfo.cpp
>>e:\PGOLEDB\oledb\TypeInfo.cpp(32) : warning C4244: '=' : conversion from 'const __int64' to 'int', possible loss of data
>>e:\PGOLEDB\oledb\TypeInfo.cpp(75) : warning C4244: '=' : conversion from '__int64' to 'unsigned short', possible loss of data
>>e:\PGOLEDB\oledb\TypeInfo.cpp(77) : warning C4244: '=' : conversion from '__int64' to 'unsigned short', possible loss of data
>>e:\PGOLEDB\oledb\TypeInfo.cpp(79) : warning C4244: '=' : conversion from '__int64' to 'unsigned short', possible loss of data
>>e:\PGOLEDB\oledb\TypeInfo.cpp(80) : warning C4244: '=' : conversion from '__int64' to 'ULONG', possible loss of data
>>e:\PGOLEDB\oledb\TypeInfo.cpp(112) : warning C4244: '=' : conversion from 'double' to 'Timestamp', possible loss of data
>>e:\PGOLEDB\oledb\TypeInfo.cpp(155) : warning C4244: '=' : conversion from 'double' to 'Timestamp', possible loss of data
>>  
>>
> If memory servs me right, this code was copied from Postgresql itself. I
> wonder how it functions there.

I think that not any better. Maybe PG source tree has some warnings turned off. I think I can just cast results to appropriate types - after some code investigation of course.


> I'll have a look at the rest as soon as I get a chance.

Some ideas to make some warnings (including in atldb.h) disappear:

PgRs.h, line 73+:

    size_t GetCount() const
    {
        return GetSize();
    }

(maybe size_t isn't the best type? smtg unsigned would be necessary)

TypeInfo.cpp, line 240+:

{
    ATLASSERT(count>=(size_t)GetWidth_string( sess, res, tup_num, field_num ));
    int reslen=PQgetlength( res, tup_num, field_num );

TypeInfo.cpp, line 341+:

    void dump( BYTE *mem, size_t num ) {
        size_t i;
        for( i=0; i<num && i<(numshorts*2); ++i )


More to follow, maybe tomorrow :)

-- 
Best regards,
 Arvo                            mailto:arvox at hot.ee



More information about the Oledb-devel mailing list